Merge pull request #332843 from pbsds/migrate-pytest-cov-stub-1722976455

treewide: migrate to pytest-cov-stub
This commit is contained in:
Peder Bergebakken Sundt 2024-08-12 01:31:28 +02:00 committed by GitHub
commit f05d8cbed8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 50 additions and 77 deletions

View File

@ -5,6 +5,7 @@
fetchPypi,
flit,
pytest-aiohttp,
pytest-cov-stub,
pytestCheckHook,
pythonOlder,
typing-extensions,
@ -29,14 +30,10 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytest-aiohttp
pytest-cov-stub
pytestCheckHook
];
postPatch = ''
substituteInPlace setup.cfg \
--replace " --no-cov-on-fail --cov-branch --cov=aiohttp_remotes --cov-report=term --cov-report=html" ""
'';
pythonImportsCheck = [ "aiohttp_remotes" ];
pytestFlagsArray = [

View File

@ -11,6 +11,7 @@
packageurl-python,
pydantic,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
rich,
semver,
@ -32,11 +33,6 @@ buildPythonPackage rec {
hash = "sha256-lgt609UDuHTGQTTrpvxNvgUk6GU+TYqwc19dzatI4Io=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail " --cov-report=term-missing --no-cov-on-fail --cov vdb" ""
'';
pythonRelaxDeps = [
"msgpack"
"semver"
@ -59,7 +55,10 @@ buildPythonPackage rec {
tabulate
] ++ httpx.optional-dependencies.http2;
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
preCheck = ''
export HOME=$(mktemp -d);

View File

@ -7,6 +7,7 @@
httpx,
numpy,
pytest-asyncio,
pytest-cov-stub,
pytestCheckHook,
python-dateutil,
pythonOlder,
@ -31,10 +32,6 @@ buildPythonPackage rec {
hash = "sha256-CUnUz2SsXtWaqGzaB1PH+EoHqebSue6e8GXhRZRcXLs=";
};
postPatch = ''
sed -i -e "/--cov/d" -e "/--no-cov/d" pyproject.toml
'';
build-system = [ hatchling ];
dependencies = [
@ -61,6 +58,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytest-asyncio
pytest-cov-stub
pytestCheckHook
time-machine
] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

View File

@ -5,6 +5,7 @@
poetry-core,
pydantic,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
}:
@ -22,18 +23,16 @@ buildPythonPackage rec {
hash = "sha256-CJbflRI3wfUmPoVuLwZDYcobESmySvnS99PdpSDhDLk=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail "--cov=camel_converter --cov-report term-missing --no-cov-on-fail" ""
'';
build-system = [ poetry-core ];
passthru.optional-dependencies = {
pydantic = [ pydantic ];
};
nativeCheckInputs = [ pytestCheckHook ] ++ passthru.optional-dependencies.pydantic;
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
] ++ passthru.optional-dependencies.pydantic;
pythonImportsCheck = [ "camel_converter" ];

View File

@ -8,6 +8,7 @@
redis,
pytestCheckHook,
pytest-celery,
pytest-cov-stub,
}:
buildPythonPackage rec {
@ -22,13 +23,6 @@ buildPythonPackage rec {
hash = "sha256-fHlakxxjYIADELZdxIj6rvsZ/+1QfnKvAg3w5cdzvDc=";
};
postPatch = ''
# Disable coverage reporting in tests
substituteInPlace setup.cfg \
--replace "--cov" "" \
--replace "--no-cov-on-fail" ""
'';
patches = [
# chore(poetry): use poetry-core
# https://github.com/steinitzu/celery-singleton/pull/54
@ -49,6 +43,7 @@ buildPythonPackage rec {
checkInputs = [
pytestCheckHook
pytest-celery
pytest-cov-stub
];
pytestFlagsArray = [ "tests" ];

View File

@ -6,6 +6,7 @@
django,
django-stubs,
pytestCheckHook,
pytest-cov-stub,
pytest-django,
parameterized,
}:
@ -25,14 +26,6 @@ buildPythonPackage {
hash = "sha256-zFY8YsM1Qp6rdcb+Upfk0/6mTv0o1zwxGqKzTupZ1zI=";
};
# Remove all references to pytest-cov
postPatch = ''
substituteInPlace pytest.ini \
--replace "--no-cov-on-fail" "" \
--replace "--cov-report=\"\"" "" \
--replace "--cov modeltranslation" ""
'';
disabled = pythonOlder "3.6";
propagatedBuildInputs = [ django ];
@ -40,6 +33,7 @@ buildPythonPackage {
nativeCheckInputs = [
django-stubs
pytestCheckHook
pytest-cov-stub
pytest-django
parameterized
];

View File

@ -3,6 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
setuptools,
}:
@ -23,12 +24,10 @@ buildPythonPackage rec {
nativeBuildInputs = [ setuptools ];
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace tox.ini \
--replace " --cov=entry_points_txt --no-cov-on-fail" ""
'';
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "entry_points_txt" ];

View File

@ -3,6 +3,7 @@
buildPythonPackage,
fetchFromGitHub,
pytestCheckHook,
pytest-cov-stub,
lxml,
lxml-html-clean,
}:
@ -24,13 +25,10 @@ buildPythonPackage rec {
lxml-html-clean
];
nativeCheckInputs = [ pytestCheckHook ];
# patch out coverage report
postPatch = ''
substituteInPlace setup.cfg \
--replace-fail " --cov=justext --cov-report=term-missing --no-cov-on-fail" ""
'';
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "justext" ];

View File

@ -6,6 +6,7 @@
fetchFromGitHub,
ply,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
setuptools,
}:
@ -26,7 +27,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace '--doctest-modules --doctest-glob="test_*.rst" --cov=luqum --cov-branch --cov-report html --no-cov-on-fail' ""
--replace '--doctest-modules --doctest-glob="test_*.rst"' ""
'';
nativeBuildInputs = [ setuptools ];
@ -37,6 +38,7 @@ buildPythonPackage rec {
elastic-transport
elasticsearch-dsl
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "luqum" ];

View File

@ -11,6 +11,7 @@
openssl,
paramiko,
pytest-asyncio,
pytest-cov-stub,
pytest-mock,
pytest-xdist,
pytestCheckHook,
@ -37,10 +38,6 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace Makefile \
--replace "SHELL := /bin/bash" "SHELL := ${bash}/bin/bash"
substituteInPlace pytest.ini \
--replace-fail "-p pytest_cov" "" \
--replace-fail "--no-cov-on-fail" ""
sed -i "/--cov/d" pytest.ini
'';
build-system = [ setuptools-scm ];
@ -58,6 +55,7 @@ buildPythonPackage rec {
hyperframe
openssl
pytest-asyncio
pytest-cov-stub
pytest-mock
pytest-xdist
pytestCheckHook

View File

@ -6,6 +6,7 @@
ghostscript,
pillow,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
}:
@ -23,7 +24,7 @@ buildPythonPackage rec {
postPatch = ''
substituteInPlace pyproject.toml \
--replace "--isort --flake8 --cov --no-cov-on-fail" ""
--replace "--isort --flake8" ""
'';
nativeBuildInputs = [ flit-core ];
@ -32,6 +33,7 @@ buildPythonPackage rec {
ghostscript
pillow
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "pydyf" ];

View File

@ -5,6 +5,7 @@
hypothesis,
pythonOlder,
pytestCheckHook,
pytest-cov-stub,
}:
buildPythonPackage rec {
@ -19,14 +20,10 @@ buildPythonPackage rec {
sha256 = "06fm9rn31cb4b61hzy63cnwfjpppgyy517k8a04gzcv9g60n7xbh";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "--cov pyisbn --cov-report term-missing --no-cov-on-fail" ""
'';
nativeCheckInputs = [
hypothesis
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "pyisbn" ];

View File

@ -14,6 +14,7 @@
# tests
pytestCheckHook,
pytest-asyncio,
pytest-cov-stub,
}:
buildPythonPackage rec {
@ -30,11 +31,6 @@ buildPythonPackage rec {
nativeBuildInputs = [ poetry-core ];
postPatch = ''
substituteInPlace pyproject.toml \
--replace "--no-cov-on-fail " ""
'';
propagatedBuildInputs = [ quart ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ];
pythonImportsCheck = [ "quart_cors" ];
@ -42,6 +38,7 @@ buildPythonPackage rec {
nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
pytest-cov-stub
];
meta = with lib; {

View File

@ -4,6 +4,7 @@
fetchFromGitHub,
fetchpatch,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
setuptools,
wheel,
@ -36,12 +37,10 @@ buildPythonPackage rec {
wheel
];
nativeCheckInputs = [ pytestCheckHook ];
postPatch = ''
substituteInPlace tox.ini \
--replace " --cov=wheel_filename --no-cov-on-fail" ""
'';
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
pythonImportsCheck = [ "wheel_filename" ];

View File

@ -9,6 +9,7 @@
jsonschema,
packaging,
pytestCheckHook,
pytest-cov-stub,
pythonOlder,
readme-renderer,
setuptools,
@ -29,11 +30,6 @@ buildPythonPackage rec {
hash = "sha256-pB9Rh+A7GlxnYuka2mTSBoxpoyYCzoaMPVgsHDlpos0=";
};
postPatch = ''
substituteInPlace tox.ini \
--replace-fail "--cov=wheel_inspect --no-cov-on-fail" ""
'';
pythonRelaxDeps = [
"entry-points-txt"
"headerparser"
@ -52,7 +48,10 @@ buildPythonPackage rec {
wheel-filename
];
nativeCheckInputs = [ pytestCheckHook ];
nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
];
checkInputs = [
setuptools