From a07dcb2d18a27397498ce14d7cb0e429a2784532 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:41:13 +0200 Subject: [PATCH 1/9] chore: Updates pytest --- pyproject.toml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 853053a..bb76a79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Artificial Intelligence", @@ -42,13 +43,15 @@ dependencies = [ [project.optional-dependencies] test = [ - "pytest>=5.3.2", - "coverage[toml]>=4.5.4", "requests>=2.20.0,<3.0.0", "torchvision>=0.15.0,<1.0.0", + "pytest>=7.3.2", + "pytest-cov>=3.0.0,<5.0.0", + "pytest-xdist>=2.0.0,<4.0.0", + "pytest-pretty>=1.0.0,<2.0.0", ] quality = [ - "ruff>=0.0.290,<1.0.0", + "ruff==0.1.0", "mypy==1.4.1", "black==23.3.0", "bandit[toml]>=1.7.0,<1.8.0", @@ -71,12 +74,14 @@ demo = [ ] dev = [ # test - "pytest>=5.3.2", - "coverage[toml]>=4.5.4", "requests>=2.20.0,<3.0.0", "torchvision>=0.15.0,<1.0.0", + "pytest>=7.3.2", + "pytest-cov>=4.0.0,<5.0.0", + "pytest-xdist>=3.0.0,<4.0.0", + "pytest-pretty>=1.0.0,<2.0.0", # style - "ruff>=0.0.290,<1.0.0", + "ruff==0.1.0", "mypy==1.4.1", "black==23.3.0", "bandit[toml]>=1.7.0,<1.8.0", @@ -103,8 +108,8 @@ zip-safe = true [tool.setuptools.packages.find] exclude = ["demo*", "docs*", "notebooks*", "scripts*", "tests*"] -[tool.coverage.run] -source = ["torchcam"] +[tool.pytest.ini_options] +testpaths = ["torchcam/"] [tool.ruff] select = [ From b784ed0a34a699fc8fea0bc55bffaf50a0a09ff1 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:41:28 +0200 Subject: [PATCH 2/9] docs: Updates makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index aff274c..3daffc6 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ style: # Run tests for the library test: - coverage run -m pytest tests/ + pytest --cov=torchcam tests/ -n auto # Build documentation for current version single-docs: From c76a0a998ae9ce2aefe6202bd07656f958eba335 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:42:58 +0200 Subject: [PATCH 3/9] ci: Updates CI --- .github/workflows/tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f783baa..73102fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,9 +32,7 @@ jobs: python -m pip install --upgrade pip pip install -e ".[test]" --upgrade - name: Run unittests - run: | - coverage run -m pytest tests/ - coverage xml + run: pytest --cov=torchcam --cov-report xml tests/ -n auto - uses: actions/upload-artifact@v2 with: name: coverage-main From 8e7aebeaea23c75e7f768857ef85ab0c838dd936 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:48:41 +0200 Subject: [PATCH 4/9] ci: Updates codecov upload --- .github/workflows/tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73102fa..bf45567 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,11 +42,10 @@ jobs: runs-on: ubuntu-latest needs: pytest steps: - - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v3 with: + token: ${{ secrets.CODECOV_TOKEN }} flags: unittests fail_ci_if_error: true From fcdadcc704075322abea729b250df279bdbee4fb Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:03:18 +0200 Subject: [PATCH 5/9] ci: Adds multiple builds --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 459e9c9..eb95176 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: [3.8, 3.9] + python: [3.8, 3.9, 3.10, 3.11, 3.12] steps: - uses: actions/checkout@v2 - name: Set up Python From 85ed84767288be96c3784553667d880fb530c9b5 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:05:16 +0200 Subject: [PATCH 6/9] ci: Fixes CI version --- .github/workflows/style.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 3760d45..32067bb 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -22,7 +22,7 @@ jobs: architecture: x64 - name: Run ruff run: | - pip install ruff + pip install ruff==0.1.0 ruff --version ruff check --diff . @@ -47,8 +47,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e . --upgrade - pip install "mypy==1.4.1" + pip install -e ".[quality]" --upgrade - name: Run mypy run: | mypy --version From aa4fdf9267bf9a9a809768de89e2869a4842f2a3 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:05:33 +0200 Subject: [PATCH 7/9] style: Bumps mypy --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bb76a79..b982655 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ test = [ ] quality = [ "ruff==0.1.0", - "mypy==1.4.1", + "mypy==1.5.1", "black==23.3.0", "bandit[toml]>=1.7.0,<1.8.0", "pre-commit>=2.17.0,<3.0.0", @@ -82,7 +82,7 @@ dev = [ "pytest-pretty>=1.0.0,<2.0.0", # style "ruff==0.1.0", - "mypy==1.4.1", + "mypy==1.5.1", "black==23.3.0", "bandit[toml]>=1.7.0,<1.8.0", "pre-commit>=2.17.0,<3.0.0", From 9f39b5c70a23a34174961c958a1a9b29c6fe7673 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:10:45 +0200 Subject: [PATCH 8/9] chore: Python 3.12 isn't supported yet --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b982655..b5e52f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Artificial Intelligence", From 83b741c9e0f92c60e8e42c9d42a3a300a427d259 Mon Sep 17 00:00:00 2001 From: F-G Fernandez <26927750+frgfm@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:11:23 +0200 Subject: [PATCH 9/9] ci: Reverts back --- .github/workflows/builds.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index eb95176..459e9c9 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -13,7 +13,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: [3.8, 3.9, 3.10, 3.11, 3.12] + python: [3.8, 3.9] steps: - uses: actions/checkout@v2 - name: Set up Python