Skip to content

Commit 9e48eef

Browse files
Lee-Wbearomorphism
authored andcommitted
test: upgrade min pytest to 9 and use native toml configuration
1 parent de5c7a9 commit 9e48eef

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,63 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11+
detect_changes:
12+
runs-on: ubuntu-latest
13+
outputs:
14+
relevant: ${{ steps.filter.outputs.relevant }}
15+
steps:
16+
- uses: actions/checkout@v6
17+
with:
18+
fetch-depth: 0
19+
- id: filter
20+
uses: dorny/paths-filter@v3
21+
with:
22+
filters: |
23+
relevant:
24+
- "commitizen/**"
25+
- "tests/**"
26+
- ".github/workflows/**"
1127
python-check:
28+
needs: detect_changes
1229
strategy:
1330
matrix:
1431
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1532
platform: [ubuntu-22.04, macos-latest, windows-latest]
1633
runs-on: ${{ matrix.platform }}
1734
steps:
35+
- name: No relevant changes, fast-path success
36+
if: ${{ needs.detect_changes.outputs.relevant != 'true' }}
37+
run: echo "No relevant file changes; skipping tests and linters."
38+
1839
- uses: actions/checkout@v6
40+
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
1941
with:
2042
fetch-depth: 0
2143
- name: Set up Python ${{ matrix.python-version }}
2244
uses: astral-sh/setup-uv@v7
45+
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
2346
with:
2447
python-version: ${{ matrix.python-version }}
2548
- name: Install dependencies
49+
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
2650
run: |
2751
uv --version
2852
uv sync --frozen --group base --group test --group linters
2953
- name: Run tests and linters
54+
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
3055
run: |
3156
git config --global user.email "action@github.com"
3257
git config --global user.name "GitHub Action"
3358
uv run --no-sync poe ci
3459
shell: bash
3560
- name: Upload coverage to Codecov
3661
uses: codecov/codecov-action@v5
62+
if: ${{ needs.detect_changes.outputs.relevant == 'true' }}
3763
with:
3864
token: ${{ secrets.CODECOV_TOKEN }}
3965
- name: Upload test results to Codecov
4066
uses: codecov/codecov-action@v5
41-
if: ${{ !cancelled() }}
67+
if: ${{ needs.detect_changes.outputs.relevant == 'true' && !cancelled() }}
4268
with:
4369
token: ${{ secrets.CODECOV_TOKEN }}
4470
report_type: test_results

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ dev = [
100100
base = ["poethepoet>=0.34.0"]
101101

102102
test = [
103-
"pytest>=7.2",
103+
"pytest>=9",
104104
"pytest-cov>=4",
105105
"pytest-mock>=3.10",
106106
"pytest-regressions>=2.4.0",
@@ -177,8 +177,8 @@ omit = [
177177
]
178178

179179

180-
[tool.pytest.ini_options]
181-
addopts = "--strict-markers"
180+
[tool.pytest]
181+
addopts = ["--strict-markers"]
182182
testpaths = ["tests/"]
183183
filterwarnings = [
184184
# get_smart_tag_range is deprecated and will be removed in v5

uv.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)