Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchPypi, 5 isPy3k, 6 isPyPy, 7 python, 8 python312, 9 coverage, 10 setuptools, 11}: 12 13buildPythonPackage rec { 14 version = "1.3.7"; 15 pname = "nose"; 16 pyproject = true; 17 18 src = fetchPypi { 19 inherit pname version; 20 sha256 = "f1bffef9cbc82628f6e7d7b40d7e255aefaa1adb6a1b1d26c69a8b79e6208a98"; 21 }; 22 23 build-system = [ setuptools ]; 24 25 patches = lib.optional isPy3k [ ./0001-nose-python-3.12-fixes.patch ]; 26 27 postPatch = '' 28 substituteInPlace setup.py \ 29 --replace "'use_2to3': True," "" 30 31 substituteInPlace setup3lib.py \ 32 --replace "from setuptools.command.build_py import Mixin2to3" "from distutils.util import Mixin2to3" 33 ''; 34 35 # 2to3 is removed from Python 3.13, so always use Python 3.12 2to3 for now. 36 preBuild = lib.optionalString isPy3k '' 37 ${python312.pythonOnBuildForHost}/bin/2to3 -wn nose functional_tests unit_tests 38 ''; 39 40 propagatedBuildInputs = [ coverage ]; 41 42 doCheck = false; # lot's of transient errors, too much hassle 43 checkPhase = 44 if isPy3k then 45 '' 46 ${python.pythonOnBuildForHost.interpreter} setup.py build_tests 47 '' 48 else 49 "" 50 + '' 51 rm functional_tests/test_multiprocessing/test_concurrent_shared.py* # see https://github.com/nose-devs/nose/commit/226bc671c73643887b36b8467b34ad485c2df062 52 ${python.pythonOnBuildForHost.interpreter} selftest.py 53 ''; 54 55 meta = with lib; { 56 broken = isPyPy; # missing 2to3 conversion utility 57 description = "Unittest-based testing framework for python that makes writing and running tests easier"; 58 mainProgram = "nosetests"; 59 homepage = "https://nose.readthedocs.io/"; 60 license = licenses.lgpl3; 61 maintainers = [ ]; 62 }; 63}