Skip to content
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
84 changes: 43 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ concurrency:
cancel-in-progress: true
jobs:
tests:
runs-on: ${{ matrix.os }}
name: ${{ (matrix.codecov == 'true' && 'Codecov') || (matrix.codspeed == 'true' && 'CodSpeed') || format('Test Python {0} {1}', matrix.python_version, ((matrix.dependencies == 'min' || matrix.dependencies == 'max') && format('{0} dependencies', matrix.dependencies)) || (matrix.os || 'ubuntu-latest')) }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
env:
PYTHONIOENCODING: utf-8
steps:
Expand All @@ -35,86 +36,87 @@ jobs:
- name: Set up uv
uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
with:
version: ${{ matrix.uv-version }}
version: ${{ matrix.uv_version || 'latest' }}
enable-cache: true

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python_version }}

- name: Bump dependencies
if: ${{ matrix.dependencies == 'max' }}
run: |
uv sync --upgrade

- name: Setup dependencies
run: |
uv python pin ${{ matrix.python-version }}
uv sync --resolution ${{ matrix.resolution }}
uv python pin ${{ matrix.python_version }}
uv sync --resolution ${{ matrix.dependencies == 'min' && 'lowest-direct' || 'highest' }}

- name: Run pre-commit
if: matrix.pre-commit
if: ${{ matrix.pre_commit == null || matrix.pre_commit == 'true' }}
run: |
uv run --frozen pre-commit run --all-files

- name: Run pytest
uses: pavelzw/pytest-action@510c5e90c360a185039bea56ce8b3e7e51a16507 # v2.2.0
if: matrix.pytest
if: ${{ matrix.pytest == null || matrix.pytest == 'true' }}
with:
custom-pytest: uv run --frozen pytest
custom-arguments: --cov --cov-report=xml --junitxml=junit.xml -o junit_family=legacy

- name: Run benchmarks
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
if: matrix.codspeed
if: ${{ matrix.codspeed != null && matrix.codspeed == 'true' }}
with:
mode: instrumentation
token: ${{ secrets.CODSPEED_TOKEN }}
run: uv run --frozen pytest --codspeed

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
if: matrix.codecov
if: ${{ matrix.codecov != null && matrix.codecov == 'true' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

- name: Upload test results to Codecov

uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
if: matrix.codecov && !cancelled()
if: ${{ matrix.codecov != null && matrix.codecov == 'true' && !cancelled() }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

strategy:
matrix:
python_version: ["3.10", "3.14"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
uv-version: ["latest"]
resolution: ["highest"]
codspeed: [false]
codecov: [false]
pre-commit: [true]
pytest: [true]
dependencies: ["lockfile"]
codecov: ["false"]
codspeed: ["false"]

include:
- os: "ubuntu-latest" # Minimum dependency versions
python-version: "3.10"
uv-version: "0.6.8" # Sync with pyproject.toml
resolution: "lowest-direct"
codspeed: false
codecov: false
pre-commit: false
pytest: true
- os: "ubuntu-latest" # Codecov run
python-version: "3.14"
uv-version: "latest"
resolution: "highest"
codspeed: false
codecov: true
pre-commit: false
pytest: true
- os: "ubuntu-latest" # Codspeed run
python-version: "3.13" # 3.14 support not available yet
uv-version: "latest"
resolution: "highest"
codspeed: true
codecov: false
pre-commit: false
pytest: false
- python_version: "3.11"
os: "ubuntu-latest"
- python_version: "3.12"
os: "ubuntu-latest"
- python_version: "3.13"
os: "ubuntu-latest"
- dependencies: "min"
python_version: "3.10"
uv_version: "0.6.8"
pre_commit: "false"
- dependencies: "max"
python_version: "3.14"
pre_commit: "false"
- codecov: "true"
python_version: "3.14"

pre_commit: "false"
- codspeed: "true"
python_version: "3.13"

pre_commit: "false"
pytest: "false"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ dependencies = [
"pydantic>=2.5.0",
"requests>=2.26.0",
"rich>=9.6.1",
"ruamel-yaml>=0.16.13",
"tomlkit>=0.12.0",
"ruamel-yaml>=0.16.13,!=0.18.13,!=0.18.14,!=0.18.15",
"tomlkit>=0.13.3",
"typer>=0.12.4",
"typing-extensions>=3.10.0.0",
]
Expand Down
14 changes: 7 additions & 7 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -797,11 +797,11 @@ rich==13.9.4 \
# pytest-codspeed
# typer
# usethis
ruamel-yaml==0.18.10 \
--hash=sha256:20c86ab29ac2153f80a428e1254a8adf686d3383df04490514ca3b79a362db58 \
--hash=sha256:30f22513ab2301b3d2b577adc121c6471f28734d3d9728581245f1e76468b4f1
ruamel-yaml==0.18.12 \
--hash=sha256:5a38fd5ce39d223bebb9e3a6779e86b9427a03fb0bf9f270060f8b149cffe5e2 \
--hash=sha256:790ba4c48b6a6e6b12b532a7308779eb12d2aaab3a80fdb8389216f28ea2b287
# via usethis
ruamel-yaml-clib==0.2.12 ; python_full_version < '3.13' and platform_python_implementation == 'CPython' \
ruamel-yaml-clib==0.2.12 ; python_full_version < '3.14' and platform_python_implementation == 'CPython' \
--hash=sha256:0467c5965282c62203273b838ae77c0d29d7638c8a4e3a1c8bdd3602c10904e4 \
--hash=sha256:0b7e75b4965e1d4690e93021adfcecccbca7d61c7bddd8e22406ef2ff20d74ef \
--hash=sha256:11f891336688faf5156a36293a9c362bdc7c88f03a8a027c2c1d8e0bcde998e5 \
Expand Down Expand Up @@ -915,9 +915,9 @@ tomli==2.2.1 ; python_full_version < '3.12' \
# deptry
# import-linter
# pytest
tomlkit==0.13.2 \
--hash=sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde \
--hash=sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79
tomlkit==0.13.3 \
--hash=sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1 \
--hash=sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0
# via usethis
typer==0.15.2 \
--hash=sha256:46a499c6107d645a9c13f7ee46c5d5096cae6f5fc57dd11eccbbb9ae3e44ddfc \
Expand Down
5 changes: 5 additions & 0 deletions tests/usethis/_core/test_docstyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_numpy(self, tmp_path: Path):
== """\
[lint]
select = ["D2", "D3", "D4"]

[lint.pydocstyle]
convention = "numpy"
"""
Expand All @@ -50,6 +51,7 @@ def test_google(self, tmp_path: Path, capfd: pytest.CaptureFixture[str]):
== """\
[lint]
select = ["D2", "D3", "D4"]

[lint.pydocstyle]
convention = "google"
"""
Expand Down Expand Up @@ -78,6 +80,7 @@ def test_pep257(self, tmp_path: Path):
== """\
[lint]
select = ["D2", "D3", "D4"]

[lint.pydocstyle]
convention = "pep257"
"""
Expand Down Expand Up @@ -187,9 +190,11 @@ def test_adding_ruff_afterwards_allows_default_rules(self, tmp_path: Path):
contents
== """\
line-length = 88

[lint]
select = ["D2", "D3", "D4", "A", "C4", "E4", "E7", "E9", "F", "FLY", "FURB", "I", "PLE", "PLR", "RUF", "SIM", "UP"]
ignore = ["PLR2004", "SIM108"]

[lint.pydocstyle]
convention = "numpy"

Expand Down
18 changes: 9 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.