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

TST: only install and invoke coverage if needed #279

Merged
merged 2 commits into from
Oct 31, 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
20 changes: 18 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,26 @@ jobs:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@3b9817b1bf26186f03ab8277bab9b827ea5cc254 # v3.2.0

- name: Build
- name: Build (without coverage)
if: matrix.os != 'ubuntu-latest'
run: uv sync --python-preference=only-system --group test --no-editable

- name: Build (with coverage)
if: matrix.os == 'ubuntu-latest'
run: uv sync --python-preference=only-system --group test --group covcheck --no-editable

- run: uv pip list
- run: uv run --no-project coverage run -m pytest --color=yes --doctest-modules

- name: Run tests (without coverage)
if: matrix.os != 'ubuntu-latest'
run: |
uv run --no-project pytest --color=yes --doctest-modules

- name: Run tests (with coverage)
if: matrix.os == 'ubuntu-latest'
run: |
uv run --no-project coverage run --parallel-mode \
-m pytest --color=yes --doctest-modules

- name: Upload coverage data
# only using reports from ubuntu because
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ known-first-party = ["inifix"]

[tool.coverage.report]
show_missing = true
skip_covered = true
skip_covered = false
exclude_lines = [
# a more strict default pragma
"\\# pragma: no cover\\b",
Expand All @@ -90,7 +90,6 @@ exclude_lines = [
omit = [
"scripts/*",
]
parallel = true

[tool.mypy]
python_version = "3.10"
Expand Down