diff --git a/pkgs/applications/misc/ulauncher/default.nix b/pkgs/applications/misc/ulauncher/default.nix index 527db967b974..68f904f1db20 100644 --- a/pkgs/applications/misc/ulauncher/default.nix +++ b/pkgs/applications/misc/ulauncher/default.nix @@ -50,8 +50,6 @@ python3Packages.buildPythonApplication rec { propagatedBuildInputs = with python3Packages; [ mock - mypy - mypy-extensions dbus-python pygobject3 pyinotify diff --git a/pkgs/development/python-modules/aiokef/default.nix b/pkgs/development/python-modules/aiokef/default.nix index b2858b5b835c..0fb7f161436f 100644 --- a/pkgs/development/python-modules/aiokef/default.nix +++ b/pkgs/development/python-modules/aiokef/default.nix @@ -2,9 +2,7 @@ , async-timeout , buildPythonPackage , fetchFromGitHub -, pytest-cov , pytestCheckHook -, pytest-mypy , pythonOlder , tenacity }: @@ -21,14 +19,18 @@ buildPythonPackage rec { sha256 = "0ms0dwrpj80w55svcppbnp7vyl5ipnjfp1c436k5c7pph4q5pxk9"; }; + postPatch = '' + substituteInPlace tox.ini \ + --replace "--cov --cov-append --cov-fail-under=30 --cov-report=" "" \ + --replace "--mypy" "" + ''; + propagatedBuildInputs = [ async-timeout tenacity ]; nativeCheckInputs = [ - pytest-cov - pytest-mypy pytestCheckHook ]; diff --git a/pkgs/development/python-modules/dataclasses-json/default.nix b/pkgs/development/python-modules/dataclasses-json/default.nix index fea33d9d9ba0..661e77703bc0 100644 --- a/pkgs/development/python-modules/dataclasses-json/default.nix +++ b/pkgs/development/python-modules/dataclasses-json/default.nix @@ -4,7 +4,6 @@ , typing-inspect , marshmallow-enum , hypothesis -, mypy , pytestCheckHook }: @@ -26,14 +25,14 @@ buildPythonPackage rec { nativeCheckInputs = [ hypothesis - mypy pytestCheckHook ]; - disabledTests = [ + disabledTestPaths = [ + # fails with the following error and avoid dependency on mypy # mypy_main(None, text_io, text_io, [__file__], clean_exit=True) # TypeError: main() takes at most 4 arguments (5 given) - "test_type_hints" + "tests/test_annotations.py" ]; pythonImportsCheck = [ "dataclasses_json" ]; diff --git a/pkgs/development/python-modules/duckdb/default.nix b/pkgs/development/python-modules/duckdb/default.nix index 2b4615694ef5..1c2560faac45 100644 --- a/pkgs/development/python-modules/duckdb/default.nix +++ b/pkgs/development/python-modules/duckdb/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , duckdb , google-cloud-storage -, mypy , numpy , pandas , psutil @@ -15,9 +14,8 @@ buildPythonPackage rec { inherit (duckdb) pname version src patches; format = "setuptools"; - # we can't use sourceRoot otherwise patches don't apply, because the patches - # apply to the C++ library postPatch = '' + # we can't use sourceRoot otherwise patches don't apply, because the patches apply to the C++ library cd tools/pythonpkg # 1. let nix control build cores @@ -25,6 +23,9 @@ buildPythonPackage rec { substituteInPlace setup.py \ --replace "multiprocessing.cpu_count()" "$NIX_BUILD_CORES" \ --replace "setuptools_scm<7.0.0" "setuptools_scm" + + # avoid dependency on mypy + rm tests/stubs/test_stubs.py ''; SETUPTOOLS_SCM_PRETEND_VERSION = version; @@ -41,7 +42,6 @@ buildPythonPackage rec { nativeCheckInputs = [ google-cloud-storage - mypy psutil pytestCheckHook ]; diff --git a/pkgs/development/python-modules/fingerprints/default.nix b/pkgs/development/python-modules/fingerprints/default.nix index 05affeb93cb5..ecda4d7959b8 100644 --- a/pkgs/development/python-modules/fingerprints/default.nix +++ b/pkgs/development/python-modules/fingerprints/default.nix @@ -1,18 +1,18 @@ { lib -, fetchPypi +, fetchFromGitHub , buildPythonPackage , normality -, mypy -, coverage -, nose +, pytestCheckHook }: buildPythonPackage rec { pname = "fingerprints"; version = "1.1.0"; - src = fetchPypi { - inherit pname version; - hash = "sha256-GZmurg3rpD081QZW/LUKWblhsQQSS6lg9O7y/kGy4To="; + src = fetchFromGitHub { + owner = "alephdata"; + repo = "fingerprints"; + rev = version; + hash = "sha256-rptBM08dvivfglPvl3PZd9V/7u2SHbJ/BxfVHNGMt3A="; }; propagatedBuildInputs = [ @@ -20,15 +20,9 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - mypy - coverage - nose + pytestCheckHook ]; - checkPhase = '' - nosetests - ''; - pythonImportsCheck = [ "fingerprints" ]; diff --git a/pkgs/development/python-modules/globus-sdk/default.nix b/pkgs/development/python-modules/globus-sdk/default.nix index 7480bd51eaf5..1cec30026f23 100644 --- a/pkgs/development/python-modules/globus-sdk/default.nix +++ b/pkgs/development/python-modules/globus-sdk/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , cryptography , fetchFromGitHub -, mypy , pyjwt , pytestCheckHook , pythonOlder @@ -34,7 +33,6 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - mypy pytestCheckHook responses ]; diff --git a/pkgs/development/python-modules/immutables/default.nix b/pkgs/development/python-modules/immutables/default.nix index a490d7ac8ce5..02f89f237b74 100644 --- a/pkgs/development/python-modules/immutables/default.nix +++ b/pkgs/development/python-modules/immutables/default.nix @@ -3,7 +3,6 @@ , fetchFromGitHub , pytestCheckHook , pythonOlder -, mypy , typing-extensions }: @@ -21,12 +20,15 @@ buildPythonPackage rec { hash = "sha256-yW+pmAryBp6bvjolN91ACDkk5zxvKfu4nRLQSy71kqs="; }; + postPatch = '' + rm tests/conftest.py + ''; + propagatedBuildInputs = lib.optionals (pythonOlder "3.8") [ typing-extensions ]; nativeCheckInputs = [ - mypy pytestCheckHook ]; @@ -35,6 +37,11 @@ buildPythonPackage rec { "testMypyImmu" ]; + disabledTestPaths = [ + # avoid dependency on mypy + "tests/test_mypy.py" + ]; + pythonImportsCheck = [ "immutables" ]; diff --git a/pkgs/development/python-modules/loguru/default.nix b/pkgs/development/python-modules/loguru/default.nix index 28e6a9d172d8..75cc1f9b2c61 100644 --- a/pkgs/development/python-modules/loguru/default.nix +++ b/pkgs/development/python-modules/loguru/default.nix @@ -2,10 +2,8 @@ , stdenv , buildPythonPackage , colorama -, fetchpatch , fetchFromGitHub , freezegun -, mypy , pytestCheckHook , pythonOlder }: @@ -28,14 +26,19 @@ buildPythonPackage rec { pytestCheckHook colorama freezegun - mypy ]; - disabledTestPaths = lib.optionals stdenv.isDarwin [ + disabledTestPaths = [ + "tests/test_type_hinting.py" # avoid dependency on mypy + ] ++ lib.optionals stdenv.isDarwin [ "tests/test_multiprocessing.py" ]; - disabledTests = lib.optionals stdenv.isDarwin [ + disabledTests = [ + # fails on some machine configurations + # AssertionError: assert '' != '' + "test_file_buffering" + ] ++ lib.optionals stdenv.isDarwin [ "test_rotation_and_retention" "test_rotation_and_retention_timed_file" "test_renaming" diff --git a/pkgs/development/python-modules/magicgui/default.nix b/pkgs/development/python-modules/magicgui/default.nix index 2cd9fd90fe4a..ef327dd0f08b 100644 --- a/pkgs/development/python-modules/magicgui/default.nix +++ b/pkgs/development/python-modules/magicgui/default.nix @@ -3,7 +3,6 @@ , fetchFromGitHub , setuptools-scm , pytestCheckHook -, pytest-mypy-plugins , typing-extensions , qtpy , pyside2 @@ -27,7 +26,7 @@ nativeBuildInputs = [ setuptools-scm ]; propagatedBuildInputs = [ typing-extensions qtpy pyside2 psygnal docstring-parser ]; - nativeCheckInputs = [ pytestCheckHook pytest-mypy-plugins ]; + nativeCheckInputs = [ pytestCheckHook ]; doCheck = false; # Reports "Fatal Python error" diff --git a/pkgs/development/python-modules/mypy/default.nix b/pkgs/development/python-modules/mypy/default.nix index 012c952a9800..47a7ad7916dd 100644 --- a/pkgs/development/python-modules/mypy/default.nix +++ b/pkgs/development/python-modules/mypy/default.nix @@ -2,7 +2,6 @@ , stdenv , buildPythonPackage , fetchFromGitHub -, fetchpatch , pythonOlder # build-system @@ -32,7 +31,7 @@ buildPythonPackage rec { pname = "mypy"; - version = "1.0.1"; + version = "1.3.0"; format = "pyproject"; disabled = pythonOlder "3.7"; @@ -41,24 +40,9 @@ buildPythonPackage rec { owner = "python"; repo = "mypy"; rev = "refs/tags/v${version}"; - hash = "sha256-vxPEUDC6fkYYiOl5nHf0qwMgPDC+9Vw56eTUQ174raQ="; + hash = "sha256-dfKuIyzgZo5hAZHighpXH78dHJ1PMbyCakyxF34CnMQ="; }; - patches = [ - # Fix compatibility with setupptools>=67.4.0 - (fetchpatch { - # https://github.com/python/mypy/pull/14781 - url = "https://github.com/python/mypy/commit/ab7b69a0532a5fe976c9c2a1b713d82d630692a4.patch"; - hash = "sha256-dtzmoOZP3tOtxrBVhgqpdv+rnrTjTKHxQhBieuJXRtA="; - }) - (fetchpatch { - # https://github.com/python/mypy/pull/14787 - url = "https://github.com/python/mypy/commit/243f584d43e6eb316920f3155067ce7c1b65d473.patch"; - hash = "sha256-uuh3S5ZyuJeTXyMvav2uSEao2qq23xMjK8rJjkY8RCY="; - includes = [ "mypyc/build.py" ]; - }) - ]; - nativeBuildInputs = [ mypy-extensions setuptools diff --git a/pkgs/development/python-modules/mypy/extensions.nix b/pkgs/development/python-modules/mypy/extensions.nix index c1f75bb76bb3..40b23f9ae9a7 100644 --- a/pkgs/development/python-modules/mypy/extensions.nix +++ b/pkgs/development/python-modules/mypy/extensions.nix @@ -9,13 +9,13 @@ buildPythonPackage rec { pname = "mypy-extensions"; - version = "0.4.3"; + version = "1.0.0"; src = fetchFromGitHub { owner = "python"; repo = "mypy_extensions"; rev = version; - hash = "sha256-JjhbxX5DBAbcs1o2fSWywz9tot792q491POXiId+NyI="; + hash = "sha256-gOfHC6dUeBE7SsWItpUHHIxW3wzhPM5SuGW1U8P7DD0="; }; propagatedBuildInputs = lib.optional (pythonOlder "3.5") typing; diff --git a/pkgs/development/python-modules/nptyping/default.nix b/pkgs/development/python-modules/nptyping/default.nix index c449c8b0ec17..ac823c2e45ad 100644 --- a/pkgs/development/python-modules/nptyping/default.nix +++ b/pkgs/development/python-modules/nptyping/default.nix @@ -5,7 +5,6 @@ , pytestCheckHook , beartype , invoke -, mypy , numpy , pandas , feedparser @@ -34,7 +33,6 @@ buildPythonPackage rec { beartype feedparser invoke - mypy pandas pytestCheckHook typeguard diff --git a/pkgs/development/python-modules/pixelmatch/default.nix b/pkgs/development/python-modules/pixelmatch/default.nix index c0187f4838f7..b6a7b74701cb 100644 --- a/pkgs/development/python-modules/pixelmatch/default.nix +++ b/pkgs/development/python-modules/pixelmatch/default.nix @@ -4,7 +4,6 @@ , pillow , poetry-core , pytest-benchmark -, pytest-mypy , pytestCheckHook , pythonOlder }: @@ -31,13 +30,10 @@ buildPythonPackage rec { nativeCheckInputs = [ pillow pytest-benchmark - pytest-mypy pytestCheckHook ]; pytestFlagsArray = [ - # Incompatible types in assignment - #"--mypy" "--benchmark-disable" ]; diff --git a/pkgs/development/python-modules/plugwise/default.nix b/pkgs/development/python-modules/plugwise/default.nix index b42759b2505f..c186c93332bd 100644 --- a/pkgs/development/python-modules/plugwise/default.nix +++ b/pkgs/development/python-modules/plugwise/default.nix @@ -8,7 +8,6 @@ , freezegun , jsonpickle , munch -, mypy , pyserial , pytest-aiohttp , pytest-asyncio @@ -48,7 +47,6 @@ buildPythonPackage rec { nativeCheckInputs = [ freezegun jsonpickle - mypy pytest-aiohttp pytest-asyncio pytestCheckHook diff --git a/pkgs/development/python-modules/portalocker/default.nix b/pkgs/development/python-modules/portalocker/default.nix index 6742b989c292..34845722ce4f 100644 --- a/pkgs/development/python-modules/portalocker/default.nix +++ b/pkgs/development/python-modules/portalocker/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , fetchPypi , pytestCheckHook -, pytest-mypy , pythonOlder , redis }: @@ -25,7 +24,6 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - pytest-mypy ]; disabledTests = [ @@ -41,6 +39,5 @@ buildPythonPackage rec { homepage = "https://github.com/WoLpH/portalocker"; license = licenses.psfl; maintainers = with maintainers; [ jonringer ]; - platforms = platforms.unix; # Windows has a dependency on pypiwin32 }; } diff --git a/pkgs/development/python-modules/psygnal/default.nix b/pkgs/development/python-modules/psygnal/default.nix index c3f8f499338b..c4a1565ccc2d 100644 --- a/pkgs/development/python-modules/psygnal/default.nix +++ b/pkgs/development/python-modules/psygnal/default.nix @@ -6,7 +6,6 @@ , mypy-extensions , numpy , pydantic -, pytest-mypy-plugins , pytestCheckHook , pythonOlder , typing-extensions @@ -42,7 +41,6 @@ buildPythonPackage rec { nativeCheckInputs = [ numpy pydantic - pytest-mypy-plugins pytestCheckHook wrapt ]; diff --git a/pkgs/development/python-modules/python-utils/default.nix b/pkgs/development/python-modules/python-utils/default.nix index ac69e15ec77d..35194318a2cb 100644 --- a/pkgs/development/python-modules/python-utils/default.nix +++ b/pkgs/development/python-modules/python-utils/default.nix @@ -4,7 +4,6 @@ , fetchFromGitHub , loguru , pytest-asyncio -, pytest-mypy , pytestCheckHook , pythonOlder }: @@ -24,8 +23,9 @@ buildPythonPackage rec { }; postPatch = '' - sed -i '/--cov/d' pytest.ini - sed -i '/--mypy/d' pytest.ini + sed -i pytest.ini \ + -e '/--cov/d' \ + -e '/--mypy/d' ''; passthru.optional-dependencies = { @@ -36,7 +36,6 @@ buildPythonPackage rec { nativeCheckInputs = [ pytest-asyncio - pytest-mypy pytestCheckHook ] ++ passthru.optional-dependencies.loguru; diff --git a/pkgs/development/python-modules/qtile/default.nix b/pkgs/development/python-modules/qtile/default.nix index bf3f59dcb3bb..1d8aaa55ba6e 100644 --- a/pkgs/development/python-modules/qtile/default.nix +++ b/pkgs/development/python-modules/qtile/default.nix @@ -8,7 +8,6 @@ , libinput , libxkbcommon , mpd2 -, mypy , pango , pkg-config , psutil @@ -82,11 +81,6 @@ buildPythonPackage rec { libxkbcommon ]; - # for `qtile check`, needs `stubtest` and `mypy` commands - makeWrapperArgs = [ - "--suffix PATH : ${lib.makeBinPath [ mypy ]}" - ]; - doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure. meta = with lib; { diff --git a/pkgs/development/python-modules/returns/default.nix b/pkgs/development/python-modules/returns/default.nix index c9fcac37f932..d12e4ccf1f5e 100644 --- a/pkgs/development/python-modules/returns/default.nix +++ b/pkgs/development/python-modules/returns/default.nix @@ -5,13 +5,9 @@ , fetchFromGitHub , httpx , hypothesis -, mypy , poetry-core , pytestCheckHook , pytest-aio -, pytest-cov -, pytest-mypy -, pytest-mypy-plugins , pytest-subtests , setuptools , trio @@ -30,6 +26,12 @@ buildPythonPackage rec { hash = "sha256-28WYjrjmu3hQ8+Snuvl3ykTd86eWYI97AE60p6SVwDQ="; }; + postPatch = '' + sed -i setup.cfg \ + -e '/--cov.*/d' \ + -e '/--mypy.*/d' + ''; + nativeBuildInputs = [ poetry-core ]; @@ -38,17 +40,17 @@ buildPythonPackage rec { typing-extensions ]; + preCheck = '' + rm -rf returns/contrib/mypy + ''; + nativeCheckInputs = [ anyio curio httpx hypothesis - mypy pytestCheckHook pytest-aio - pytest-cov - pytest-mypy - pytest-mypy-plugins pytest-subtests setuptools trio @@ -58,7 +60,7 @@ buildPythonPackage rec { meta = with lib; { description = "Make your functions return something meaningful, typed, and safe!"; - homepage = "returns.rtfd.io"; + homepage = "https://github.com/dry-python/returns"; license = licenses.bsd2; maintainers = [ maintainers.jessemoore ]; }; diff --git a/pkgs/development/python-modules/strawberry-graphql/default.nix b/pkgs/development/python-modules/strawberry-graphql/default.nix index 34978963fdb4..98bd27072d16 100644 --- a/pkgs/development/python-modules/strawberry-graphql/default.nix +++ b/pkgs/development/python-modules/strawberry-graphql/default.nix @@ -1,7 +1,6 @@ { lib , aiohttp , asgiref -, backports-cached-property , buildPythonPackage , chalice , channels @@ -16,7 +15,6 @@ , freezegun , graphql-core , libcst -, mypy , opentelemetry-api , opentelemetry-sdk , poetry-core @@ -149,7 +147,6 @@ buildPythonPackage rec { daphne email-validator freezegun - mypy pytest-asyncio pytest-emoji pytest-mock @@ -168,6 +165,7 @@ buildPythonPackage rec { "tests/django/test_dataloaders.py" "tests/exceptions/" "tests/http/" + "tests/mypy/test_plugin.py" # avoid dependency on mypy "tests/schema/extensions/" "tests/schema/test_dataloaders.py" "tests/schema/test_lazy/" diff --git a/pkgs/development/python-modules/tatsu/default.nix b/pkgs/development/python-modules/tatsu/default.nix index 5d787e360a75..4d376dc6d2ca 100644 --- a/pkgs/development/python-modules/tatsu/default.nix +++ b/pkgs/development/python-modules/tatsu/default.nix @@ -2,7 +2,6 @@ , buildPythonPackage , colorama , fetchFromGitHub -, pytest-mypy , pytestCheckHook , pythonOlder , regex @@ -28,7 +27,6 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - pytest-mypy pytestCheckHook ]; diff --git a/pkgs/development/python-modules/typical/default.nix b/pkgs/development/python-modules/typical/default.nix index 5cbdce7c6252..67d55e64243e 100644 --- a/pkgs/development/python-modules/typical/default.nix +++ b/pkgs/development/python-modules/typical/default.nix @@ -4,7 +4,6 @@ , fetchFromGitHub , future-typing , inflection -, mypy , orjson , pandas , pendulum @@ -45,7 +44,6 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook - mypy pydantic sqlalchemy pandas diff --git a/pkgs/development/python-modules/zimports/default.nix b/pkgs/development/python-modules/zimports/default.nix index 53c4bd8ed208..ee9d683c8642 100644 --- a/pkgs/development/python-modules/zimports/default.nix +++ b/pkgs/development/python-modules/zimports/default.nix @@ -1,5 +1,4 @@ { lib -, isPy3k , fetchFromGitHub , buildPythonPackage , flake8-import-order @@ -7,6 +6,7 @@ , tomli , setuptools , pytestCheckHook +, pythonAtLeast , pythonOlder }: @@ -15,7 +15,8 @@ buildPythonPackage rec { version = "0.6.0"; format = "setuptools"; - disabled = pythonOlder "3.7"; + # upstream technically support 3.7 through 3.9, but 3.10 happens to work while 3.11 breaks with an import error + disabled = pythonOlder "3.7" || pythonAtLeast "3.11"; src = fetchFromGitHub { owner = "sqlalchemyorg"; diff --git a/pkgs/development/tools/refurb/default.nix b/pkgs/development/tools/refurb/default.nix index f98f656d4dd1..c413a57a7caa 100644 --- a/pkgs/development/tools/refurb/default.nix +++ b/pkgs/development/tools/refurb/default.nix @@ -15,6 +15,11 @@ python3Packages.buildPythonApplication rec { hash = "sha256-e/gKBgbtjO2XYnAIdHDoVJWyP6cyvsuIFLrV/eqjces="; }; + postPatch = '' + # remove --cov* options provided to pytest + sed -i '/^addopts = "--cov/d' pyproject.toml + ''; + nativeBuildInputs = with python3Packages; [ poetry-core ]; @@ -41,9 +46,9 @@ python3Packages.buildPythonApplication rec { pytestCheckHook ]; - postPatch = '' - sed -i "/^addopts/d" pyproject.toml - ''; + disabledTests = [ + "test_checks" # broken because new mypy release added new checks + ]; pythonImportsCheck = [ "refurb" diff --git a/pkgs/tools/backup/zfs-replicate/default.nix b/pkgs/tools/backup/zfs-replicate/default.nix index 60a3d1b90120..94cb3790a567 100644 --- a/pkgs/tools/backup/zfs-replicate/default.nix +++ b/pkgs/tools/backup/zfs-replicate/default.nix @@ -1,5 +1,5 @@ -{ buildPythonApplication, click, fetchPypi, hypothesis, mypy, pytest -, pytest-cov, pytest-runner, lib, stringcase +{ buildPythonApplication, click, fetchPypi, hypothesis, pytest +, lib, stringcase }: buildPythonApplication rec { @@ -11,15 +11,14 @@ buildPythonApplication rec { sha256 = "b2cb9d4670a6e12d14a446c10d857862e91af6e4526f607e08b41bde89953bb8"; }; + postPatch = '' + sed -i setup.cfg \ + -e '/--cov.*/d' + ''; + nativeCheckInputs = [ hypothesis - mypy pytest - pytest-cov - ]; - - buildInputs = [ - pytest-runner ]; propagatedBuildInputs = [ diff --git a/pkgs/tools/package-management/nix-pin/default.nix b/pkgs/tools/package-management/nix-pin/default.nix index 4dc0098316c6..b924c8c07f4a 100644 --- a/pkgs/tools/package-management/nix-pin/default.nix +++ b/pkgs/tools/package-management/nix-pin/default.nix @@ -1,4 +1,4 @@ -{ lib, pkgs, stdenv, fetchFromGitHub, mypy, python3, nix, git, makeWrapper +{ lib, pkgs, stdenv, fetchFromGitHub, python3, nix, git, makeWrapper , runtimeShell }: let self = stdenv.mkDerivation rec { pname = "nix-pin"; @@ -10,10 +10,7 @@ let self = stdenv.mkDerivation rec { sha256 = "1pccvc0iqapms7kidrh09g5fdx44x622r5l9k7bkmssp3v4c68vy"; }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ python3 mypy ]; - checkPhase = '' - mypy bin/* - ''; + buildInputs = [ python3 ]; installPhase = '' mkdir "$out" cp -r bin share "$out"