Merge pull request #91479 from Mic92/python-fixes

This commit is contained in:
Jörg Thalheim 2020-06-25 12:34:45 +01:00 committed by GitHub
commit d35735ae25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 103 additions and 6 deletions

View File

@ -0,0 +1,27 @@
From fd56b0d85393d684bd3bf99f33d8638da884282f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 25 Jun 2020 09:52:11 +0100
Subject: [PATCH] disable flake8/black8/coverage from tests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
pytest.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pytest.ini b/pytest.ini
index 5027d34..4e2a2d2 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,5 +1,5 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8 --black --cov
+addopts=--doctest-modules
doctest_optionflags=ALLOW_UNICODE ELLIPSIS ALLOW_BYTES
filterwarnings=
--
2.27.0

View File

@ -12,6 +12,11 @@ buildPythonPackage rec {
}; };
nativeBuildInputs = [ setuptools_scm ]; nativeBuildInputs = [ setuptools_scm ];
patches = [
./0001-Don-t-run-flake8-checks-during-the-build.patch
];
propagatedBuildInputs = [ inflect more-itertools six ]; propagatedBuildInputs = [ inflect more-itertools six ];
checkInputs = [ pytest ]; checkInputs = [ pytest ];

View File

@ -0,0 +1,29 @@
{ lib
, buildPythonPackage
, fetchPypi
, freezegun
, pytest
}:
buildPythonPackage rec {
pname = "pytest-freezegun";
version = "0.4.1";
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "060cdf192848e50a4a681a5e73f8b544c4ee5ebc1fab3cb7223a0097bac2f83f";
};
propagatedBuildInputs = [
freezegun
pytest
];
meta = with lib; {
description = "Wrap tests with fixtures in freeze_time";
homepage = "https://github.com/ktosiek/pytest-freezegun";
license = licenses.mit;
maintainers = [ maintainers.mic92 ];
};
}

View File

@ -0,0 +1,28 @@
From 9dfd2a8fac4a643fd007390762ccc8564588b4bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Thu, 25 Jun 2020 10:16:52 +0100
Subject: [PATCH] pytest: remove flake8/black/coverage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
pytest.ini | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pytest.ini b/pytest.ini
index bd6998d..a464529 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8 --black --cov
+addopts=--doctest-modules
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
filterwarnings=
# suppress known warning
--
2.27.0

View File

@ -1,7 +1,6 @@
{ lib, buildPythonPackage, fetchPypi { lib, buildPythonPackage, fetchPypi
, setuptools_scm, pytest, freezegun, backports_unittest-mock , setuptools_scm, pytest, pytest-freezegun, freezegun, backports_unittest-mock
, pytest-black, pytestcov, pytest-flake8 , six, pytz, jaraco_functools, pythonOlder }:
, six, pytz, jaraco_functools }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "tempora"; pname = "tempora";
@ -12,15 +11,22 @@ buildPythonPackage rec {
sha256 = "e370d822cf48f5356aab0734ea45807250f5120e291c76712a1d766b49ae34f8"; sha256 = "e370d822cf48f5356aab0734ea45807250f5120e291c76712a1d766b49ae34f8";
}; };
disabled = pythonOlder "3.2";
nativeBuildInputs = [ setuptools_scm ]; nativeBuildInputs = [ setuptools_scm ];
patches = [
./0001-pytest-remove-flake8-black-coverage.patch
];
propagatedBuildInputs = [ six pytz jaraco_functools ]; propagatedBuildInputs = [ six pytz jaraco_functools ];
checkInputs = [ pytest pytest-flake8 pytest-black pytestcov freezegun backports_unittest-mock ]; checkInputs = [
pytest-freezegun pytest freezegun backports_unittest-mock
];
# missing pytest-freezegun package
checkPhase = '' checkPhase = ''
pytest -k 'not get_nearest_year_for_day' pytest
''; '';
meta = with lib; { meta = with lib; {

View File

@ -950,6 +950,8 @@ in {
mpi = pkgs.openmpi; mpi = pkgs.openmpi;
}; };
pytest-freezegun = callPackage ../development/python-modules/pytest-freezegun { };
python-baseconv = callPackage ../development/python-modules/python-baseconv { }; python-baseconv = callPackage ../development/python-modules/python-baseconv { };
pycognito = callPackage ../development/python-modules/pycognito { }; pycognito = callPackage ../development/python-modules/pycognito { };