From 54fb7a58006a6610453792b8b6edb7e148df67bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 24 Jan 2021 11:44:28 +0100 Subject: [PATCH 1/4] python2Packages.freezegun: 0.3.5 -> 0.3.15 --- pkgs/development/python-modules/freezegun/0.3.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/freezegun/0.3.nix b/pkgs/development/python-modules/freezegun/0.3.nix index 9dc88596f26..3ed4b6bc6ed 100644 --- a/pkgs/development/python-modules/freezegun/0.3.nix +++ b/pkgs/development/python-modules/freezegun/0.3.nix @@ -11,17 +11,15 @@ buildPythonPackage rec { pname = "freezegun"; - version = "0.3.5"; + version = "0.3.15"; src = fetchPypi { inherit pname version; - sha256 = "02ly89wwn0plcw8clkkzvxaw6zlpm8qyqpm9x2mfw4a0vppb4ngf"; + sha256 = "e2062f2c7f95cc276a834c22f1a17179467176b624cc6f936e8bc3be5535ad1b"; }; propagatedBuildInputs = [ dateutil six ]; checkInputs = [ mock nose pytest ]; - # contains python3 specific code - doCheck = !isPy27; meta = with lib; { description = "FreezeGun: Let your Python tests travel through time"; From 090664f85c0d86e6c3231df6c6f76e8a9b40db94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Fri, 22 Jan 2021 13:23:18 +0100 Subject: [PATCH 2/4] pythonPackages.pytest-freezegun: run tests --- .../python-modules/pytest-freezegun/default.nix | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/pytest-freezegun/default.nix b/pkgs/development/python-modules/pytest-freezegun/default.nix index 424d8fde232..e5fbb6bb070 100644 --- a/pkgs/development/python-modules/pytest-freezegun/default.nix +++ b/pkgs/development/python-modules/pytest-freezegun/default.nix @@ -1,18 +1,21 @@ { lib , buildPythonPackage -, fetchPypi +, isPy27 +, fetchFromGitHub , freezegun , pytest +, pytestCheckHook }: buildPythonPackage rec { pname = "pytest-freezegun"; version = "0.4.2"; - src = fetchPypi { - inherit pname version; - extension = "zip"; - sha256 = "19c82d5633751bf3ec92caa481fb5cffaac1787bd485f0df6436fd6242176949"; + src = fetchFromGitHub { + owner = "ktosiek"; + repo = "pytest-freezegun"; + rev = version; + sha256 = "10c4pbh03b4s1q8cjd75lr0fvyf9id0zmdk29566qqsmaz28npas"; }; propagatedBuildInputs = [ @@ -20,6 +23,10 @@ buildPythonPackage rec { pytest ]; + checkInputs = [ + pytestCheckHook + ]; + meta = with lib; { description = "Wrap tests with fixtures in freeze_time"; homepage = "https://github.com/ktosiek/pytest-freezegun"; From e975b7508269b2f487ffd4a2ecc0aded28ce0ec3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Tue, 19 Jan 2021 10:40:47 +0100 Subject: [PATCH 3/4] python3Packages.virtualenv: enable tests --- .../python-modules/virtualenv/default.nix | 50 ++++++++++++++++--- 1 file changed, 42 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/virtualenv/default.nix b/pkgs/development/python-modules/virtualenv/default.nix index 233101728f8..8b64bddc5a4 100644 --- a/pkgs/development/python-modules/virtualenv/default.nix +++ b/pkgs/development/python-modules/virtualenv/default.nix @@ -1,18 +1,25 @@ { buildPythonPackage -, fetchPypi -, lib -, stdenv -, pythonOlder -, isPy27 , appdirs , contextlib2 +, cython , distlib +, fetchPypi , filelock +, fish +, flaky , importlib-metadata , importlib-resources +, isPy27 +, lib , pathlib2 +, pytest-freezegun +, pytest-mock +, pytest-timeout +, pytestCheckHook +, pythonOlder , setuptools_scm , six +, stdenv }: buildPythonPackage rec { @@ -47,10 +54,37 @@ buildPythonPackage rec { ./0001-Check-base_prefix-and-base_exec_prefix-for-Python-2.patch ]; - meta = { + checkInputs = [ + cython + fish + flaky + pytest-freezegun + pytest-mock + pytest-timeout + pytestCheckHook + ]; + + preCheck = '' + export HOME=$(mktemp -d) + ''; + + # Ignore tests which require network access + disabledTestFiles = [ + "tests/unit/create/test_creator.py" + "tests/unit/seed/embed/test_bootstrap_link_via_app_data.py" + ]; + + disabledTests = [ + "test_can_build_c_extensions" + "test_xonsh" # imports xonsh, which is not in pythonPackages + ]; + + pythonImportsCheck = [ "virtualenv" ]; + + meta = with lib; { description = "A tool to create isolated Python environments"; homepage = "http://www.virtualenv.org"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ goibhniu ]; + license = licenses.mit; + maintainers = with maintainers; [ goibhniu ]; }; } From 6ab446cf9ed3c18212712e2998b57725f64cae9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 24 Jan 2021 11:47:55 +0100 Subject: [PATCH 4/4] python3Packages.freezegun: 1.0.0 -> 1.1.0 --- .../python-modules/freezegun/default.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/freezegun/default.nix b/pkgs/development/python-modules/freezegun/default.nix index f1b1d9738d7..00d03435de9 100644 --- a/pkgs/development/python-modules/freezegun/default.nix +++ b/pkgs/development/python-modules/freezegun/default.nix @@ -1,29 +1,23 @@ -{ lib, stdenv +{ lib , buildPythonPackage , pythonOlder , fetchPypi -, isPy27 , dateutil -, six -, mock -, nose -, pytest +, pytestCheckHook }: buildPythonPackage rec { pname = "freezegun"; - version = "1.0.0"; + version = "1.1.0"; disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "1cf08e441f913ff5e59b19cc065a8faa9dd1ddc442eaf0375294f344581a0643"; + sha256 = "177f9dd59861d871e27a484c3332f35a6e3f5d14626f2bf91be37891f18927f3"; }; - propagatedBuildInputs = [ dateutil six ]; - checkInputs = [ mock nose pytest ]; - # contains python3 specific code - doCheck = !isPy27; + propagatedBuildInputs = [ dateutil ]; + checkInputs = [ pytestCheckHook ]; meta = with lib; { description = "FreezeGun: Let your Python tests travel through time";