Skip to content

Commit c09cdaf

Browse files
committed
use tox for tests
1 parent a509752 commit c09cdaf

4 files changed

Lines changed: 21 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222

2323
- name: Install package and test dependencies
24-
run: pip install -e ".[dev]" pytest
24+
run: make dev
2525

2626
- name: Run tests
27-
run: pytest
27+
run: make test
2828

2929
deploy-github-release:
3030
# only deploy on tags, see https://stackoverflow.com/a/58478262/1320237

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.venv/.installed: pyproject.toml
22
python3 -m venv .venv
33
.venv/bin/pip install --quiet --upgrade pip
4-
.venv/bin/pip install --quiet -e .
5-
.venv/bin/pip install --quiet pre-commit pytest
4+
.venv/bin/pip install --quiet -e .[dev]
65
touch .venv/.installed
76

87
.PHONY: dev
@@ -12,7 +11,7 @@ dev: .venv/.installed
1211

1312
.PHONY: test
1413
test: .venv/.installed
15-
.venv/bin/pytest
14+
.venv/bin/tox -e py
1615

1716
.PHONY: clean
1817
clean:

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,12 @@ archive-ai-prompts = "ai_prompt_auto_commit.archive:main"
1717
prepare-ai-repository = "ai_prompt_auto_commit.prepare_repository:main"
1818
record-ai-prompt = "ai_prompt_auto_commit.interceptor:main"
1919

20+
[project.optional-dependencies]
21+
dev = [
22+
"pre-commit",
23+
"tox",
24+
"pytest",
25+
]
26+
2027
[tool.setuptools.package-data]
2128
ai_prompt_auto_commit = ["data/*"]

tox.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# to run for a specific environment, use ``tox -e ENVNAME``
2+
[tox]
3+
envlist = py310,py311,py312,py313,py314
4+
5+
[testenv]
6+
deps =
7+
pytest
8+
commands =
9+
pytest
10+

0 commit comments

Comments
 (0)