Merge pull request #225137 from mweinelt/pypy-fixes

Various pypy3Packages fixes
This commit is contained in:
Martin Weinelt 2023-04-12 22:58:38 +02:00 committed by GitHub
commit 514d2bfa2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 7 deletions

View file

@ -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
'';

View file

@ -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;

View file

@ -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;

View file

@ -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 = [

View file

@ -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
];