diff --git a/pkgs/applications/version-management/commitizen/default.nix b/pkgs/applications/version-management/commitizen/default.nix index 537c1bfcd607..0ae03fe4473b 100644 --- a/pkgs/applications/version-management/commitizen/default.nix +++ b/pkgs/applications/version-management/commitizen/default.nix @@ -55,7 +55,7 @@ python3.pkgs.buildPythonApplication rec { pytest-freezer pytest-mock pytest-regressions - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; doCheck = true; diff --git a/pkgs/development/python-modules/accelerate/default.nix b/pkgs/development/python-modules/accelerate/default.nix index 1c31b8292809..eecbd37a9063 100644 --- a/pkgs/development/python-modules/accelerate/default.nix +++ b/pkgs/development/python-modules/accelerate/default.nix @@ -3,8 +3,7 @@ , buildPythonPackage , fetchFromGitHub , pythonOlder -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , setuptools , numpy , packaging @@ -47,7 +46,7 @@ buildPythonPackage rec { nativeCheckInputs = [ evaluate parameterized - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook transformers ]; preCheck = '' diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix index 823a0f9e14b7..e46b5989dd76 100644 --- a/pkgs/development/python-modules/aiohttp/default.nix +++ b/pkgs/development/python-modules/aiohttp/default.nix @@ -21,8 +21,7 @@ , freezegun , gunicorn , pytest-mock -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , python-on-whales , re-assert , trustme @@ -83,7 +82,7 @@ buildPythonPackage rec { freezegun gunicorn pytest-mock - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook python-on-whales re-assert ] ++ lib.optionals (!(stdenv.isDarwin && stdenv.isAarch64)) [ diff --git a/pkgs/development/python-modules/cloudpathlib/default.nix b/pkgs/development/python-modules/cloudpathlib/default.nix index 3f14fae210d2..063ba6ce1056 100644 --- a/pkgs/development/python-modules/cloudpathlib/default.nix +++ b/pkgs/development/python-modules/cloudpathlib/default.nix @@ -11,8 +11,7 @@ , boto3 , psutil , pydantic -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pytest-cases , pytest-cov , pytest-xdist @@ -66,7 +65,7 @@ buildPythonPackage rec { google-cloud-storage psutil pydantic - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook pytest-cases pytest-cov pytest-xdist diff --git a/pkgs/development/python-modules/falcon/default.nix b/pkgs/development/python-modules/falcon/default.nix index 5dc0dd2e0b56..2cb7c3cc7895 100644 --- a/pkgs/development/python-modules/falcon/default.nix +++ b/pkgs/development/python-modules/falcon/default.nix @@ -17,8 +17,7 @@ , mujson , orjson , pytest-asyncio -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pyyaml , rapidjson , requests @@ -61,7 +60,7 @@ buildPythonPackage rec { nativeCheckInputs = [ # https://github.com/falconry/falcon/blob/master/requirements/tests - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook pyyaml requests rapidjson diff --git a/pkgs/development/python-modules/flow-record/default.nix b/pkgs/development/python-modules/flow-record/default.nix index b3a57c134a12..3e836772aa85 100644 --- a/pkgs/development/python-modules/flow-record/default.nix +++ b/pkgs/development/python-modules/flow-record/default.nix @@ -5,8 +5,7 @@ , fetchFromGitHub , lz4 , msgpack -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pythonOlder , setuptools , setuptools-scm @@ -52,7 +51,7 @@ buildPythonPackage rec { }; nativeCheckInputs = [ - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/fonttools/default.nix b/pkgs/development/python-modules/fonttools/default.nix index 6d48088a2660..be573a627e99 100644 --- a/pkgs/development/python-modules/fonttools/default.nix +++ b/pkgs/development/python-modules/fonttools/default.nix @@ -21,8 +21,7 @@ , xattr , skia-pathops , uharfbuzz -, pytestCheckHook -, pytest_7 +, pytest7CheckHook }: buildPythonPackage rec { @@ -65,7 +64,7 @@ buildPythonPackage rec { nativeCheckInputs = [ # test suite fails with pytest>=8.0.1 # https://github.com/fonttools/fonttools/issues/3458 - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ] ++ lib.concatLists (lib.attrVals ([ "woff" # "interpolatable" is not included because it only contains 2 tests at the time of writing but adds 270 extra dependencies diff --git a/pkgs/development/python-modules/homematicip/default.nix b/pkgs/development/python-modules/homematicip/default.nix index 4de61606e0c6..34016262e93b 100644 --- a/pkgs/development/python-modules/homematicip/default.nix +++ b/pkgs/development/python-modules/homematicip/default.nix @@ -5,8 +5,7 @@ , async-timeout , buildPythonPackage , fetchFromGitHub -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pythonAtLeast , pythonOlder , pytest-aiohttp @@ -50,7 +49,7 @@ buildPythonPackage rec { aiohttp-wsgi pytest-aiohttp pytest-asyncio - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; pytestFlagsArray = [ diff --git a/pkgs/development/python-modules/ipython/default.nix b/pkgs/development/python-modules/ipython/default.nix index 7dacc7e2aa3c..06829aefe412 100644 --- a/pkgs/development/python-modules/ipython/default.nix +++ b/pkgs/development/python-modules/ipython/default.nix @@ -22,8 +22,7 @@ # Test dependencies , pickleshare , pytest-asyncio -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , testpath }: @@ -72,7 +71,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pickleshare pytest-asyncio - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook testpath ]; diff --git a/pkgs/development/python-modules/lightning-utilities/default.nix b/pkgs/development/python-modules/lightning-utilities/default.nix index f1d94bad1af2..3af06818b8ee 100644 --- a/pkgs/development/python-modules/lightning-utilities/default.nix +++ b/pkgs/development/python-modules/lightning-utilities/default.nix @@ -11,8 +11,7 @@ # tests , pytest-timeout -, pytestCheckHook -, pytest_7 +, pytest7CheckHook }: buildPythonPackage rec { @@ -42,7 +41,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-timeout - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; disabledTests = [ diff --git a/pkgs/development/python-modules/openapi-core/default.nix b/pkgs/development/python-modules/openapi-core/default.nix index 59611e1af362..5e1c1d8ae960 100644 --- a/pkgs/development/python-modules/openapi-core/default.nix +++ b/pkgs/development/python-modules/openapi-core/default.nix @@ -19,8 +19,7 @@ , parse , poetry-core , pytest-aiohttp -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pythonOlder , responses , requests @@ -94,7 +93,7 @@ buildPythonPackage rec { nativeCheckInputs = [ httpx pytest-aiohttp - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook responses webob ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); diff --git a/pkgs/development/python-modules/pook/default.nix b/pkgs/development/python-modules/pook/default.nix index b40f93b04af5..6abc4b43f34e 100644 --- a/pkgs/development/python-modules/pook/default.nix +++ b/pkgs/development/python-modules/pook/default.nix @@ -7,8 +7,7 @@ , jsonschema , pytest-asyncio , pytest-httpbin -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pythonOlder , requests , xmltodict @@ -43,7 +42,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytest-httpbin - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/pydantic/1.nix b/pkgs/development/python-modules/pydantic/1.nix index 6a1f5c52116c..ffe38546148e 100644 --- a/pkgs/development/python-modules/pydantic/1.nix +++ b/pkgs/development/python-modules/pydantic/1.nix @@ -4,8 +4,7 @@ , email-validator , fetchFromGitHub , pytest-mock -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , python-dotenv , pythonAtLeast , pythonOlder @@ -52,7 +51,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-mock - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies); pytestFlagsArray = [ diff --git a/pkgs/development/python-modules/pysiaalarm/default.nix b/pkgs/development/python-modules/pysiaalarm/default.nix index c5a7cdae56a5..db5973207f7e 100644 --- a/pkgs/development/python-modules/pysiaalarm/default.nix +++ b/pkgs/development/python-modules/pysiaalarm/default.nix @@ -7,8 +7,7 @@ , setuptools-scm , pytest-asyncio , pytest-cases -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pytz }: @@ -44,7 +43,7 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio pytest-cases - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/pytest-snapshot/default.nix b/pkgs/development/python-modules/pytest-snapshot/default.nix index 60b81487a987..c04c9b74e3b3 100644 --- a/pkgs/development/python-modules/pytest-snapshot/default.nix +++ b/pkgs/development/python-modules/pytest-snapshot/default.nix @@ -4,8 +4,7 @@ , packaging , pytest , setuptools-scm -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pythonOlder }: @@ -37,7 +36,7 @@ buildPythonPackage rec { nativeCheckInputs = [ # https://github.com/joseph-roitman/pytest-snapshot/issues/71 - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/pytest-unordered/default.nix b/pkgs/development/python-modules/pytest-unordered/default.nix index b14a1e12ada5..d0446e764645 100644 --- a/pkgs/development/python-modules/pytest-unordered/default.nix +++ b/pkgs/development/python-modules/pytest-unordered/default.nix @@ -2,8 +2,7 @@ , buildPythonPackage , fetchFromGitHub , pytest -, pytest_7 -, pytestCheckHook +, pytest7CheckHook }: buildPythonPackage rec { @@ -24,7 +23,7 @@ buildPythonPackage rec { nativeCheckInputs = [ # https://github.com/utapyngo/pytest-unordered/issues/15 - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook ]; pythonImportsCheck = [ diff --git a/pkgs/development/python-modules/rdflib/default.nix b/pkgs/development/python-modules/rdflib/default.nix index cef9ea902bb6..d0f62efa6a78 100644 --- a/pkgs/development/python-modules/rdflib/default.nix +++ b/pkgs/development/python-modules/rdflib/default.nix @@ -23,8 +23,7 @@ # tests , pip , pytest-cov -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , setuptools }: @@ -69,7 +68,7 @@ buildPythonPackage rec { pip pytest-cov # Failed: DID NOT WARN. No warnings of type (,) were emitted. - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook setuptools ] ++ passthru.optional-dependencies.networkx diff --git a/pkgs/development/python-modules/scipy/default.nix b/pkgs/development/python-modules/scipy/default.nix index 2870e5ec3bbd..2819229eaec2 100644 --- a/pkgs/development/python-modules/scipy/default.nix +++ b/pkgs/development/python-modules/scipy/default.nix @@ -15,8 +15,7 @@ , wheel , setuptools , hypothesis -, pytestCheckHook -, pytest_7 +, pytest7CheckHook , pytest-xdist , numpy , pybind11 @@ -117,7 +116,7 @@ in buildPythonPackage { nativeCheckInputs = [ hypothesis # Failed: DID NOT WARN. No warnings of type (, , ) were emitted. - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook pytest-xdist ]; diff --git a/pkgs/tools/misc/thefuck/default.nix b/pkgs/tools/misc/thefuck/default.nix index 150913c31d13..48d4f395b047 100644 --- a/pkgs/tools/misc/thefuck/default.nix +++ b/pkgs/tools/misc/thefuck/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub, buildPythonApplication , colorama, decorator, psutil, pyte, six -, go, mock, pytestCheckHook, pytest-mock, pytest_7 +, go, mock, pytest7CheckHook, pytest-mock }: buildPythonApplication rec { @@ -16,7 +16,7 @@ buildPythonApplication rec { propagatedBuildInputs = [ colorama decorator psutil pyte six ]; - nativeCheckInputs = [ go mock (pytestCheckHook.override { pytest = pytest_7; }) pytest-mock ]; + nativeCheckInputs = [ go mock pytest7CheckHook pytest-mock ]; disabledTests = lib.optionals stdenv.isDarwin [ "test_settings_defaults" diff --git a/pkgs/tools/virtualization/cloud-init/default.nix b/pkgs/tools/virtualization/cloud-init/default.nix index e5385bf7fbca..3b8e619e864d 100644 --- a/pkgs/tools/virtualization/cloud-init/default.nix +++ b/pkgs/tools/virtualization/cloud-init/default.nix @@ -71,7 +71,7 @@ python3.pkgs.buildPythonApplication rec { ]; nativeCheckInputs = with python3.pkgs; [ - (pytestCheckHook.override { pytest = pytest_7; }) + pytest7CheckHook httpretty dmidecode # needed for tests; at runtime we rather want the setuid wrapper diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dc44a98191ce..4bca4de4f593 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11775,6 +11775,8 @@ self: super: with self; { pytest_7 = callPackage ../development/python-modules/pytest/7.nix { }; + pytest7CheckHook = pytestCheckHook.override { pytest = pytest_7; }; + pytest-aio = callPackage ../development/python-modules/pytest-aio { }; pytest-aiohttp = callPackage ../development/python-modules/pytest-aiohttp { };