From 35e5411fde8d90656eed59bf0275846dac0d24b8 Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 04:36:09 +0100 Subject: [PATCH 1/3] switch to hatch test subcommand --- .github/workflows/Tests.yaml | 6 +++--- pyproject.toml | 24 +++++++----------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index edf09ba..d4226d7 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -19,16 +19,16 @@ jobs: 3.12 - name: Install Hatch - run: python -m pip install hatch + run: python -m pip install "hatch >= 1.10.0" - name: Perform release check run: hatch run lint:release - name: Run tests - run: hatch run test:cov --verbose + run: hatch test --all --cover-quiet --verbose - name: Generate report - run: hatch env run -e test.py3.12 coverage xml + run: hatch env run -e hatch-test.py3.12 coverage xml - name: Upload coverage uses: codecov/codecov-action@v5 diff --git a/pyproject.toml b/pyproject.toml index 8b50559..31b67f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,24 +31,10 @@ Bugtracker = "https://github.com/Deric-W/lambda_calculus/issues" requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.envs.test] -dependencies = [ - "coverage[toml] == 7.*" -] - -[tool.hatch.envs.test.scripts] -test = "python -m unittest discover {args}" -cov-run = "coverage run -m unittest discover {args}" -cov-report = [ - "- coverage combine", - "coverage report" -] -cov = [ - "cov-run", - "cov-report" -] +[tool.hatch.envs.hatch-test] +installer = "pip" -[[tool.hatch.envs.test.matrix]] +[[tool.hatch.envs.hatch-test.matrix]] python = ["3.10", "3.11", "3.12"] [tool.hatch.envs.lint] @@ -82,6 +68,10 @@ build = "sphinx-build {args} docs docs/_build" [tool.hatch.build.targets.sdist] exclude = ["/.github"] +[tool.pytest.ini_options] +minversion = "6.0" +python_files = "test_*.py *_test.py __init__.py" + [tool.mypy] disallow_any_unimported = true disallow_any_generics = true From affb5ea9e806f1acb73c244da108f7f128f35ef7 Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 04:53:02 +0100 Subject: [PATCH 2/3] run tests on Python 3.13 --- .github/workflows/Tests.yaml | 1 + pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index d4226d7..b37cd91 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -17,6 +17,7 @@ jobs: 3.10 3.11 3.12 + 3.13 - name: Install Hatch run: python -m pip install "hatch >= 1.10.0" diff --git a/pyproject.toml b/pyproject.toml index 31b67f4..8db2239 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ build-backend = "hatchling.build" installer = "pip" [[tool.hatch.envs.hatch-test.matrix]] -python = ["3.10", "3.11", "3.12"] +python = ["3.10", "3.11", "3.12", "3.13"] [tool.hatch.envs.lint] dependencies = [ From 71d876392031410d2bb46590643608b0e3f7cda3 Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 04:53:31 +0100 Subject: [PATCH 3/3] setup pip cache for CI --- .github/workflows/Tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index b37cd91..c138aaf 100644 --- a/.github/workflows/Tests.yaml +++ b/.github/workflows/Tests.yaml @@ -18,6 +18,7 @@ jobs: 3.11 3.12 3.13 + cache: pip - name: Install Hatch run: python -m pip install "hatch >= 1.10.0"