From 24330b0ffb0f00138de76094287734ed97346827 Mon Sep 17 00:00:00 2001 From: Domenico DiNicola Date: Mon, 30 Dec 2024 18:32:11 -0600 Subject: [PATCH] coverage --- .github/workflows/test.yml | 11 ++--------- pyproject.toml | 4 +--- tox.ini | 5 +---- uv.lock | 26 ++------------------------ 4 files changed, 6 insertions(+), 40 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c0845a1..9a8c6ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -90,14 +90,7 @@ jobs: - name: Test if: needs.changes.outputs.run_tests run: | - uv run pytest tests --create-db --junit-xml junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results-${{ matrix.python-version }}-${{matrix.django-version}} - path: junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml - if: ${{ always() }} + uv run pytest tests --cov-report=xml --cov-report xml:coverage.xml --junit-xml junit-${{ matrix.python-version }}-${{matrix.django-version}}.xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 @@ -108,5 +101,5 @@ jobs: fail_ci_if_error: true files: coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - verbose: false + verbose: true name: codecov-${{env.GITHUB_REF_NAME}} diff --git a/pyproject.toml b/pyproject.toml index bdd6aa1..53f1f1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,9 +30,6 @@ dependencies = [ "PyJWT", "requests", "social-auth-app-django", - "setuptools", - "wheel", - "pre-commit>=4.0.1", ] [tool.uv] @@ -49,6 +46,7 @@ dev-dependencies = [ "pytest-django", "pytest-echo", "pytest-factoryboy", + "pre-commit", "requests-mock", "responses", "tox", diff --git a/tox.ini b/tox.ini index 390403d..de8280c 100644 --- a/tox.ini +++ b/tox.ini @@ -15,10 +15,9 @@ addopts = --tb=short --capture=no --reuse-db - --cov-report=html - --cov-report=term --cov-config=tests/.coveragerc --cov=unicef_security + --cov-report=html --echo-version django --echo-version unicef_security @@ -44,7 +43,5 @@ commands = pytest tests \ -q \ --create-db \ - --cov-report=html \ - --cov-report=term \ --cov-config={toxinidir}/tests/.coveragerc \ --cov=unicef_security diff --git a/uv.lock b/uv.lock index e6af63c..5dcc1bd 100644 --- a/uv.lock +++ b/uv.lock @@ -924,15 +924,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/12/24/93293d0be0db9da1ed8dfc5e6af700fdd40e8f10a928704dd179db9f03c1/responses-0.25.3-py3-none-any.whl", hash = "sha256:521efcbc82081ab8daa588e08f7e8a64ce79b91c39f6e62199b19159bea7dbcb", size = 55238 }, ] -[[package]] -name = "setuptools" -version = "75.3.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ed/22/a438e0caa4576f8c383fa4d35f1cc01655a46c75be358960d815bfbb12bd/setuptools-75.3.0.tar.gz", hash = "sha256:fba5dd4d766e97be1b1681d98712680ae8f2f26d7881245f2ce9e40714f1a686", size = 1351577 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/90/12/282ee9bce8b58130cb762fbc9beabd531549952cac11fc56add11dcb7ea0/setuptools-75.3.0-py3-none-any.whl", hash = "sha256:f2504966861356aa38616760c0f66568e535562374995367b4e69c7143cf6bcd", size = 1251070 }, -] - [[package]] name = "six" version = "1.16.0" @@ -1053,12 +1044,9 @@ dependencies = [ { name = "django-constance" }, { name = "django-countries" }, { name = "django-picklefield" }, - { name = "pre-commit" }, { name = "pyjwt" }, { name = "requests" }, - { name = "setuptools" }, { name = "social-auth-app-django" }, - { name = "wheel" }, ] [package.dev-dependencies] @@ -1070,6 +1058,7 @@ dev = [ { name = "httpretty" }, { name = "isort" }, { name = "mock" }, + { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-cov" }, { name = "pytest-django" }, @@ -1091,12 +1080,9 @@ requires-dist = [ { name = "django-constance" }, { name = "django-countries" }, { name = "django-picklefield" }, - { name = "pre-commit", specifier = ">=4.0.1" }, { name = "pyjwt" }, { name = "requests" }, - { name = "setuptools" }, { name = "social-auth-app-django" }, - { name = "wheel" }, ] [package.metadata.requires-dev] @@ -1108,6 +1094,7 @@ dev = [ { name = "httpretty" }, { name = "isort" }, { name = "mock" }, + { name = "pre-commit" }, { name = "pytest" }, { name = "pytest-cov" }, { name = "pytest-django" }, @@ -1225,15 +1212,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2b/6d/075023456a2ff8e01ef07afa069563f0d1e1a2fd359d7dbd7672a5bf218a/WebTest-3.0.1-py3-none-any.whl", hash = "sha256:b3bc75d020d0576ee93a5f149666045e58fe2400ea5f0c214d7430d7d213d0d0", size = 32154 }, ] -[[package]] -name = "wheel" -version = "0.44.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b7/a0/95e9e962c5fd9da11c1e28aa4c0d8210ab277b1ada951d2aee336b505813/wheel-0.44.0.tar.gz", hash = "sha256:a29c3f2817e95ab89aa4660681ad547c0e9547f20e75b0562fe7723c9a2a9d49", size = 100733 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/1b/d1/9babe2ccaecff775992753d8686970b1e2755d21c8a63be73aba7a4e7d77/wheel-0.44.0-py3-none-any.whl", hash = "sha256:2376a90c98cc337d18623527a97c31797bd02bad0033d41547043a1cbfbe448f", size = 67059 }, -] - [[package]] name = "wrapt" version = "1.16.0"