Unverified Commit f05d8cbe authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

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

 treewide: migrate to pytest-cov-stub
parents 129f579c 61b51ff3
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -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 = [
+5 −6
Original line number Diff line number Diff line
@@ -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);
+2 −4
Original line number Diff line number Diff line
@@ -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);
+5 −6
Original line number Diff line number Diff line
@@ -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" ];

+2 −7
Original line number Diff line number Diff line
@@ -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" ];
Loading