From 9dd9d7a66c6994c4c1b8a2f852cd10ba4781c040 Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 05:11:53 +0100 Subject: [PATCH 1/3] switch to hatch test subcommand --- .github/workflows/Tests.yaml | 6 +++--- pyproject.toml | 20 +++----------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/Tests.yaml b/.github/workflows/Tests.yaml index 951247c..a449d7c 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 787838f..50bf285 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,24 +37,10 @@ lambda-repl = "lambda_repl.main:main_cli" 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] From a97b1a812bc85fbf1db502b6d53d3518e069592e Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 05:13:42 +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 a449d7c..27eaf2f 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 50bf285..891b7e5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,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 842fa3196bfc2f6c352c645b1d110f0a0c54c587 Mon Sep 17 00:00:00 2001 From: Eric Wolf Date: Wed, 20 Nov 2024 05:14:27 +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 27eaf2f..82fab7c 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"