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

Infra: Lint and test via uv #4102

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python 3
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: pip

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
uses: tox-dev/action-pre-commit-uv@v1

- name: Check spelling
uses: pre-commit/action@v3.0.1
uses: tox-dev/action-pre-commit-uv@v1
with:
extra_args: --all-files --hook-stage manual codespell || true
37 changes: 12 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,29 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
os:
- "windows-latest"
- "macos-latest"
- "ubuntu-latest"
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.9", os: "macos-13" }

python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [windows-latest, macos-latest, ubuntu-latest]
hugovk marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U wheel
python -m pip install -U tox
- name: Install uv
uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: |
requirements.txt

- name: Run tests
- name: Tox tests
hugovk marked this conversation as resolved.
Show resolved Hide resolved
run: |
tox -e py -- -v --cov-report term
uvx --with tox-uv tox -e py -- -v --cov-report term
hugovk marked this conversation as resolved.
Show resolved Hide resolved

- name: Upload coverage
uses: codecov/codecov-action@v4
Expand Down
Loading