Merge pull request #331138 from pbsds/fix-pytest-cov-stub-migrations-1722359134

treewide: migrate to pytest-cov-stub
This commit is contained in:
Peder Bergebakken Sundt 2024-08-06 07:49:05 +02:00 committed by GitHub
commit e6fe66b285
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 32 additions and 51 deletions

View File

@ -6,6 +6,7 @@
fetchFromGitHub,
fetchpatch,
pytest-aiohttp,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
setuptools,
@ -32,11 +33,6 @@ buildPythonPackage rec {
})
];
postPatch = ''
substituteInPlace pytest.ini \
--replace "--cov=aiojobs/ --cov=tests/ --cov-report term" ""
'';
nativeBuildInputs = [ setuptools ];
propagatedBuildInputs = lib.optionals (pythonOlder "3.11") [ async-timeout ];
@ -48,6 +44,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-aiohttp
pytest-cov-stub
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
pythonImportsCheck = [ "aiojobs" ];

View File

@ -8,6 +8,7 @@
yarl,
aresponses,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
}:
@ -34,14 +35,14 @@ buildPythonPackage rec {
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-cov-stub
pytestCheckHook
];
postPatch = ''
# Upstream doesn't set a version for the pyproject.toml
substituteInPlace pyproject.toml \
--replace "0.0.0" "${version}" \
--replace "--cov" ""
--replace "0.0.0" "${version}"
'';
pythonImportsCheck = [ "ambee" ];

View File

@ -3,6 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
}:
@ -20,12 +21,10 @@ buildPythonPackage rec {
sha256 = "0cssdcridadjzichz1vv1ng7jwphqkn8ihh83hpz9mcjmxyb94qc";
};
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace setup.cfg \
--replace " --cov=anonip --cov-report=term-missing --no-cov-on-fail" ""
'';
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
pytestFlagsArray = [ "tests.py" ];

View File

@ -8,6 +8,7 @@
jupyterhub,
pythonOlder,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
}:
@ -35,13 +36,9 @@ buildPythonPackage rec {
jupyterhub
];
preCheck = ''
substituteInPlace pyproject.toml \
--replace-fail "--cov=batchspawner" ""
'';
nativeCheckInputs = [
pytest-asyncio
pytest-cov-stub
pytestCheckHook
];

View File

@ -6,6 +6,7 @@
setuptools,
strct,
pytestCheckHook,
pytest-cov-stub,
pyyaml,
}:
@ -31,11 +32,6 @@ buildPythonPackage rec {
];
postPatch = ''
substituteInPlace pytest.ini \
--replace-fail \
"--cov" \
"#--cov"
# configure correct version, which fails due to missing .git
substituteInPlace versioneer.py birch/_version.py \
--replace-fail '"0+unknown"' '"${version}"'
@ -54,6 +50,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pyyaml
];

View File

@ -7,6 +7,7 @@
watchdog,
portalocker,
pytestCheckHook,
pytest-cov-stub,
pymongo,
dnspython,
pymongo-inmemory,
@ -39,15 +40,9 @@ buildPythonPackage rec {
portalocker
];
preCheck = ''
substituteInPlace pyproject.toml \
--replace-fail \
'"--cov' \
'#"--cov'
'';
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pymongo
dnspython
pymongo-inmemory

View File

@ -7,6 +7,7 @@
fetchpatch,
poetry-core,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
yarl,
@ -37,8 +38,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace '"0.0.0"' '"${version}"' \
--replace 'addopts = "--cov"' ""
--replace '"0.0.0"' '"${version}"'
'';
nativeBuildInputs = [ poetry-core ];
@ -53,6 +53,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
aresponses
pytest-asyncio
pytest-cov-stub
pytestCheckHook
];

View File

@ -8,6 +8,7 @@
poetry-core,
pydantic,
pyjwt,
pytest-cov-stub,
pytest-xdist,
pytestCheckHook,
pythonOlder,
@ -28,11 +29,6 @@ buildPythonPackage rec {
hash = "sha256-FTNLyCcwDU6EssQDJlwtmA7cQj57fsOaecvbpwswirU=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--cov=githubkit --cov-append --cov-report=term-missing" ""
'';
pythonRelaxDeps = [ "hishel" ];
build-system = [ poetry-core ];
@ -61,6 +57,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pytest-xdist
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

View File

@ -10,6 +10,7 @@
scipy,
pandas,
pytestCheckHook,
pytest-cov-stub,
setuptools,
}:
@ -25,11 +26,6 @@ buildPythonPackage rec {
hash = "sha256-An5RzK0nnRaBI6JEUl5shLrA22RgWzEbC9NJiRvgxT4=";
};
postPatch = ''
substituteInPlace tox.ini \
--replace-fail "--cov=./hickle" ""
'';
build-system = [ setuptools ];
dependencies = [
@ -42,6 +38,7 @@ buildPythonPackage rec {
astropy
pandas
pytestCheckHook
pytest-cov-stub
scipy
];

View File

@ -10,6 +10,7 @@
mwoauth,
pyjwt,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
requests,
requests-mock,
@ -31,11 +32,6 @@ buildPythonPackage rec {
hash = "sha256-gFhhOCcmorkrLxrup9fICh5ueCrc64fxfuZXTQG1tMk=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail " --cov=oauthenticator" ""
'';
build-system = [ setuptools ];
dependencies = [
@ -58,6 +54,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytest-asyncio
pytest-cov-stub
pytestCheckHook
requests-mock
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

View File

@ -4,6 +4,7 @@
fetchFromGitHub,
bson,
pytestCheckHook,
pytest-cov-stub,
pyyaml,
setuptools,
}:
@ -23,8 +24,6 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace setup.py \
--replace "'pytest-runner'" ""
substituteInPlace setup.cfg \
--replace "--cov=pymarshal --cov-report=html --cov-report=term" ""
'';
nativeBuildInputs = [ setuptools ];
@ -33,6 +32,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
bson
pyyaml
];

View File

@ -4,6 +4,7 @@
fetchFromGitHub,
pythonOlder,
pytestCheckHook,
pytest-cov-stub,
setuptools,
mirakuru,
port-for,
@ -28,7 +29,6 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--cov" "" \
--replace-fail "--max-worker-restart=0" ""
sed -i 's#/usr/lib/postgresql/.*/bin/pg_ctl#${postgresql}/bin/pg_ctl#' pytest_postgresql/plugin.py
'';
@ -45,6 +45,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
postgresql
pytestCheckHook
pytest-cov-stub
];
pytestFlagsArray = [
"-p"

View File

@ -13,6 +13,7 @@
prettytable,
pytest-mock,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
requests,
setuptools,
@ -37,7 +38,7 @@ buildPythonPackage rec {
substituteInPlace requirements.txt \
--replace-fail "==" ">="
substituteInPlace pytest.ini \
--replace ' --cov toggl -m "not premium"' ""
--replace ' -m "not premium"' ""
'';
build-system = [
@ -60,6 +61,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pytest-mock
faker
factory-boy