diff --git a/pkgs/development/python-modules/jaraco_itertools/0001-Don-t-run-flake8-checks-during-the-build.patch b/pkgs/development/python-modules/jaraco_itertools/0001-Don-t-run-flake8-checks-during-the-build.patch new file mode 100644 index 000000000000..2dcf7d648626 --- /dev/null +++ b/pkgs/development/python-modules/jaraco_itertools/0001-Don-t-run-flake8-checks-during-the-build.patch @@ -0,0 +1,27 @@ +From fd56b0d85393d684bd3bf99f33d8638da884282f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= +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 +--- + 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 + diff --git a/pkgs/development/python-modules/jaraco_itertools/default.nix b/pkgs/development/python-modules/jaraco_itertools/default.nix index 7f1d954f68d2..5df70b6da97b 100644 --- a/pkgs/development/python-modules/jaraco_itertools/default.nix +++ b/pkgs/development/python-modules/jaraco_itertools/default.nix @@ -12,6 +12,11 @@ buildPythonPackage rec { }; nativeBuildInputs = [ setuptools_scm ]; + + patches = [ + ./0001-Don-t-run-flake8-checks-during-the-build.patch + ]; + propagatedBuildInputs = [ inflect more-itertools six ]; checkInputs = [ pytest ]; diff --git a/pkgs/development/python-modules/pytest-freezegun/default.nix b/pkgs/development/python-modules/pytest-freezegun/default.nix new file mode 100644 index 000000000000..8809bc143cb0 --- /dev/null +++ b/pkgs/development/python-modules/pytest-freezegun/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/development/python-modules/tempora/0001-pytest-remove-flake8-black-coverage.patch b/pkgs/development/python-modules/tempora/0001-pytest-remove-flake8-black-coverage.patch new file mode 100644 index 000000000000..f807a6d2515e --- /dev/null +++ b/pkgs/development/python-modules/tempora/0001-pytest-remove-flake8-black-coverage.patch @@ -0,0 +1,28 @@ +From 9dfd2a8fac4a643fd007390762ccc8564588b4bf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= +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 +--- + 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 + diff --git a/pkgs/development/python-modules/tempora/default.nix b/pkgs/development/python-modules/tempora/default.nix index 9b54953d28ce..d4139ce76218 100644 --- a/pkgs/development/python-modules/tempora/default.nix +++ b/pkgs/development/python-modules/tempora/default.nix @@ -1,7 +1,6 @@ { lib, buildPythonPackage, fetchPypi -, setuptools_scm, pytest, freezegun, backports_unittest-mock -, pytest-black, pytestcov, pytest-flake8 -, six, pytz, jaraco_functools }: +, setuptools_scm, pytest, pytest-freezegun, freezegun, backports_unittest-mock +, six, pytz, jaraco_functools, pythonOlder }: buildPythonPackage rec { pname = "tempora"; @@ -12,15 +11,22 @@ buildPythonPackage rec { sha256 = "e370d822cf48f5356aab0734ea45807250f5120e291c76712a1d766b49ae34f8"; }; + disabled = pythonOlder "3.2"; + nativeBuildInputs = [ setuptools_scm ]; + patches = [ + ./0001-pytest-remove-flake8-black-coverage.patch + ]; + 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 = '' - pytest -k 'not get_nearest_year_for_day' + pytest ''; meta = with lib; { diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0a3cbae305cd..c75b84e8ede7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -950,6 +950,8 @@ in { mpi = pkgs.openmpi; }; + pytest-freezegun = callPackage ../development/python-modules/pytest-freezegun { }; + python-baseconv = callPackage ../development/python-modules/python-baseconv { }; pycognito = callPackage ../development/python-modules/pycognito { };