treewide: migrate to pythonPackages.unittestCheckHook

+278 -417
+3 -4
pkgs/applications/audio/whipper/default.nix
··· 37 37 nativeBuildInputs = with python3.pkgs; [ 38 38 setuptools-scm 39 39 docutils 40 + setuptoolsCheckHook 40 41 ]; 41 42 42 43 propagatedBuildInputs = with python3.pkgs; [ ··· 64 65 export SETUPTOOLS_SCM_PRETEND_VERSION="${version}" 65 66 ''; 66 67 67 - checkPhase = '' 68 - runHook preCheck 68 + preCheck = '' 69 69 # disable tests that require internet access 70 70 # https://github.com/JoeLametta/whipper/issues/291 71 71 substituteInPlace whipper/test/test_common_accurip.py \ 72 72 --replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse" 73 - HOME=$TMPDIR ${python3.interpreter} -m unittest discover 74 - runHook postCheck 73 + export HOME=$TMPDIR 75 74 ''; 76 75 77 76 passthru.tests.version = testers.testVersion {
+2 -4
pkgs/applications/misc/haxor-news/default.nix
··· 52 52 # will fail without pre-seeded config files 53 53 doCheck = false; 54 54 55 - checkInputs = [ mock ]; 55 + checkInputs = [ unittestCheckHook mock ]; 56 56 57 - checkPhase = '' 58 - ${python.interpreter} -m unittest discover -s tests -v 59 - ''; 57 + unittestFlagsArray = [ "-s" "tests" "-v" ]; 60 58 61 59 meta = with lib; { 62 60 homepage = "https://github.com/donnemartin/haxor-news";
+1 -3
pkgs/applications/misc/pyditz/default.nix
··· 15 15 nativeBuildInputs = [ setuptools-scm ]; 16 16 propagatedBuildInputs = [ pyyaml six jinja2 cerberus_1_1 ]; 17 17 18 - checkPhase = '' 19 - ${python.interpreter} -m unittest discover 20 - ''; 18 + checkInputs = [ unittestCheckHook ]; 21 19 22 20 meta = with lib; { 23 21 homepage = "https://pythonhosted.org/pyditz/";
+4 -5
pkgs/applications/misc/topydo/default.nix
··· 1 - { lib, python3Packages, fetchFromGitHub, glibcLocales }: 1 + { lib, python3Packages, fetchFromGitHub, glibcLocales, unittestCheckHook }: 2 2 3 3 with python3Packages; 4 4 ··· 22 22 watchdog 23 23 ]; 24 24 25 - checkInputs = [ mock freezegun pylint ]; 25 + checkInputs = [ unittestCheckHook mock freezegun pylint ]; 26 26 27 27 # Skip test that has been reported multiple times upstream without result: 28 28 # bram85/topydo#271, bram85/topydo#274. 29 - checkPhase = '' 29 + preCheck = '' 30 30 substituteInPlace test/test_revert_command.py --replace 'test_revert_ls' 'dont_test_revert_ls' 31 - python -m unittest discover 32 31 ''; 33 32 34 - LC_ALL="en_US.UTF-8"; 33 + LC_ALL = "en_US.UTF-8"; 35 34 36 35 meta = with lib; { 37 36 description = "A cli todo application compatible with the todo.txt format";
+5 -5
pkgs/development/python-modules/aioitertools/default.nix
··· 12 12 , typing-extensions 13 13 14 14 # tests 15 - , python 15 + , unittestCheckHook 16 16 }: 17 17 18 18 buildPythonPackage rec { ··· 35 35 typing-extensions 36 36 ]; 37 37 38 + checkInputs = [ 39 + unittestCheckHook 40 + ]; 41 + 38 42 pythonImportsCheck = [ 39 43 "aioitertools" 40 44 ]; 41 - 42 - checkPhase = '' 43 - ${python.interpreter} -m unittest discover 44 - ''; 45 45 46 46 meta = with lib; { 47 47 description = "Implementation of itertools, builtins, and more for AsyncIO and mixed-type iterables";
+6 -4
pkgs/development/python-modules/arxiv2bib/default.nix
··· 1 - { buildPythonPackage, python, lib, fetchFromGitHub 1 + { buildPythonPackage 2 + , lib 3 + , fetchFromGitHub 2 4 , mock 5 + , unittestCheckHook 3 6 }: 4 7 5 8 buildPythonPackage rec { ··· 14 17 sha256 = "1kp2iyx20lpc9dv4qg5fgwf83a1wx6f7hj1ldqyncg0kn9xcrhbg"; 15 18 }; 16 19 17 - checkInputs = [ mock ]; 18 - 19 - checkPhase = "${python.interpreter} -m unittest discover -s tests"; 20 + checkInputs = [ unittestCheckHook mock ]; 21 + unittestFlagsArray = [ "-s" "tests" ]; 20 22 21 23 meta = with lib; { 22 24 description = "Get a BibTeX entry from an arXiv id number, using the arxiv.org API";
+2 -4
pkgs/development/python-modules/awesome-slugify/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, unidecode, regex, python }: 1 + { lib, buildPythonPackage, fetchPypi, unidecode, regex, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "awesome-slugify"; ··· 20 20 21 21 propagatedBuildInputs = [ unidecode regex ]; 22 22 23 - checkPhase = '' 24 - ${python.interpreter} -m unittest discover 25 - ''; 23 + checkInputs = [ unittestCheckHook ]; 26 24 27 25 meta = with lib; { 28 26 homepage = "https://github.com/dimka665/awesome-slugify";
+2 -4
pkgs/development/python-modules/backports_abc/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 13 13 sha256 = "033be54514a03e255df75c5aee8f9e672f663f93abb723444caec8fe43437bde"; 14 14 }; 15 15 16 - checkPhase = '' 17 - ${python.interpreter} -m unittest discover 18 - ''; 16 + checkInputs = [ unittestCheckHook ]; 19 17 20 18 meta = { 21 19 homepage = "https://github.com/cython/backports_abc";
+5 -5
pkgs/development/python-modules/backports_tempfile/default.nix
··· 1 1 { lib 2 - , python 2 + , unittestCheckHook 3 3 , buildPythonPackage 4 4 , fetchPypi 5 5 , setuptools-scm ··· 19 19 20 20 propagatedBuildInputs = [ backports_weakref ]; 21 21 22 - checkPhase = '' 23 - ${python.interpreter} -m unittest discover -s tests 24 - ''; 25 - 26 22 # requires https://pypi.org/project/backports.test.support 27 23 doCheck = false; 24 + 25 + checkInputs = [ unittestCheckHook ]; 26 + 27 + unittestFlagsArray = [ "-s" "tests" ]; 28 28 29 29 meta = { 30 30 description = "Backport of new features in Python's tempfile module";
+4 -4
pkgs/development/python-modules/backports_weakref/default.nix
··· 3 3 , fetchPypi 4 4 , setuptools-scm 5 5 # , backports 6 - , python 6 + , unittestCheckHook 7 7 }: 8 8 9 9 buildPythonPackage rec { ··· 20 20 # Requires backports package 21 21 doCheck = false; 22 22 23 - checkPhase = '' 24 - ${python.interpreter} -m unittest discover tests 25 - ''; 23 + checkInputs = [ unittestCheckHook ]; 24 + 25 + unittestFlagsArray = [ "tests" ]; 26 26 27 27 meta = with lib; { 28 28 description = "Backports of new features in Python’s weakref module";
+4 -5
pkgs/development/python-modules/bitstring/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 15 15 sha256 = "0y2kcq58psvl038r6dhahhlhp1wjgr5zsms45wyz1naq6ri8x9qa"; 16 16 }; 17 17 18 - checkPhase = '' 19 - cd test 20 - ${python.interpreter} -m unittest discover 21 - ''; 18 + checkInputs = [ unittestCheckHook ]; 19 + 20 + unittestFlagsArray = [ "-s" "test" ]; 22 21 23 22 pythonImportsCheck = [ "bitstring" ]; 24 23
+11 -7
pkgs/development/python-modules/clevercsv/default.nix
··· 9 9 , regex 10 10 , tabview 11 11 , python 12 + , unittestCheckHook 12 13 }: 13 14 14 15 buildPythonPackage rec { ··· 33 34 tabview 34 35 ]; 35 36 37 + checkInputs = [ unittestCheckHook ]; 38 + 36 39 pythonImportsCheck = [ 37 40 "clevercsv" 38 41 "clevercsv.cparser" 39 42 ]; 40 43 41 - checkPhase = '' 44 + preCheck = '' 42 45 # by linking the installed version the tests also have access to compiled native libraries 43 46 rm -r clevercsv 44 47 ln -s $out/${python.sitePackages}/clevercsv/ clevercsv 45 - # their ci only runs unit tests, there are also integration and fuzzing tests 46 - ${python.interpreter} -m unittest discover -v -f -s ./tests/test_unit 47 48 ''; 49 + 50 + # their ci only runs unit tests, there are also integration and fuzzing tests 51 + unittestFlagsArray = [ "-v" "-f" "-s" "./tests/test_unit" ]; 48 52 49 53 meta = with lib; { 50 54 description = "CleverCSV is a Python package for handling messy CSV files"; 51 55 longDescription = '' 52 - CleverCSV is a Python package for handling messy CSV files. It provides 53 - a drop-in replacement for the builtin CSV module with improved dialect 54 - detection, and comes with a handy command line application for working 55 - with CSV files. 56 + CleverCSV is a Python package for handling messy CSV files. It provides 57 + a drop-in replacement for the builtin CSV module with improved dialect 58 + detection, and comes with a handy command line application for working 59 + with CSV files. 56 60 ''; 57 61 homepage = "https://github.com/alan-turing-institute/CleverCSV"; 58 62 changelog = "https://github.com/alan-turing-institute/CleverCSV/blob/master/CHANGELOG.md";
+2 -5
pkgs/development/python-modules/contextlib2/default.nix
··· 3 3 , fetchPypi 4 4 , python 5 5 , pythonOlder 6 + , unittestCheckHook 6 7 }: 7 8 8 9 buildPythonPackage rec { ··· 17 18 hash = "sha256-qx4r/h0B2Wjht+jZAjvFHvNQm7ohe7cwzuOCfh7oKGk="; 18 19 }; 19 20 20 - checkPhase = '' 21 - runHook preCheck 22 - ${python.interpreter} -m unittest discover 23 - runHook postCheck 24 - ''; 21 + checkInputs = [ unittestCheckHook ]; 25 22 26 23 pythonImportsCheck = [ 27 24 "contextlib2"
+6 -4
pkgs/development/python-modules/cvxopt/default.nix
··· 3 3 , fetchPypi 4 4 , isPyPy 5 5 , python 6 - , blas, lapack # build segfaults with 64-bit blas 6 + , blas 7 + , lapack # build segfaults with 64-bit blas 7 8 , suitesparse 9 + , unittestCheckHook 8 10 , glpk ? null 9 11 , gsl ? null 10 12 , fftw ? null ··· 49 51 export CVXOPT_FFTW_INC_DIR=${fftw.dev}/include 50 52 ''; 51 53 52 - checkPhase = '' 53 - ${python.interpreter} -m unittest discover -s tests 54 - ''; 54 + checkInputs = [ unittestCheckHook ]; 55 + 56 + unittestFlagsArray = [ "-s" "tests" ]; 55 57 56 58 meta = with lib; { 57 59 homepage = "http://cvxopt.org/";
+5 -7
pkgs/development/python-modules/cyclonedx-python-lib/default.nix
··· 14 14 , toml 15 15 , types-setuptools 16 16 , types-toml 17 + , unittestCheckHook 17 18 , xmldiff 18 19 }: 19 20 ··· 47 48 ]; 48 49 49 50 checkInputs = [ 51 + unittestCheckHook 50 52 jsonschema 51 53 lxml 52 54 xmldiff ··· 56 58 "cyclonedx" 57 59 ]; 58 60 59 - checkPhase = '' 60 - runHook preCheck 61 - # Tests require network access 62 - rm tests/test_output_json.py 63 - ${python.interpreter} -m unittest discover -s tests -v 64 - runHook postCheck 65 - ''; 61 + preCheck = '' 62 + rm tests/test_output_json.py 63 + ''; 66 64 67 65 meta = with lib; { 68 66 description = "Python library for generating CycloneDX SBOMs";
+4 -5
pkgs/development/python-modules/cymem/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 4 , cython 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 25 25 --replace "wheel>=0.32.0,<0.33.0" "wheel>=0.31.0" 26 26 ''; 27 27 28 - checkPhase = '' 29 - cd cymem/tests 30 - ${python.interpreter} -m unittest discover -p "*test*" 31 - ''; 28 + checkInputs = [ unittestCheckHook ]; 29 + 30 + unittestFlagsArray = [ "-s" "cymem/tests" "-p" "*test*" ]; 32 31 33 32 meta = with lib; { 34 33 description = "Cython memory pool for RAII-style memory management";
+2 -5
pkgs/development/python-modules/deprecation/default.nix
··· 5 5 , pythonAtLeast 6 6 , pythonOlder 7 7 , unittest2 8 + , unittestCheckHook 8 9 }: 9 10 10 11 buildPythonPackage rec { ··· 29 30 30 31 # avoiding mass rebuilds for python3.9, but no longer 31 32 # needed with patch 32 - checkInputs = lib.optional (pythonOlder "3.10") [ 33 + checkInputs = [ unittestCheckHook ] ++ lib.optional (pythonOlder "3.10") [ 33 34 unittest2 34 35 ]; 35 - 36 - checkPhase = '' 37 - ${python.interpreter} -m unittest discover 38 - ''; 39 36 40 37 meta = with lib; { 41 38 description = "A library to handle automated deprecations";
+3 -5
pkgs/development/python-modules/emailthreads/default.nix
··· 1 1 { lib, fetchFromGitHub, buildPythonPackage 2 - , python, isPy3k }: 2 + , python, isPy3k, unittestCheckHook }: 3 3 4 4 buildPythonPackage rec { 5 5 pname = "emailthreads"; ··· 14 14 sha256 = "sha256-7BhYS1DQCW9QpG31asPCq5qPyJy+WW2onZpvEHhwQCs="; 15 15 }; 16 16 17 - PKGVER = version; 17 + checkInputs = [ unittestCheckHook ]; 18 18 19 - checkPhase = '' 20 - ${python.interpreter} -m unittest discover test 21 - ''; 19 + PKGVER = version; 22 20 23 21 meta = with lib; { 24 22 homepage = "https://github.com/emersion/python-emailthreads";
+2 -4
pkgs/development/python-modules/enum34/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchPypi 4 4 , pythonAtLeast 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 if pythonAtLeast "3.4" then null else buildPythonPackage rec { ··· 14 14 sha256 = "cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248"; 15 15 }; 16 16 17 - checkPhase = '' 18 - ${python.interpreter} -m unittest discover 19 - ''; 17 + checkInputs = [ unittestCheckHook ]; 20 18 21 19 meta = with lib; { 22 20 homepage = "https://pypi.python.org/pypi/enum34";
+2 -4
pkgs/development/python-modules/fastimport/default.nix
··· 2 2 , pythonOlder 3 3 , buildPythonPackage 4 4 , fetchPypi 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 16 16 sha256 = "6ac99dda4e7b0b3ae831507b6d0094802e6dd95891feafde8cc5c405b6c149ca"; 17 17 }; 18 18 19 - checkPhase = '' 20 - ${python.interpreter} -m unittest discover 21 - ''; 19 + checkInputs = [ unittestCheckHook ]; 22 20 23 21 pythonImportsCheck = [ "fastimport" ]; 24 22
+3 -10
pkgs/development/python-modules/fido2/default.nix
··· 5 5 , cryptography 6 6 , mock 7 7 , pyfakefs 8 + , unittestCheckHook 8 9 }: 9 10 10 11 buildPythonPackage rec { ··· 18 19 19 20 propagatedBuildInputs = [ six cryptography ]; 20 21 21 - checkInputs = [ mock pyfakefs ]; 22 - 23 - # Testing with `python setup.py test` doesn't work: 24 - # https://github.com/Yubico/python-fido2/issues/108#issuecomment-763513576 25 - checkPhase = '' 26 - runHook preCheck 27 - 28 - python -m unittest discover -v 22 + checkInputs = [ unittestCheckHook mock pyfakefs ]; 29 23 30 - runHook postCheck 31 - ''; 24 + unittestFlagsArray = [ "-v" ]; 32 25 33 26 pythonImportsCheck = [ "fido2" ]; 34 27
+2 -4
pkgs/development/python-modules/flask-babel/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 - , python 3 + , unittestCheckHook 4 4 , fetchPypi 5 5 , flask 6 6 , babel ··· 26 26 speaklater 27 27 ]; 28 28 29 - checkPhase = '' 30 - ${python.interpreter} -m unittest discover -s tests 31 - ''; 29 + unittestFlagsArray = [ "-s" "tests" ]; 32 30 33 31 meta = with lib; { 34 32 description = "Adds i18n/l10n support to Flask applications";
+2 -6
pkgs/development/python-modules/flask-bcrypt/default.nix
··· 3 3 , fetchFromGitHub 4 4 , flask 5 5 , bcrypt 6 - , python 6 + , unittestCheckHook 7 7 }: 8 8 9 9 buildPythonPackage rec { ··· 22 22 bcrypt 23 23 ]; 24 24 25 - checkPhase = '' 26 - runHook preCheck 27 - ${python.interpreter} -m unittest discover 28 - runHook postCheck 29 - ''; 25 + checkInputs = [ unittestCheckHook ]; 30 26 31 27 pythonImportsCheck = [ 32 28 "flask_bcrypt"
+2 -7
pkgs/development/python-modules/flask-migrate/default.nix
··· 6 6 , flask 7 7 , flask_script 8 8 , flask-sqlalchemy 9 - , python 9 + , unittestCheckHook 10 10 }: 11 11 12 12 buildPythonPackage rec { ··· 33 33 ]; 34 34 35 35 checkInputs = [ 36 + unittestCheckHook 36 37 flask_script 37 38 ]; 38 - 39 - checkPhase = '' 40 - runHook preCheck 41 - ${python.interpreter} -m unittest discover 42 - runHook postCheck 43 - ''; 44 39 45 40 meta = with lib; { 46 41 description = "SQLAlchemy database migrations for Flask applications using Alembic";
+2 -7
pkgs/development/python-modules/flask-seasurf/default.nix
··· 1 - { lib, fetchFromGitHub, buildPythonPackage, isPy3k, flask, mock, python }: 1 + { lib, fetchFromGitHub, buildPythonPackage, isPy3k, flask, mock, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "Flask-SeaSurf"; ··· 15 15 propagatedBuildInputs = [ flask ]; 16 16 17 17 checkInputs = [ 18 + unittestCheckHook 18 19 mock 19 20 ]; 20 - 21 - checkPhase = '' 22 - runHook preCheck 23 - ${python.interpreter} -m unittest discover 24 - runHook postCheck 25 - ''; 26 21 27 22 pythonImportsCheck = [ "flask_seasurf" ]; 28 23
+2 -3
pkgs/development/python-modules/gb-io/default.nix
··· 4 4 , buildPythonPackage 5 5 , rustPlatform 6 6 , setuptools-rust 7 + , unittestCheckHook 7 8 }: 8 9 9 10 buildPythonPackage rec { ··· 31 32 rust.rustc 32 33 ]); 33 34 34 - checkPhase = '' 35 - python -m unittest discover 36 - ''; 35 + checkInputs = [ unittestCheckHook ]; 37 36 38 37 pythonImportsCheck = [ "gb_io" ]; 39 38
+6 -8
pkgs/development/python-modules/greenlet/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchPypi 4 4 , isPyPy 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 9 9 buildPythonPackage rec { 10 10 pname = "greenlet"; 11 11 version = "1.1.2"; 12 - disabled = isPyPy; # builtin for pypy 12 + disabled = isPyPy; # builtin for pypy 13 13 14 14 src = fetchPypi { 15 15 inherit pname version; 16 16 sha256 = "e30f5ea4ae2346e62cedde8794a56858a67b878dd79f7df76a0767e356b1744a"; 17 17 }; 18 18 19 - checkPhase = '' 20 - runHook preCheck 21 - ${python.interpreter} -m unittest discover -v greenlet.tests 22 - runHook postCheck 23 - ''; 19 + checkInputs = [ unittestCheckHook ]; 20 + 21 + unittestFlagsArray = [ "-v" "greenlet.tests" ]; 24 22 25 23 meta = with lib; { 26 24 homepage = "https://github.com/python-greenlet/greenlet"; 27 25 description = "Module for lightweight in-process concurrent programming"; 28 26 license = with licenses; [ 29 - psfl # src/greenlet/slp_platformselect.h & files in src/greenlet/platform/ directory 27 + psfl # src/greenlet/slp_platformselect.h & files in src/greenlet/platform/ directory 30 28 mit 31 29 ]; 32 30 };
+2 -5
pkgs/development/python-modules/gruut-ipa/default.nix
··· 4 4 , espeak 5 5 , numpy 6 6 , python 7 + , unittestCheckHook 7 8 }: 8 9 9 10 buildPythonPackage rec { ··· 29 30 numpy 30 31 ]; 31 32 32 - checkPhase = '' 33 - runHook preCheck 34 - ${python.interpreter} -m unittest discover 35 - runHook postCheck 36 - ''; 33 + checkInputs = [ unittestCheckHook ]; 37 34 38 35 pythonImportsCheck = [ 39 36 "gruut_ipa"
+4 -4
pkgs/development/python-modules/importlib-resources/default.nix
··· 6 6 , importlib-metadata 7 7 , typing ? null 8 8 , pythonOlder 9 - , python 9 + , unittestCheckHook 10 10 }: 11 11 12 12 buildPythonPackage rec { ··· 31 31 typing 32 32 ]; 33 33 34 - checkPhase = '' 35 - ${python.interpreter} -m unittest discover 36 - ''; 34 + checkInputs = [ 35 + unittestCheckHook 36 + ]; 37 37 38 38 pythonImportsCheck = [ 39 39 "importlib_resources"
+4 -4
pkgs/development/python-modules/isodate/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 , six 6 6 }: 7 7 ··· 16 16 17 17 propagatedBuildInputs = [ six ]; 18 18 19 - checkPhase = '' 20 - ${python.interpreter} -m unittest discover -s src/isodate/tests 21 - ''; 19 + checkInputs = [ unittestCheckHook ]; 20 + 21 + unittestFlagsArray = [ "-s" "src/isodate/tests" ]; 22 22 23 23 meta = with lib; { 24 24 description = "ISO 8601 date/time parser";
+4 -6
pkgs/development/python-modules/jxmlease/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchPypi 4 4 , lxml 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 22 22 # https://github.com/Juniper/jxmlease/issues/26 23 23 doCheck = false; 24 24 25 - checkPhase = '' 26 - runHook preCheck 27 - ${python.interpreter} -m unittest discover -v 28 - runHook postCheck 29 - ''; 25 + checkInputs = [ unittestCheckHook ]; 26 + 27 + unittestFlagsArray = [ "-v" ]; 30 28 31 29 meta = with lib; { 32 30 description = "Converts between XML and intelligent Python data structures";
+2 -6
pkgs/development/python-modules/karton-asciimagic/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 4 , karton-core 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 20 20 karton-core 21 21 ]; 22 22 23 - checkPhase = '' 24 - runHook preCheck 25 - ${python.interpreter} -m unittest discover 26 - runHook postCheck 27 - ''; 23 + checkInputs = [ unittestCheckHook ]; 28 24 29 25 pythonImportsCheck = [ "karton.asciimagic" ]; 30 26
+2 -6
pkgs/development/python-modules/karton-core/default.nix
··· 2 2 , boto3 3 3 , buildPythonPackage 4 4 , fetchFromGitHub 5 - , python 5 + , unittestCheckHook 6 6 , redis 7 7 }: 8 8 ··· 22 22 redis 23 23 ]; 24 24 25 - checkPhase = '' 26 - runHook preCheck 27 - ${python.interpreter} -m unittest discover 28 - runHook postCheck 29 - ''; 25 + checkInputs = [ unittestCheckHook ]; 30 26 31 27 pythonImportsCheck = [ 32 28 "karton.core"
+2 -6
pkgs/development/python-modules/karton-yaramatcher/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 4 , karton-core 5 - , python 5 + , unittestCheckHook 6 6 , yara-python 7 7 }: 8 8 ··· 22 22 yara-python 23 23 ]; 24 24 25 - checkPhase = '' 26 - runHook preCheck 27 - ${python.interpreter} -m unittest discover 28 - runHook postCheck 29 - ''; 25 + checkInputs = [ unittestCheckHook ]; 30 26 31 27 pythonImportsCheck = [ "karton.yaramatcher" ]; 32 28
+2 -7
pkgs/development/python-modules/kbcstorage/default.nix
··· 12 12 13 13 # tests 14 14 , responses 15 - , python 15 + , unittestCheckHook 16 16 }: 17 17 18 18 buildPythonPackage rec { ··· 44 44 doCheck = false; 45 45 46 46 checkInputs = [ 47 + unittestCheckHook 47 48 responses 48 49 ]; 49 - 50 - checkPhase = '' 51 - runHook preCheck 52 - ${python.interpreter} -m unittest discover 53 - runHook postCheck 54 - ''; 55 50 56 51 pythonImportsCheck = [ 57 52 "kbcstorage"
+2 -6
pkgs/development/python-modules/markdown/default.nix
··· 4 4 , fetchPypi 5 5 , importlib-metadata 6 6 , pyyaml 7 - , python 7 + , unittestCheckHook 8 8 }: 9 9 10 10 buildPythonPackage rec { ··· 25 25 importlib-metadata 26 26 ]; 27 27 28 - checkInputs = [ pyyaml ]; 29 - 30 - checkPhase = '' 31 - ${python.interpreter} -m unittest discover 32 - ''; 28 + checkInputs = [ unittestCheckHook pyyaml ]; 33 29 34 30 pythonImportsCheck = [ "markdown" ]; 35 31
+6 -5
pkgs/development/python-modules/mat2/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , buildPythonPackage 4 - , python 4 + , unittestCheckHook 5 5 , pythonOlder 6 6 , fetchFromGitLab 7 7 , substituteAll ··· 17 17 , mutagen 18 18 , pygobject3 19 19 , pycairo 20 - , dolphinIntegration ? false, plasma5Packages 20 + , dolphinIntegration ? false 21 + , plasma5Packages 21 22 }: 22 23 23 24 buildPythonPackage rec { ··· 92 93 install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus" 93 94 ''; 94 95 95 - checkPhase = '' 96 - ${python.interpreter} -m unittest discover -v 97 - ''; 96 + checkInputs = [ unittestCheckHook ]; 97 + 98 + unittestFlagsArray = [ "-v" ]; 98 99 99 100 meta = with lib; { 100 101 description = "A handy tool to trash your metadata";
+3 -7
pkgs/development/python-modules/maxcube-api/default.nix
··· 2 2 , buildPythonPackage 3 3 , pythonOlder 4 4 , fetchFromGitHub 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 22 22 substituteInPlace setup.py --replace "license=license" "license='MIT'" 23 23 ''; 24 24 25 + checkInputs = [ unittestCheckHook ]; 26 + 25 27 pythonImportsCheck = [ 26 28 "maxcube" 27 29 "maxcube.cube" 28 30 ]; 29 - 30 - checkPhase = '' 31 - runHook preCheck 32 - ${python.interpreter} -m unittest discover 33 - runHook postCheck 34 - ''; 35 31 36 32 meta = with lib; { 37 33 description = "eQ-3/ELV MAX! Cube Python API";
+2 -6
pkgs/development/python-modules/mdutils/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 15 15 sha256 = "sha256-regIrMWbGmW574dfojxZFJoivpaqOpN1I6YsqLEp8BM="; 16 16 }; 17 17 18 - checkPhase = '' 19 - runHook preCheck 20 - ${python.interpreter} -m unittest discover 21 - runHook postCheck 22 - ''; 18 + checkInputs = [ unittestCheckHook ]; 23 19 24 20 meta = with lib; { 25 21 description = "Set of basic tools that can help to create Markdown files";
+3 -11
pkgs/development/python-modules/mkdocs/default.nix
··· 18 18 # testing deps 19 19 , babel 20 20 , mock 21 - , pytestCheckHook 21 + , unittestCheckHook 22 22 }: 23 23 24 24 buildPythonPackage rec { ··· 47 47 ]; 48 48 49 49 checkInputs = [ 50 + unittestCheckHook 50 51 babel 51 52 mock 52 53 ]; 53 54 54 - 55 - checkPhase = '' 56 - set -euo pipefail 57 - 58 - runHook preCheck 59 - 60 - python -m unittest discover -v -p '*tests.py' mkdocs --top-level-directory . 61 - 62 - runHook postCheck 63 - ''; 55 + unittestFlagsArray = [ "-v" "-p" "'*tests.py'" "mkdocs" ]; 64 56 65 57 pythonImportsCheck = [ "mkdocs" ]; 66 58
+2 -4
pkgs/development/python-modules/mock/default.nix
··· 5 5 , python 6 6 , pythonOlder 7 7 , pytest 8 + , unittestCheckHook 8 9 }: 9 10 10 11 buildPythonPackage rec { ··· 26 27 }) 27 28 ]; 28 29 29 - checkPhase = '' 30 - ${python.interpreter} -m unittest discover 31 - ''; 32 - 33 30 checkInputs = [ 31 + unittestCheckHook 34 32 pytest 35 33 ]; 36 34
+2 -6
pkgs/development/python-modules/mwdblib/default.nix
··· 6 6 , fetchFromGitHub 7 7 , humanize 8 8 , keyring 9 - , python 9 + , unittestCheckHook 10 10 , python-dateutil 11 11 , pythonOlder 12 12 , requests ··· 36 36 requests 37 37 ]; 38 38 39 - checkPhase = '' 40 - runHook preCheck 41 - ${python.interpreter} -m unittest discover 42 - runHook postCheck 43 - ''; 39 + checkInputs = [ unittestCheckHook ]; 44 40 45 41 pythonImportsCheck = [ 46 42 "mwdblib"
+4 -4
pkgs/development/python-modules/mypy/extensions.nix
··· 2 2 , fetchFromGitHub 3 3 , buildPythonPackage 4 4 , typing 5 - , python 5 + , unittestCheckHook 6 6 , pythonOlder 7 7 }: 8 8 ··· 19 19 20 20 propagatedBuildInputs = lib.optional (pythonOlder "3.5") typing; 21 21 22 - checkPhase = '' 23 - ${python.interpreter} -m unittest discover tests 24 - ''; 22 + checkInputs = [ unittestCheckHook ]; 23 + 24 + unittestFlagsArray = [ "tests" ]; 25 25 26 26 pythonImportsCheck = [ "mypy_extensions" ]; 27 27
+2 -4
pkgs/development/python-modules/nix-prefetch-github/default.nix
··· 4 4 , git 5 5 , which 6 6 , pythonOlder 7 + , unittestCheckHook 7 8 }: 8 9 9 10 buildPythonPackage rec { ··· 19 20 sha256 = "GHUH3Oog800qrdgXs5AEa4O6ovZ1LT0k3P4YwEHfwlY="; 20 21 }; 21 22 22 - checkInputs = [ git which ]; 23 + checkInputs = [ unittestCheckHook git which ]; 23 24 24 - checkPhase = '' 25 - python -m unittest discover 26 - ''; 27 25 # ignore tests which are impure 28 26 DISABLED_TESTS = "network requires_nix_build"; 29 27
+2 -4
pkgs/development/python-modules/pathlib/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 , pythonAtLeast 6 6 }: 7 7 ··· 15 15 sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39"; 16 16 }; 17 17 18 - checkPhase = '' 19 - ${python.interpreter} -m unittest discover 20 - ''; 18 + checkInputs = [ unittestCheckHook ]; 21 19 22 20 meta = { 23 21 description = "Object-oriented filesystem paths";
+4 -6
pkgs/development/python-modules/pgsanity/default.nix
··· 2 2 , python 3 3 , fetchPypi 4 4 , buildPythonPackage 5 - , postgresql }: 5 + , postgresql 6 + , unittestCheckHook 7 + }: 6 8 7 9 buildPythonPackage rec { 8 10 pname = "pgsanity"; ··· 13 15 sha256 = "de0bbd6fe4f98bf5139cb5f466eac2e2abaf5a7b050b9e4867b87bf360873173"; 14 16 }; 15 17 16 - checkPhase = '' 17 - ${python.interpreter} -m unittest discover -s test 18 - ''; 19 - 20 - checkInputs = [ postgresql ]; 18 + checkInputs = [ unittestCheckHook postgresql ]; 21 19 propagatedBuildInputs = [ postgresql ]; 22 20 23 21 meta = with lib; {
+4 -5
pkgs/development/python-modules/plac/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 , pythonOlder 6 6 }: 7 7 ··· 17 17 hash = "sha256-OL3YZNBFD7dIGTqoF7nEWKj1MZ+/l7ImEVHPwKWBIJA="; 18 18 }; 19 19 20 - checkPhase = '' 21 - cd doc 22 - ${python.interpreter} -m unittest discover -p "*test_plac*" 23 - ''; 20 + checkInputs = [ unittestCheckHook ]; 21 + 22 + unittestFlagsArray = [ "-s" "doc" "-p" "*test_plac*" ]; 24 23 25 24 pythonImportsCheck = [ 26 25 "plac"
+3 -4
pkgs/development/python-modules/pulsectl/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, python }: 1 + { lib, buildPythonPackage, fetchPypi, libpulseaudio, glibc, substituteAll, stdenv, pulseaudio, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "pulsectl"; ··· 22 22 "pulsectl" 23 23 ]; 24 24 25 - checkInputs = [ pulseaudio ]; 25 + checkInputs = [ unittestCheckHook pulseaudio ]; 26 26 27 - checkPhase = '' 27 + preCheck = '' 28 28 export HOME=$TMPDIR 29 - ${python.interpreter} -m unittest discover 30 29 ''; 31 30 32 31 meta = with lib; {
+4 -4
pkgs/development/python-modules/pycparser/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, python }: 1 + { lib, buildPythonPackage, fetchPypi, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "pycparser"; ··· 9 9 sha256 = "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"; 10 10 }; 11 11 12 - checkPhase = '' 13 - ${python.interpreter} -m unittest discover -s tests 14 - ''; 12 + checkInputs = [ unittestCheckHook ]; 13 + 14 + unittestFlagsArray = [ "-s" "tests" ]; 15 15 16 16 meta = with lib; { 17 17 description = "C parser in Python";
+3 -5
pkgs/development/python-modules/pypdf2/default.nix
··· 4 4 , pythonOlder 5 5 , glibcLocales 6 6 , typing-extensions 7 - , python 7 + , unittestCheckHook 8 8 , isPy3k 9 9 }: 10 10 ··· 24 24 typing-extensions 25 25 ]; 26 26 27 - checkPhase = '' 28 - ${python.interpreter} -m unittest discover 29 - ''; 30 - 31 27 # Tests broken on Python 3.x 32 28 #doCheck = !(isPy3k); 29 + 30 + checkInputs = [ unittestCheckHook ]; 33 31 34 32 meta = with lib; { 35 33 description = "A Pure-Python library built as a PDF toolkit";
+4 -6
pkgs/development/python-modules/pyrad/default.nix
··· 5 5 , poetry-core 6 6 , netaddr 7 7 , six 8 - , python 8 + , unittestCheckHook 9 9 }: 10 10 11 11 buildPythonPackage rec { ··· 43 43 --replace "def testBindv6(self):" "def dontTestBindv6(self):" 44 44 ''; 45 45 46 - checkPhase = '' 47 - runHook preCheck 48 - ${python.interpreter} -m unittest discover 49 - runHook postCheck 50 - ''; 46 + checkInputs = [ 47 + unittestCheckHook 48 + ]; 51 49 52 50 pythonImportsCheck = [ 53 51 "pyrad"
+4 -5
pkgs/development/python-modules/pysensors/default.nix
··· 1 - { lib, buildPythonPackage, python, fetchFromGitHub, lm_sensors }: 1 + { lib, buildPythonPackage, unittestCheckHook, fetchFromGitHub, lm_sensors }: 2 2 buildPythonPackage { 3 3 version = "2017-07-13"; 4 4 pname = "pysensors"; ··· 17 17 # due to sandboxing 18 18 doCheck = false; 19 19 20 - checkPhase = '' 21 - cd tests 22 - ${python.interpreter} -m unittest discover 23 - ''; 20 + checkInputs = [ unittestCheckHook ]; 21 + 22 + unittestFlagsArray = [ "-s" "tests" ]; 24 23 25 24 meta = with lib; { 26 25 maintainers = with maintainers; [ guibou ];
+4 -6
pkgs/development/python-modules/pyserial/default.nix
··· 2 2 , stdenv 3 3 , buildPythonPackage 4 4 , fetchPypi 5 - , python 5 + , unittestCheckHook 6 6 , pythonOlder 7 7 , isPy3k 8 8 }: ··· 27 27 28 28 doCheck = !stdenv.hostPlatform.isDarwin; # broken on darwin 29 29 30 - checkPhase = '' 31 - runHook preCheck 32 - ${python.interpreter} -m unittest discover -s test 33 - runHook postCheck 34 - ''; 30 + checkInputs = [ unittestCheckHook ]; 31 + 32 + unittestFlagsArray = [ "-s" "test" ]; 35 33 36 34 pythonImportsCheck = [ 37 35 "serial"
+3 -5
pkgs/development/python-modules/pystache/default.nix
··· 1 - { lib, buildPythonPackage, python, fetchPypi, isPy3k, glibcLocales }: 1 + { lib, buildPythonPackage, unittestCheckHook, fetchPypi, isPy3k, glibcLocales }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "pystache"; ··· 13 13 14 14 buildInputs = [ glibcLocales ]; 15 15 16 - checkPhase = '' 17 - ${python.interpreter} -m unittest discover 18 - ''; 19 - 20 16 # SyntaxError Python 3 21 17 # https://github.com/defunkt/pystache/issues/181 22 18 doCheck = !isPy3k; 19 + 20 + checkInputs = [ unittestCheckHook ]; 23 21 24 22 meta = with lib; { 25 23 description = "A framework-agnostic, logic-free templating system inspired by ctemplate and et";
+2 -4
pkgs/development/python-modules/python-keycloak/default.nix
··· 4 4 , requests 5 5 , python-jose 6 6 , httmock 7 + , unittestCheckHook 7 8 }: 8 9 9 10 buildPythonPackage rec { ··· 23 24 ]; 24 25 25 26 checkInputs = [ 27 + unittestCheckHook 26 28 httmock 27 29 ]; 28 - 29 - checkPhase = '' 30 - python -m unittest discover 31 - ''; 32 30 33 31 pythonImportsCheck = [ "keycloak" ]; 34 32
+2 -6
pkgs/development/python-modules/python-snappy/default.nix
··· 4 4 , isPyPy 5 5 , snappy 6 6 , cffi 7 - , python 7 + , unittestCheckHook 8 8 }: 9 9 10 10 buildPythonPackage rec { ··· 21 21 22 22 propagatedBuildInputs = lib.optional isPyPy cffi; 23 23 24 - checkPhase = '' 25 - runHook preCheck 26 - ${python.interpreter} -m unittest discover 27 - runHook postCheck 28 - ''; 24 + checkInputs = [ unittestCheckHook ]; 29 25 30 26 meta = with lib; { 31 27 description = "Python library for the snappy compression library from Google";
+2 -4
pkgs/development/python-modules/pytidylib/default.nix
··· 1 - { lib, stdenv, buildPythonPackage, fetchPypi, python, html-tidy }: 1 + { lib, stdenv, buildPythonPackage, fetchPypi, unittestCheckHook, html-tidy }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "pytidylib"; ··· 21 21 $' @unittest.skip("")\n def test_large_document(self):' 22 22 ''; 23 23 24 - checkPhase = '' 25 - ${python.interpreter} -m unittest discover 26 - ''; 24 + checkInputs = [ unittestCheckHook ]; 27 25 28 26 meta = with lib; { 29 27 description = "Python wrapper for HTML Tidy (tidylib) on Python 2 and 3";
+4 -4
pkgs/development/python-modules/pytz/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, python }: 1 + { lib, buildPythonPackage, fetchPypi, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "pytz"; ··· 9 9 sha256 = "sha256-HnYOL+aoFjvAs9mhnE+ENCr6Cir/6/qoSwG5eKAuyqc="; 10 10 }; 11 11 12 - checkPhase = '' 13 - ${python.interpreter} -m unittest discover -s pytz/tests 14 - ''; 12 + checkInputs = [ unittestCheckHook ]; 13 + 14 + unittestFlagsArray = [ "-s" "pytz/tests" ]; 15 15 16 16 pythonImportsCheck = [ "pytz" ]; 17 17
+4 -4
pkgs/development/python-modules/readlike/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 15 15 sha256 = "1mw8j8ads8hqdbz42siwpffi4wi5s33z9g14a5c2i7vxp8m68qc1"; 16 16 }; 17 17 18 - checkPhase = '' 19 - ${python.interpreter} -m unittest discover -s tests 20 - ''; 18 + checkInputs = [ unittestCheckHook ]; 19 + 20 + unittestFlagsArray = [ "-s" "tests" ]; 21 21 22 22 meta = with lib; { 23 23 description = "GNU Readline-like line editing module";
+2 -6
pkgs/development/python-modules/sjcl/default.nix
··· 3 3 , fetchFromGitHub 4 4 , pythonOlder 5 5 , pycryptodome 6 - , python 6 + , unittestCheckHook 7 7 }: 8 8 9 9 buildPythonPackage rec { ··· 23 23 24 24 propagatedBuildInputs = [ pycryptodome ]; 25 25 26 - checkPhase = '' 27 - runHook preCheck 28 - ${python.interpreter} -m unittest discover 29 - runHook postCheck 30 - ''; 26 + checkInputs = [ unittestCheckHook ]; 31 27 32 28 pythonImportsCheck = [ 33 29 "sjcl"
+3 -5
pkgs/development/python-modules/sphinx-testing/default.nix
··· 4 4 , mock 5 5 , sphinx 6 6 , six 7 - , python 7 + , unittestCheckHook 8 8 }: 9 9 10 10 buildPythonPackage rec { ··· 16 16 sha256 = "ef661775b5722d7b00f67fc229104317d35637a4fb4434bf2c005afdf1da4d09"; 17 17 }; 18 18 19 - checkInputs = [ mock ]; 19 + checkInputs = [ unittestCheckHook mock ]; 20 20 propagatedBuildInputs = [ sphinx six ]; 21 21 22 - checkPhase = '' 23 - ${python.interpreter} -m unittest discover -s tests 24 - ''; 22 + unittestFlagsArray = [ "-s" "tests" ]; 25 23 26 24 # Test failures https://github.com/sphinx-doc/sphinx-testing/issues/5 27 25 doCheck = false;
+5 -4
pkgs/development/python-modules/sphinxcontrib-blockdiag/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 , mock 6 6 , sphinx-testing 7 7 , sphinx ··· 22 22 23 23 # Seems to look for files in the wrong dir 24 24 doCheck = false; 25 - checkPhase = '' 26 - ${python.interpreter} -m unittest discover -s tests 27 - ''; 25 + 26 + checkInputs = [ unittestCheckHook ]; 27 + 28 + unittestFlagsArray = [ "-s" "tests" ]; 28 29 29 30 meta = with lib; { 30 31 description = "Sphinx blockdiag extension";
+2 -4
pkgs/development/python-modules/tabview/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 17 17 sha256 = "1d1l8fhdn3w2zg7wakvlmjmgjh9lh9h5fal1clgyiqmhfix4cn4m"; 18 18 }; 19 19 20 - checkPhase = '' 21 - ${python.interpreter} -m unittest discover 22 - ''; 20 + checkInputs = [ unittestCheckHook ]; 23 21 24 22 meta = with lib; { 25 23 description = "Python curses command line CSV and tabular data viewer";
+4 -8
pkgs/development/python-modules/tomli/default.nix
··· 3 3 , callPackage 4 4 , fetchFromGitHub 5 5 , flit-core 6 - , python 6 + , unittestCheckHook 7 7 8 - # important downstream dependencies 8 + # important downstream dependencies 9 9 , flit 10 10 , black 11 11 , mypy ··· 26 26 27 27 nativeBuildInputs = [ flit-core ]; 28 28 29 - pythonImportsCheck = [ "tomli" ]; 29 + checkInputs = [ unittestCheckHook ]; 30 30 31 - checkPhase = '' 32 - runHook preCheck 33 - ${python.interpreter} -m unittest discover 34 - runHook postCheck 35 - ''; 31 + pythonImportsCheck = [ "tomli" ]; 36 32 37 33 passthru.tests = { 38 34 # test downstream dependencies
+9 -8
pkgs/development/python-modules/tornado/4.nix
··· 1 1 { lib 2 - , python 2 + , unittestCheckHook 3 3 , buildPythonPackage 4 4 , fetchPypi 5 5 , isPy27 6 + , pythonAtLeast 6 7 }: 7 8 8 9 buildPythonPackage rec { 9 10 pname = "tornado"; 10 11 version = "4.5.3"; 11 - disabled = isPy27 || python.pythonAtLeast "3.10"; 12 - 13 - # We specify the name of the test files to prevent 14 - # https://github.com/NixOS/nixpkgs/issues/14634 15 - checkPhase = '' 16 - ${python.interpreter} -m unittest discover *_test.py 17 - ''; 12 + disabled = isPy27 || pythonAtLeast "3.10"; 18 13 19 14 src = fetchPypi { 20 15 inherit pname version; 21 16 sha256 = "02jzd23l4r6fswmwxaica9ldlyc2p6q8dk6dyff7j58fmdzf853d"; 22 17 }; 18 + 19 + checkInputs = [ unittestCheckHook ]; 20 + 21 + # We specify the name of the test files to prevent 22 + # https://github.com/NixOS/nixpkgs/issues/14634 23 + unittestFlagsArray = [ "*_test.py" ]; 23 24 24 25 __darwinAllowLocalNetworking = true; 25 26
+7 -7
pkgs/development/python-modules/tornado/5.nix
··· 1 1 { lib 2 - , python 2 + , unittestCheckHook 3 3 , buildPythonPackage 4 4 , fetchPypi 5 5 , isPy27 ··· 11 11 version = "5.1.1"; 12 12 disabled = isPy27 || pythonAtLeast "3.10"; 13 13 14 - # We specify the name of the test files to prevent 15 - # https://github.com/NixOS/nixpkgs/issues/14634 16 - checkPhase = '' 17 - ${python.interpreter} -m unittest discover *_test.py 18 - ''; 19 - 20 14 src = fetchPypi { 21 15 inherit pname version; 22 16 sha256 = "4e5158d97583502a7e2739951553cbd88a72076f152b4b11b64b9a10c4c49409"; 23 17 }; 18 + 19 + checkInputs = [ unittestCheckHook ]; 20 + 21 + # We specify the name of the test files to prevent 22 + # https://github.com/NixOS/nixpkgs/issues/14634 23 + unittestFlagsArray = [ "*_test.py" ]; 24 24 25 25 __darwinAllowLocalNetworking = true; 26 26
+10 -10
pkgs/development/python-modules/trytond/default.nix
··· 18 18 , weasyprint 19 19 , gevent 20 20 , pillow 21 - , withPostgresql ? true, psycopg2 22 - , python 21 + , withPostgresql ? true 22 + , psycopg2 23 + , unittestCheckHook 23 24 }: 24 25 25 26 buildPythonPackage rec { ··· 54 55 gevent 55 56 pillow 56 57 ] ++ relatorio.optional-dependencies.fodt 57 - ++ passlib.optional-dependencies.bcrypt 58 - ++ passlib.optional-dependencies.argon2 59 - ++ lib.optional withPostgresql psycopg2; 58 + ++ passlib.optional-dependencies.bcrypt 59 + ++ passlib.optional-dependencies.argon2 60 + ++ lib.optional withPostgresql psycopg2; 60 61 61 - checkPhase = '' 62 - runHook preCheck 62 + checkInputs = [ unittestCheckHook ]; 63 63 64 + preCheck = '' 64 65 export HOME=$(mktemp -d) 65 66 export TRYTOND_DATABASE_URI="sqlite://" 66 67 export DB_NAME=":memory:"; 67 - ${python.interpreter} -m unittest discover -s trytond.tests 68 + ''; 68 69 69 - runHook postCheck 70 - ''; 70 + unittestFlagsArray = [ "-s" "trytond.tests" ]; 71 71 72 72 meta = with lib; { 73 73 description = "The server of the Tryton application platform";
+2 -4
pkgs/development/python-modules/txrequests/default.nix
··· 4 4 , twisted 5 5 , requests 6 6 , cryptography 7 - , python 7 + , unittestCheckHook 8 8 }: 9 9 10 10 buildPythonPackage rec { ··· 21 21 # Require network access 22 22 doCheck = false; 23 23 24 - checkPhase = '' 25 - ${python.interpreter} -m unittest discover 26 - ''; 24 + checkInputs = [ unittestCheckHook ]; 27 25 28 26 meta = with lib; { 29 27 description = "Asynchronous Python HTTP for Humans.";
+2 -4
pkgs/development/python-modules/u-msgpack-python/default.nix
··· 2 2 , lib 3 3 , fetchPypi 4 4 , glibcLocales 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 18 18 19 19 buildInputs = [ glibcLocales ]; 20 20 21 - checkPhase = '' 22 - ${python.interpreter} -m unittest discover 23 - ''; 21 + checkInputs = [ unittestCheckHook ]; 24 22 25 23 meta = { 26 24 description = "A portable, lightweight MessagePack serializer and deserializer written in pure Python";
+4 -4
pkgs/development/python-modules/unidiff/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, python }: 1 + { lib, buildPythonPackage, fetchPypi, unittestCheckHook }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "unidiff"; ··· 9 9 sha256 = "2bbcbc986e1fb97f04b1d7b864aa6002ab02f4d8a996bf03aa6e5a81447d1fc5"; 10 10 }; 11 11 12 - checkPhase = '' 13 - ${python.interpreter} -m unittest discover -s tests/ 14 - ''; 12 + checkInputs = [ unittestCheckHook ]; 13 + 14 + unittestFlagsArray = [ "-s" "tests" ]; 15 15 16 16 pythonImportsCheck = [ "unidiff" ]; 17 17
+2 -2
pkgs/development/python-modules/unify/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 4 , untokenize 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 19 19 20 20 propagatedBuildInputs = [ untokenize ]; 21 21 22 - checkPhase = "${python.interpreter} -m unittest discover"; 22 + checkInputs = [ unittestCheckHook ]; 23 23 24 24 meta = with lib; { 25 25 description = "Modifies strings to all use the same quote where possible";
+4 -4
pkgs/development/python-modules/untangle/default.nix
··· 1 - { lib, buildPythonPackage, fetchFromGitHub, python, defusedxml }: 1 + { lib, buildPythonPackage, fetchFromGitHub, unittestCheckHook, defusedxml }: 2 2 3 3 buildPythonPackage rec { 4 4 pname = "untangle"; ··· 16 16 defusedxml 17 17 ]; 18 18 19 - checkPhase = '' 20 - ${python.interpreter} -m unittest discover -s tests 21 - ''; 19 + checkInputs = [ unittestCheckHook ]; 20 + 21 + unittestFlagsArray = [ "-s" "tests" ]; 22 22 23 23 meta = with lib; { 24 24 description = "Convert XML documents into Python objects";
+2 -2
pkgs/development/python-modules/untokenize/default.nix
··· 1 1 { lib 2 2 , buildPythonPackage 3 3 , fetchPypi 4 - , python 4 + , unittestCheckHook 5 5 }: 6 6 7 7 buildPythonPackage rec { ··· 13 13 sha256 = "3865dbbbb8efb4bb5eaa72f1be7f3e0be00ea8b7f125c69cbd1f5fda926f37a2"; 14 14 }; 15 15 16 - checkPhase = "${python.interpreter} -m unittest discover"; 16 + checkInputs = [ unittestCheckHook ]; 17 17 18 18 meta = with lib; { 19 19 description = "Transforms tokens into original source code while preserving whitespace";
+6 -4
pkgs/development/python-modules/vapoursynth/default.nix
··· 1 - { vapoursynth, cython, buildPythonPackage, python }: 1 + { vapoursynth, cython, buildPythonPackage, unittestCheckHook }: 2 2 3 3 buildPythonPackage { 4 4 pname = "vapoursynth"; ··· 13 13 vapoursynth 14 14 ]; 15 15 16 - checkPhase = '' 17 - ${python.interpreter} -m unittest discover -s $src/test -p "*test.py" 18 - ''; 16 + checkInputs = [ 17 + unittestCheckHook 18 + ]; 19 + 20 + unittestFlagsArray = [ "-s" "$src/test" "-p" "'*test.py'" ]; 19 21 20 22 inherit (vapoursynth) meta; 21 23 }
+4 -4
pkgs/development/python-modules/webcolors/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchPypi 4 4 , pythonOlder 5 - , python 5 + , unittestCheckHook 6 6 }: 7 7 8 8 buildPythonPackage rec { ··· 17 17 hash = "sha256-FtBD06CP1qGxt+Pp5iZA0JeQ3OgNK91HkqF1s1/nlKk="; 18 18 }; 19 19 20 - checkPhase = '' 21 - ${python.interpreter} -m unittest discover -s tests 22 - ''; 20 + checkInputs = [ unittestCheckHook ]; 21 + 22 + unittestFlagsArray = [ "-s" "tests" ]; 23 23 24 24 pythonImportsCheck = [ 25 25 "webcolors"
+2 -6
pkgs/development/python-modules/websockets/default.nix
··· 2 2 , stdenv 3 3 , buildPythonPackage 4 4 , fetchFromGitHub 5 - , python 5 + , unittestCheckHook 6 6 , pythonOlder 7 7 }: 8 8 ··· 44 44 done 45 45 ''; 46 46 47 - checkPhase = '' 48 - runHook preCheck 49 - ${python.interpreter} -m unittest discover 50 - runHook postCheck 51 - ''; 47 + checkInputs = [ unittestCheckHook ]; 52 48 53 49 pythonImportsCheck = [ 54 50 "websockets"
+5 -4
pkgs/development/python-modules/zake/default.nix
··· 4 4 , kazoo 5 5 , six 6 6 , testtools 7 - , python 7 + , unittestCheckHook 8 8 }: 9 9 10 10 buildPythonPackage rec { ··· 18 18 19 19 propagatedBuildInputs = [ kazoo six ]; 20 20 buildInputs = [ testtools ]; 21 - checkPhase = '' 21 + checkInputs = [ unittestCheckHook ]; 22 + preCheck = '' 22 23 # Skip test - fails with our new kazoo version 23 24 substituteInPlace zake/tests/test_client.py \ 24 25 --replace "test_child_watch_no_create" "_test_child_watch_no_create" 26 + ''; 25 27 26 - ${python.interpreter} -m unittest discover zake/tests 27 - ''; 28 + unittestFlagsArray = [ "zake/tests" ]; 28 29 29 30 meta = with lib; { 30 31 homepage = "https://github.com/yahoo/Zake";
+3 -4
pkgs/development/python-modules/zope_copy/default.nix
··· 5 5 , zope_interface 6 6 , zope_location 7 7 , zope_schema 8 + , unittestCheckHook 8 9 }: 9 10 10 11 ··· 20 21 propagatedBuildInputs = [ zope_interface ]; 21 22 22 23 doCheck = !isPy27; # namespace conflicts 23 - checkInputs = [ zope_location zope_schema ]; 24 + checkInputs = [ unittestCheckHook zope_location zope_schema ]; 24 25 25 - checkPhase = '' 26 - python -m unittest discover -s src/zope/copy 27 - ''; 26 + unittestFlagsArray = [ "-s" "src/zope/copy" ]; 28 27 29 28 meta = { 30 29 maintainers = with lib.maintainers; [ domenkozar ];
+2 -5
pkgs/development/python2-modules/mock/default.nix
··· 5 5 , funcsigs 6 6 , six 7 7 , pbr 8 - , python 8 + , unittestCheckHook 9 9 , pytest 10 10 }: 11 11 ··· 27 27 #doCheck = !(python.isPyPy && python.isPy27); 28 28 doCheck = false; # Infinite recursion pytest 29 29 30 - checkPhase = '' 31 - ${python.interpreter} -m unittest discover 32 - ''; 33 - 34 30 checkInputs = [ 31 + unittestCheckHook 35 32 pytest 36 33 ]; 37 34
+4 -5
pkgs/development/python2-modules/typing/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, isPyPy, python 1 + { lib, buildPythonPackage, fetchPypi, pythonOlder, isPy3k, isPyPy, unittestCheckHook 2 2 , pythonAtLeast }: 3 3 4 4 let ··· 20 20 # Also, don't bother on PyPy: AssertionError: TypeError not raised 21 21 doCheck = pythonOlder "3.6" && !isPyPy; 22 22 23 - checkPhase = '' 24 - cd ${testDir} 25 - ${python.interpreter} -m unittest discover 26 - ''; 23 + checkInputs = [ unittestCheckHook ]; 24 + 25 + unittestFlagsArray = [ "-s" testDir ]; 27 26 28 27 meta = with lib; { 29 28 description = "Backport of typing module to Python versions older than 3.5";
+2 -4
pkgs/servers/monitoring/prometheus/xmpp-alerts.nix
··· 2 2 , fetchFromGitHub 3 3 , python3Packages 4 4 , prometheus-alertmanager 5 + , unittestCheckHook 5 6 }: 6 7 7 8 python3Packages.buildPythonApplication rec { ··· 25 26 ]); 26 27 27 28 checkInputs = with python3Packages; [ 29 + unittestCheckHook 28 30 pytz 29 31 ]; 30 - 31 - checkPhase = '' 32 - ${python3Packages.python.interpreter} -m unittest discover 33 - ''; 34 32 35 33 meta = { 36 34 description = "XMPP Web hook for Prometheus";
+1 -2
pkgs/tools/networking/wifite2/default.nix
··· 42 42 pixiewps 43 43 ]; 44 44 45 - checkInputs = propagatedBuildInputs; 46 - checkPhase = "python -m unittest discover tests -v"; 45 + checkInputs = propagatedBuildInputs ++ [ python3.pkgs.unittestCheckHook ]; 47 46 48 47 meta = with lib; { 49 48 homepage = "https://github.com/kimocoder/wifite2";