Skip to content

Commit 69f4bd9

Browse files
authored
Merge pull request #23 from jurgenwigg/use-hatch-test
Use `hatch test` instead of `tox`
2 parents 65b9cfb + 76ce328 commit 69f4bd9

3 files changed

Lines changed: 34 additions & 36 deletions

File tree

.github/workflows/python-test.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,19 @@ name: Python Package Test
66
on: [push, pull_request]
77

88
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
python-version: ["3.11", "3.12", "3.13", "3.14"]
9+
test:
10+
runs-on: ubuntu-latest
1511

16-
steps:
17-
- uses: actions/checkout@v4
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v3
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Install dependencies
23-
run: |
24-
python -m pip install --upgrade pip tox
25-
- name: Test with tox
26-
run: |
27-
export py_ver=$( echo "${{ matrix.python-version }}" | sed 's/\.//')
28-
tox -e py${py_ver}
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v3
16+
with:
17+
# this is needed only to install hatch
18+
python-version: 3.14
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip hatch
22+
- name: Test with hatch
23+
run: |
24+
hatch test -acr

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,25 @@ check = "mypy --install-types --non-interactive {args:src/codeaudit tests}"
5959
[[tool.hatch.envs.hatch-test.matrix]]
6060
python = ["3.14", "3.13", "3.12", "3.11"]
6161

62+
[tool.hatch.envs.hatch-test]
63+
randomize = true
64+
dependencies = ["pytest", "pytest-cov", "coverage"]
65+
6266
[tool.black]
6367
target-version = ["py311", "py312", "py313", "py314"]
6468
extend-exclude ='(python2_file_willnotwork|dunderexec_with_parsing_error).py|validationfiles|suppression|spytestdir'
69+
70+
[tool.coverage.run]
71+
branch = true
72+
source = ["src/codeaudit"]
73+
74+
[tool.coverage.report]
75+
show_missing = true
76+
77+
[tool.hatch.envs.hatch-static-analysis]
78+
dependencies = ["black", "pylint"]
79+
80+
[tool.hatch.envs.hatch-static-analysis.scripts]
81+
format-check = "black --target-version py313 --check src tests"
82+
format-fix = "black --target-version py313 src tests"
83+
lint-check = "pylint src tests"

tox.ini

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)