From ca355f14c813f9e8c326ae952412c770de1373bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 23 Aug 2024 15:12:04 +0200 Subject: [PATCH] treewide: replace all pytest-cov patching outside of pythonPackages with pytest-cov-stub --- pkgs/applications/audio/gpodder/default.nix | 2 +- pkgs/applications/networking/protonvpn-gui/default.nix | 7 ++----- pkgs/applications/office/paperless-ngx/default.nix | 5 +---- .../version-management/git-archive-all/default.nix | 3 ++- pkgs/by-name/au/autosuspend/package.nix | 6 +----- pkgs/by-name/cm/cmake-lint/package.nix | 7 +------ pkgs/by-name/de/dep-scan/package.nix | 6 +----- pkgs/by-name/ga/gato/package.nix | 6 +----- pkgs/by-name/gi/git-pw/package.nix | 6 +----- pkgs/by-name/ma/makejinja/package.nix | 10 ++++------ pkgs/by-name/ma/marge-bot/package.nix | 10 ++++++++-- pkgs/by-name/pr/pretalx/package.nix | 4 +--- pkgs/by-name/sn/snapcraft/package.nix | 4 ++-- pkgs/by-name/su/sublime-music/package.nix | 6 +----- pkgs/development/tools/codespell/default.nix | 7 +------ pkgs/development/tools/refurb/default.nix | 6 +----- .../custom-components/govee-lan/default.nix | 8 ++------ .../home-assistant/custom-components/mass/default.nix | 6 ++---- pkgs/tools/admin/ansible/later.nix | 6 +----- pkgs/tools/backup/zfs-replicate/default.nix | 8 ++------ pkgs/tools/misc/esphome/default.nix | 4 +--- pkgs/tools/misc/kb/default.nix | 6 +----- pkgs/tools/security/ioc-scan/default.nix | 6 +----- pkgs/tools/security/kube-hunter/default.nix | 4 ++-- pkgs/tools/security/sshuttle/default.nix | 7 +------ pkgs/tools/security/trustymail/default.nix | 10 ++++------ pkgs/tools/security/wapiti/default.nix | 7 +------ 27 files changed, 47 insertions(+), 120 deletions(-) diff --git a/pkgs/applications/audio/gpodder/default.nix b/pkgs/applications/audio/gpodder/default.nix index 4ddbf4b6ef61..9a62fab2850c 100644 --- a/pkgs/applications/audio/gpodder/default.nix +++ b/pkgs/applications/audio/gpodder/default.nix @@ -47,7 +47,7 @@ python311Packages.buildPythonApplication rec { minimock pytest pytest-httpserver - pytest-cov + pytest-cov-stub ]; doCheck = true; diff --git a/pkgs/applications/networking/protonvpn-gui/default.nix b/pkgs/applications/networking/protonvpn-gui/default.nix index 38b196cb6c3d..abeabcd1610f 100644 --- a/pkgs/applications/networking/protonvpn-gui/default.nix +++ b/pkgs/applications/networking/protonvpn-gui/default.nix @@ -19,6 +19,7 @@ , proton-vpn-session , pycairo , pygobject3 +, pytest-cov-stub , pytestCheckHook , withIndicator ? true , libappindicator-gtk3 @@ -69,11 +70,6 @@ buildPythonApplication rec { pygobject3 ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov=proton --cov-report=html --cov-report=term" "" - ''; - postInstall = '' mkdir -p $out/share/{applications,pixmaps} install -Dm 644 ${src}/rpmbuild/SOURCES/protonvpn-app.desktop $out/share/applications @@ -81,6 +77,7 @@ buildPythonApplication rec { ''; nativeCheckInputs = [ + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/applications/office/paperless-ngx/default.nix b/pkgs/applications/office/paperless-ngx/default.nix index be9b11f5da01..88f954921aa3 100644 --- a/pkgs/applications/office/paperless-ngx/default.nix +++ b/pkgs/applications/office/paperless-ngx/default.nix @@ -219,6 +219,7 @@ python.pkgs.buildPythonApplication rec { daphne factory-boy imagehash + pytest-cov-stub pytest-django pytest-env pytest-httpx @@ -240,10 +241,6 @@ python.pkgs.buildPythonApplication rec { export PATH="${path}:$PATH" export HOME=$(mktemp -d) export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS" - - # Disable unneeded code coverage test - substituteInPlace src/setup.cfg \ - --replace-fail "--cov --cov-report=html --cov-report=xml" "" ''; disabledTests = [ diff --git a/pkgs/applications/version-management/git-archive-all/default.nix b/pkgs/applications/version-management/git-archive-all/default.nix index f38e08ba8c8e..abc8ccbbfe5f 100644 --- a/pkgs/applications/version-management/git-archive-all/default.nix +++ b/pkgs/applications/version-management/git-archive-all/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , git , pytestCheckHook +, pytest-cov-stub , pytest-mock }: @@ -28,7 +29,6 @@ buildPythonApplication rec { --replace pytest==5.2.2 pytest \ --replace pytest-cov==2.8.1 "" \ --replace pytest-mock==1.11.2 pytest-mock \ - --replace "--cov=git_archive_all --cov-report=term --cov-branch" "" \ --replace "filterwarnings = error" "" substituteInPlace test_git_archive_all.py \ --replace "import pycodestyle" "" @@ -40,6 +40,7 @@ buildPythonApplication rec { checkInputs = [ pytestCheckHook + pytest-cov-stub pytest-mock ]; diff --git a/pkgs/by-name/au/autosuspend/package.nix b/pkgs/by-name/au/autosuspend/package.nix index b38e121ad690..798dc89b8375 100644 --- a/pkgs/by-name/au/autosuspend/package.nix +++ b/pkgs/by-name/au/autosuspend/package.nix @@ -17,11 +17,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-AJ0ZWRxqhBJEics6XnIVWyf7pJI8MphQU4LRqSYYNSQ="; }; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail '--cov-config=setup.cfg' "" - ''; - dependencies = with python3.pkgs; [ dbus-python icalendar @@ -40,6 +35,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ dbus freezegun + pytest-cov-stub pytest-datadir pytest-httpserver pytest-mock diff --git a/pkgs/by-name/cm/cmake-lint/package.nix b/pkgs/by-name/cm/cmake-lint/package.nix index fd1c95165c35..e58eff674d90 100644 --- a/pkgs/by-name/cm/cmake-lint/package.nix +++ b/pkgs/by-name/cm/cmake-lint/package.nix @@ -18,18 +18,13 @@ python3Packages.buildPythonApplication rec { hash = "sha256-/OuWwerBlJynEibaYo+jkLpHt4x9GZrqMRJNxgrDBlM="; }; - postPatch = '' - # We don't need to test coverage, so remove these checks - substituteInPlace setup.cfg \ - --replace-fail "addopts = --cov-fail-under=84 --cov=./cmakelint" "" - ''; - build-system = [ python3Packages.setuptools ]; pythonImportsCheck = [ "cmakelint" ]; nativeCheckInputs = [ python3Packages.pytestCheckHook + python3Packages.pytest-cov-stub ]; passthru.tests = { diff --git a/pkgs/by-name/de/dep-scan/package.nix b/pkgs/by-name/de/dep-scan/package.nix index d666f4f0304e..930c37fc9dcc 100644 --- a/pkgs/by-name/de/dep-scan/package.nix +++ b/pkgs/by-name/de/dep-scan/package.nix @@ -16,11 +16,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-5iMhl3Wcxwgq4Wr0TUcAuRnb2+y8DHBugnnkpcZfSAM="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace-fail " --cov-append --cov-report term --cov depscan" "" - ''; - build-system = with python3.pkgs; [ setuptools ]; dependencies = with python3.pkgs; [ @@ -40,6 +35,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ httpretty + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/by-name/ga/gato/package.nix b/pkgs/by-name/ga/gato/package.nix index 655b60b2b839..56fb02908f66 100644 --- a/pkgs/by-name/ga/gato/package.nix +++ b/pkgs/by-name/ga/gato/package.nix @@ -16,11 +16,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-vXQFgP0KDWo1VWe7tMGCB2yEYlr/1KMXsiNupBVLBqc="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov=gato" "" - ''; - nativeBuildInputs = with python3.pkgs; [ setuptools wheel @@ -36,6 +31,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ git + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/by-name/gi/git-pw/package.nix b/pkgs/by-name/gi/git-pw/package.nix index baef706b0d04..121a9e33a06c 100644 --- a/pkgs/by-name/gi/git-pw/package.nix +++ b/pkgs/by-name/gi/git-pw/package.nix @@ -20,11 +20,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-3IiFU6qGI2MDTBOLQ2qyT5keUMNTNG3sxhtGR3bkIBc="; }; - postPatch = '' - # We don't want to run the coverage. - substituteInPlace tox.ini --replace "--cov=git_pw --cov-report" "" - ''; - nativeBuildInputs = with python3.pkgs; [ pbr setuptools @@ -39,6 +34,7 @@ python3.pkgs.buildPythonApplication rec { ]; nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub pytest git ]; diff --git a/pkgs/by-name/ma/makejinja/package.nix b/pkgs/by-name/ma/makejinja/package.nix index c571e198c68e..e2e6755d9343 100644 --- a/pkgs/by-name/ma/makejinja/package.nix +++ b/pkgs/by-name/ma/makejinja/package.nix @@ -31,12 +31,10 @@ python3Packages.buildPythonApplication rec { ++ typed-settings.optional-dependencies.cattrs ++ typed-settings.optional-dependencies.click; - preCheck = '' - substituteInPlace pyproject.toml \ - --replace-fail "--cov makejinja --cov-report term-missing" "" - ''; - - nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; + nativeCheckInputs = with python3Packages; [ + pytest-cov-stub + pytestCheckHook + ]; meta = { description = "Generate entire directory structures using Jinja templates with support for external data and custom plugins"; diff --git a/pkgs/by-name/ma/marge-bot/package.nix b/pkgs/by-name/ma/marge-bot/package.nix index f5946f4b7ed1..30483e91bf37 100644 --- a/pkgs/by-name/ma/marge-bot/package.nix +++ b/pkgs/by-name/ma/marge-bot/package.nix @@ -16,7 +16,7 @@ python3.pkgs.buildPythonApplication rec { }; postPatch = '' - substituteInPlace setup.cfg --replace-fail "--flake8 --pylint --cov=marge" "" + substituteInPlace setup.cfg --replace-fail "--flake8 --pylint" "" ''; nativeBuildInputs = [ @@ -30,12 +30,18 @@ python3.pkgs.buildPythonApplication rec { requests ]; - nativeCheckInputs = with python3.pkgs; [ pytestCheckHook pendulum ]; + nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub + pytestCheckHook + pendulum + ]; + disabledTests = [ # test broken when run under Nix: # "unittest.mock.InvalidSpecError: Cannot spec a Mock object." "test_get_mr_ci_status" ]; + disabledTestPaths = [ # test errors due to API mismatch in test setup: # "ImportError: cannot import name 'set_test_now' from 'pendulum.helpers'" diff --git a/pkgs/by-name/pr/pretalx/package.nix b/pkgs/by-name/pr/pretalx/package.nix index 94fb2357465b..0abf3996cb58 100644 --- a/pkgs/by-name/pr/pretalx/package.nix +++ b/pkgs/by-name/pr/pretalx/package.nix @@ -74,9 +74,6 @@ python.pkgs.buildPythonApplication rec { postPatch = '' substituteInPlace src/pretalx/common/management/commands/rebuild.py \ --replace 'subprocess.check_call(["npm", "run", "build"], cwd=frontend_dir, env=env)' "" - - substituteInPlace src/setup.cfg \ - --replace "--cov=./ --cov-report=" "" ''; nativeBuildInputs = [ @@ -196,6 +193,7 @@ python.pkgs.buildPythonApplication rec { faker freezegun jsonschema + pytest-cov-stub pytest-django pytest-mock pytest-xdist diff --git a/pkgs/by-name/sn/snapcraft/package.nix b/pkgs/by-name/sn/snapcraft/package.nix index b344d91603b5..68e0e09c5b55 100644 --- a/pkgs/by-name/sn/snapcraft/package.nix +++ b/pkgs/by-name/sn/snapcraft/package.nix @@ -88,8 +88,7 @@ python.pkgs.buildPythonApplication rec { 'return str(Path("${glibc}/lib/ld-linux-x86-64.so.2"))' substituteInPlace pyproject.toml \ - --replace-fail '"pytest-cov>=4.0",' "" \ - --replace-fail "--cov=snapcraft" "" + --replace-fail '"pytest-cov>=4.0",' "" ''; nativeBuildInputs = [ makeWrapper ]; @@ -155,6 +154,7 @@ python.pkgs.buildPythonApplication rec { with python.pkgs; [ pytest-check + pytest-cov-stub pytest-mock pytest-subprocess pytestCheckHook diff --git a/pkgs/by-name/su/sublime-music/package.nix b/pkgs/by-name/su/sublime-music/package.nix index e2a7874a0eb0..f3ad04e7b01c 100644 --- a/pkgs/by-name/su/sublime-music/package.nix +++ b/pkgs/by-name/su/sublime-music/package.nix @@ -35,11 +35,6 @@ python3.pkgs.buildPythonApplication rec { }) ]; - postPatch = '' - sed -i "/--cov/d" setup.cfg - sed -i "/--no-cov-on-fail/d" setup.cfg - ''; - build-system = with python3.pkgs; [ flit-core ]; @@ -76,6 +71,7 @@ python3.pkgs.buildPythonApplication rec { ; nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/development/tools/codespell/default.nix b/pkgs/development/tools/codespell/default.nix index 84eb2cdfa205..da39f0f75992 100644 --- a/pkgs/development/tools/codespell/default.nix +++ b/pkgs/development/tools/codespell/default.nix @@ -16,12 +16,6 @@ python3.pkgs.buildPythonApplication rec { sha256 = "sha256-X3Pueu0E7Q57sbKSXqCZki4/PUb1WyWk/Zmj+lhVTM8="; }; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace "--cov=codespell_lib" "" \ - --replace "--cov-report=" "" - ''; - nativeBuildInputs = with python3.pkgs; [ setuptools-scm ]; @@ -30,6 +24,7 @@ python3.pkgs.buildPythonApplication rec { aspell-python chardet pytestCheckHook + pytest-cov-stub pytest-dependency ]; diff --git a/pkgs/development/tools/refurb/default.nix b/pkgs/development/tools/refurb/default.nix index a5c5d0d62247..83c0e04b1829 100644 --- a/pkgs/development/tools/refurb/default.nix +++ b/pkgs/development/tools/refurb/default.nix @@ -15,11 +15,6 @@ python3Packages.buildPythonApplication rec { hash = "sha256-6MchaqRKJPmvwiDyhCK4kFyIYl2B+2dGL8H8X2ES+VQ="; }; - postPatch = '' - # remove --cov* options provided to pytest - sed -i '/^addopts = "--cov/d' pyproject.toml - ''; - nativeBuildInputs = with python3Packages; [ poetry-core ]; @@ -43,6 +38,7 @@ python3Packages.buildPythonApplication rec { pluggy py pyparsing + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/servers/home-assistant/custom-components/govee-lan/default.nix b/pkgs/servers/home-assistant/custom-components/govee-lan/default.nix index f5ab54f19329..6d66dc8fe357 100644 --- a/pkgs/servers/home-assistant/custom-components/govee-lan/default.nix +++ b/pkgs/servers/home-assistant/custom-components/govee-lan/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , fetchpatch2 , govee-led-wez +, pytest-cov-stub , pytest-homeassistant-custom-component , pytestCheckHook }: @@ -26,11 +27,6 @@ buildHomeAssistantComponent { }) ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace-fail "--cov=custom_components" "" - ''; - dontBuild = true; propagatedBuildInputs = [ @@ -41,11 +37,11 @@ buildHomeAssistantComponent { doCheck = false; nativeCheckInputs = [ + pytest-cov-stub pytest-homeassistant-custom-component pytestCheckHook ]; - meta = with lib; { description = "Control Govee lights via the LAN API from Home Assistant"; homepage = "https://github.com/wez/govee-lan-hass"; diff --git a/pkgs/servers/home-assistant/custom-components/mass/default.nix b/pkgs/servers/home-assistant/custom-components/mass/default.nix index 08382d024f8e..bad3fea25064 100644 --- a/pkgs/servers/home-assistant/custom-components/mass/default.nix +++ b/pkgs/servers/home-assistant/custom-components/mass/default.nix @@ -6,6 +6,7 @@ , music-assistant , pytestCheckHook , pytest-asyncio +, pytest-cov-stub , pytest-homeassistant-custom-component }: @@ -21,10 +22,6 @@ buildHomeAssistantComponent rec { hash = "sha256-Wvc+vUYkUJmS4U34Sh/sDCVXmQA0AtEqIT8MNXd++3M="; }; - postPatch = '' - sed -i "s/--cov//" pyproject.toml - ''; - dependencies = [ async-timeout (toPythonModule music-assistant) @@ -35,6 +32,7 @@ buildHomeAssistantComponent rec { nativeCheckInputs = [ pytestCheckHook pytest-asyncio + pytest-cov-stub pytest-homeassistant-custom-component ]; diff --git a/pkgs/tools/admin/ansible/later.nix b/pkgs/tools/admin/ansible/later.nix index d40355e09e81..62230f4c1187 100644 --- a/pkgs/tools/admin/ansible/later.nix +++ b/pkgs/tools/admin/ansible/later.nix @@ -25,11 +25,6 @@ python3.pkgs.buildPythonApplication rec { }) ]; - postPatch = '' - substituteInPlace pyproject.toml \ - --replace " --cov=ansiblelater --cov-report=xml:coverage.xml --cov-report=term --no-cov-on-fail" "" - ''; - pythonRelaxDeps = [ "anyconfig" "flake8" @@ -65,6 +60,7 @@ python3.pkgs.buildPythonApplication rec { ]; nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub pytest-mock pytestCheckHook ]; diff --git a/pkgs/tools/backup/zfs-replicate/default.nix b/pkgs/tools/backup/zfs-replicate/default.nix index 1ae5c0de79fa..72a41a53cdfe 100644 --- a/pkgs/tools/backup/zfs-replicate/default.nix +++ b/pkgs/tools/backup/zfs-replicate/default.nix @@ -4,7 +4,7 @@ , hypothesis , lib , poetry-core -, pytest +, pytest-cov-stub , pytestCheckHook , stringcase }: @@ -19,10 +19,6 @@ buildPythonApplication rec { hash = "sha256-Xmg33bqs3gQJWqkCNiWYUem3o6XsxpfbHIVvLs/2D94="; }; - postPatch = '' - sed -i pyproject.toml -e '/--cov[^"]*/d' - ''; - nativeBuildInputs = [ poetry-core ]; @@ -30,7 +26,7 @@ buildPythonApplication rec { nativeCheckInputs = [ pytestCheckHook hypothesis - pytest + pytest-cov-stub ]; propagatedBuildInputs = [ diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix index b95f6d6d9b3c..185a75c60dfc 100644 --- a/pkgs/tools/misc/esphome/default.nix +++ b/pkgs/tools/misc/esphome/default.nix @@ -48,9 +48,6 @@ python.pkgs.buildPythonApplication rec { substituteInPlace pyproject.toml \ --replace-fail "setuptools==" "setuptools>=" - # drop coverage testing - sed -i '/--cov/d' pyproject.toml - # ensure component dependencies are available cat requirements_optional.txt >> requirements.txt # relax strict runtime version check @@ -112,6 +109,7 @@ python.pkgs.buildPythonApplication rec { hypothesis mock pytest-asyncio + pytest-cov-stub pytest-mock pytestCheckHook ]; diff --git a/pkgs/tools/misc/kb/default.nix b/pkgs/tools/misc/kb/default.nix index f3de66d7612f..41f5d7e55c32 100644 --- a/pkgs/tools/misc/kb/default.nix +++ b/pkgs/tools/misc/kb/default.nix @@ -22,11 +22,6 @@ python3.pkgs.buildPythonApplication rec { --replace \ "install_requires=[\"colored\",\"toml\",\"attr\",\"attrs\",\"gitpython\"]," \ "install_requires=[\"colored\",\"toml\",\"attrs\",\"gitpython\"]," - - # pytest coverage reporting isn't necessary - substituteInPlace setup.cfg \ - --replace \ - "addopts = --cov=kb --cov-report term-missing" "" ''; propagatedBuildInputs = with python3.pkgs; [ @@ -37,6 +32,7 @@ python3.pkgs.buildPythonApplication rec { ]; nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/tools/security/ioc-scan/default.nix b/pkgs/tools/security/ioc-scan/default.nix index 805aee0230bb..4b7c81119c5d 100644 --- a/pkgs/tools/security/ioc-scan/default.nix +++ b/pkgs/tools/security/ioc-scan/default.nix @@ -15,17 +15,13 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-SCyCANZfi7PqexM2Kc8WJwwEEiBQxPBg0ggWsK9WB4k="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace-fail " --cov" "" - ''; - build-system = with python3.pkgs; [ setuptools ]; propagatedBuildInputs = with python3.pkgs; [ docopt]; nativeCheckInputs = with python3.pkgs; [ pyfakefs + pytest-cov-stub pytestCheckHook ]; diff --git a/pkgs/tools/security/kube-hunter/default.nix b/pkgs/tools/security/kube-hunter/default.nix index bc23c3845b89..22ddaa1c5dde 100644 --- a/pkgs/tools/security/kube-hunter/default.nix +++ b/pkgs/tools/security/kube-hunter/default.nix @@ -32,6 +32,7 @@ python3.pkgs.buildPythonApplication rec { ]; nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub pytestCheckHook requests-mock ]; @@ -39,8 +40,7 @@ python3.pkgs.buildPythonApplication rec { postPatch = '' substituteInPlace setup.cfg \ --replace "dataclasses" "" \ - --replace "kubernetes==12.0.1" "kubernetes" \ - --replace "--cov=kube_hunter" "" + --replace "kubernetes==12.0.1" "kubernetes" ''; pythonImportsCheck = [ diff --git a/pkgs/tools/security/sshuttle/default.nix b/pkgs/tools/security/sshuttle/default.nix index 11927410f6b7..2090c4d396bd 100644 --- a/pkgs/tools/security/sshuttle/default.nix +++ b/pkgs/tools/security/sshuttle/default.nix @@ -25,11 +25,6 @@ python3Packages.buildPythonApplication rec { patches = [ ./sudo.patch ]; - postPatch = '' - substituteInPlace setup.cfg \ - --replace '--cov=sshuttle --cov-branch --cov-report=term-missing' "" - ''; - nativeBuildInputs = [ installShellFiles makeWrapper @@ -37,7 +32,7 @@ python3Packages.buildPythonApplication rec { sphinx ]; - nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; + nativeCheckInputs = with python3Packages; [ pytest-cov-stub pytestCheckHook ]; postBuild = '' make man -C docs diff --git a/pkgs/tools/security/trustymail/default.nix b/pkgs/tools/security/trustymail/default.nix index 9935cbdb842f..8c54cbf05047 100644 --- a/pkgs/tools/security/trustymail/default.nix +++ b/pkgs/tools/security/trustymail/default.nix @@ -16,11 +16,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-Zkw+NfeVtIArrBxR1qR9bAQe5yd7mAtNiT0x5Mqr3Ic="; }; - postPatch = '' - substituteInPlace pytest.ini \ - --replace-fail " --cov" "" - ''; - build-system = with python3.pkgs; [ setuptools ]; dependencies = @@ -35,7 +30,10 @@ python3.pkgs.buildPythonApplication rec { ] ++ publicsuffixlist.optional-dependencies.update; - nativeCheckInputs = with python3.pkgs; [ pytestCheckHook ]; + nativeCheckInputs = with python3.pkgs; [ + pytest-cov-stub + pytestCheckHook + ]; pythonImportsCheck = [ "trustymail" ]; diff --git a/pkgs/tools/security/wapiti/default.nix b/pkgs/tools/security/wapiti/default.nix index c2e2e742ab04..8859044237b3 100644 --- a/pkgs/tools/security/wapiti/default.nix +++ b/pkgs/tools/security/wapiti/default.nix @@ -16,12 +16,6 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-Ekh31MXqxY6iSyQRX0YZ0Tl7DFhYqGtOepYS/VObZc0="; }; - postPatch = '' - # Remove code coverage checking - substituteInPlace pyproject.toml \ - --replace-fail "--cov --cov-report=xml" "" - ''; - pythonRelaxDeps = true; build-system = with python3.pkgs; [ setuptools ]; @@ -61,6 +55,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = with python3.pkgs; [ respx pytest-asyncio + pytest-cov-stub pytestCheckHook ];