Skip to content

Commit

Permalink
ci: fix coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
15r10nk committed Feb 10, 2024
1 parent 7f5a0d5 commit 4c1dfbc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- name: Combine data
env:
TOP: ${{github.workspace}}
COVERAGE_PROCESS_START: ${{github.workspace}}/pyproject.toml
run: |
pip install coverage
coverage combine
Expand Down Expand Up @@ -71,6 +72,7 @@ jobs:
- name: Combine data
env:
TOP: ${{github.workspace}}
COVERAGE_PROCESS_START: ${{github.workspace}}/pyproject.toml
run: |
# i have problems to combine windows coverage files with linux coverage files
rm .coverage.*.windows-latest
Expand Down
21 changes: 17 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,40 +82,53 @@ dependencies = [
"astunparse"
]

# all
[tool.hatch.envs.all]
dependencies = [
"coverage[toml]>=6.5",
"coverage-enable-subprocess",
"pytest",
"inline-snapshot",
"astunparse",
"astunparse",
"mypy",
]
env-vars.TOP = "{root}"
scripts.test-cov = "coverage run -m pytest {args:tests}"
scripts.test = "pytest {args:tests}"
scripts.test-mypy = "mypy src tests"


[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

# coverage
[tool.hatch.envs.all-cov]
template="all"
extra-dependencies = [
"coverage[toml]>=6.5",
"coverage-enable-subprocess",
]
env-vars.TOP = "{root}"
scripts.test = "coverage run -m pytest {args:tests}"

[[tool.hatch.envs.all-cov.matrix]]
python = ["3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.cov]
dependencies = ["coverage[toml]>=6.5"]
detached = true
env-vars.TOP = "{root}"
env-vars.COVERAGE_PROCESS_START = "{root}/pyproject.toml"
scripts.all = [
"- coverage erase",
"hatch run all:test-cov -- {args}",
"hatch run all-cov:test -- {args}",
"coverage combine",
"coverage html",
"coverage report --fail-under 100 "
]

scripts.one = [
"- coverage erase",
"hatch run +py=3.12 all:test-cov -- {args}",
"hatch run +py=3.12 all-cov:test -- {args}",
"coverage combine",
"coverage html",
"coverage report --fail-under 100 "
Expand Down

0 comments on commit 4c1dfbc

Please sign in to comment.