Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use hatch test #12

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,20 @@ jobs:
3.10
3.11
3.12
3.13
cache: pip

- 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
Expand Down
26 changes: 8 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,11 @@ 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]]
python = ["3.10", "3.11", "3.12"]
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.10", "3.11", "3.12", "3.13"]

[tool.hatch.envs.lint]
dependencies = [
Expand Down Expand Up @@ -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
Expand Down