From 2919970c22b6399e074d063be6e8554df0708529 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 6 Apr 2023 16:10:06 +0200 Subject: [PATCH 1/5] pypy3Packages.nose: Mark broken The 2to3 conversion utiliy is not available for pypy, so the package is essentially using python2 syntax which breaks it. --- pkgs/development/python-modules/nose/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/nose/default.nix b/pkgs/development/python-modules/nose/default.nix index c4a52a0e114b..bb6f6decc1a5 100644 --- a/pkgs/development/python-modules/nose/default.nix +++ b/pkgs/development/python-modules/nose/default.nix @@ -26,7 +26,7 @@ buildPythonPackage rec { --replace "from setuptools.command.build_py import Mixin2to3" "from distutils.util import Mixin2to3" ''; - preBuild = lib.optionalString (isPy3k && (!isPyPy)) '' + preBuild = lib.optionalString (isPy3k) '' ${python.pythonForBuild}/bin/2to3 -wn nose functional_tests unit_tests ''; @@ -41,6 +41,7 @@ buildPythonPackage rec { ''; meta = with lib; { + broken = isPyPy; # missing 2to3 conversion utility description = "A unittest-based testing framework for python that makes writing and running tests easier"; homepage = "https://nose.readthedocs.io/"; license = licenses.lgpl3; From 7373272e86e16a0e26f50453dcbb340639bd9eb8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 6 Apr 2023 16:25:11 +0200 Subject: [PATCH 2/5] python310Packages.flaky: Drop nose tests Nose tests is not getting updated for python3 and shouldn't be used anymore. In fact it can't be used on pypy, since it does not come with a 2to3 utility. --- pkgs/development/python-modules/flaky/default.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/flaky/default.nix b/pkgs/development/python-modules/flaky/default.nix index 65efea30db6c..43b3288f94b9 100644 --- a/pkgs/development/python-modules/flaky/default.nix +++ b/pkgs/development/python-modules/flaky/default.nix @@ -2,27 +2,29 @@ , buildPythonPackage , fetchPypi , mock -, nose , pytest }: buildPythonPackage rec { pname = "flaky"; version = "3.7.0"; + format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "3ad100780721a1911f57a165809b7ea265a7863305acb66708220820caf8aa0d"; + hash = "sha256-OtEAeAchoZEfV6FlgJt+omWnhjMFrLZnCCIIIMr4qg0="; }; - nativeCheckInputs = [ mock nose pytest ]; + nativeCheckInputs = [ + mock + pytest + ]; checkPhase = '' # based on tox.ini pytest -k 'example and not options' --doctest-modules test/test_pytest/ pytest -k 'example and not options' test/test_pytest/ pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py - nosetests --with-flaky --force-flaky --max-runs 2 test/test_nose/test_nose_options_example.py pytest --force-flaky --max-runs 2 test/test_pytest/test_pytest_options_example.py ''; From 0e3b6c5634f310d50c275ca16dd866f32d330ca8 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 6 Apr 2023 16:57:44 +0200 Subject: [PATCH 3/5] pypy3Packages.virtualenv: Disable failing tests --- pkgs/development/python-modules/virtualenv/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/virtualenv/default.nix b/pkgs/development/python-modules/virtualenv/default.nix index 30e3fc43d63f..28100b8c55e7 100644 --- a/pkgs/development/python-modules/virtualenv/default.nix +++ b/pkgs/development/python-modules/virtualenv/default.nix @@ -1,8 +1,8 @@ { lib -, stdenv , buildPythonPackage , pythonOlder , isPy27 +, isPyPy , cython , distlib , fetchPypi @@ -12,7 +12,6 @@ , hatchling , importlib-metadata , importlib-resources -, pathlib2 , platformdirs , pytest-freezegun , pytest-mock @@ -76,6 +75,13 @@ buildPythonPackage rec { "test_seed_link_via_app_data" # Permission Error "test_bad_exe_py_info_no_raise" + ] ++ lib.optionals (isPyPy) [ + # encoding problems + "test_bash" + # permission error + "test_can_build_c_extensions" + # fails to detect pypy version + "test_discover_ok" ]; pythonImportsCheck = [ From 57c8befec1c67c3a7329cf48222f2a06086161b7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 6 Apr 2023 16:58:04 +0200 Subject: [PATCH 4/5] pypy3Packages.hypothesis: Fix tests by providing tzdata --- pkgs/development/python-modules/hypothesis/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix index b3f93e03f283..bfa2ca0dc87e 100644 --- a/pkgs/development/python-modules/hypothesis/default.nix +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -1,5 +1,6 @@ { lib , buildPythonPackage +, isPyPy , fetchFromGitHub , attrs , exceptiongroup @@ -13,6 +14,7 @@ , sphinx-rtd-theme , sphinx-hoverxref , sphinx-codeautolink +, tzdata # Used to break internal dependency loop. , enableDocumentation ? true }: @@ -65,6 +67,8 @@ buildPythonPackage rec { pexpect pytest-xdist pytestCheckHook + ] ++ lib.optionals (isPyPy) [ + tzdata ]; inherit doCheck; From f2fcc1fc25f39a36585e05863550e6cf64c8b034 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 7 Apr 2023 11:31:17 +0200 Subject: [PATCH 5/5] pypy3Packages.yapf: Disable tests Cannot be tested, because it is using nose for tests, which is broken for pypy. --- pkgs/development/python-modules/yapf/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/yapf/default.nix b/pkgs/development/python-modules/yapf/default.nix index 80b84b73ff97..f5cba78a2026 100644 --- a/pkgs/development/python-modules/yapf/default.nix +++ b/pkgs/development/python-modules/yapf/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, isPyPy , nose }: @@ -13,6 +14,9 @@ buildPythonPackage rec { hash = "sha256-o/UIXTfvfj4ATEup+bPkDFT/GQHNER8FFFrjE6fGfRs="; }; + # nose is unavailable on pypy + doCheck = !isPyPy; + nativeCheckInputs = [ nose ];