Skip to content

Commit

Permalink
ci: use uv (#805)
Browse files Browse the repository at this point in the history
* ci: use uv

Signed-off-by: Henry Schreiner <[email protected]>

* chore: drop uv from 3.7 jobs

Signed-off-by: Henry Schreiner <[email protected]>

---------

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Apr 2, 2024
1 parent 48f82a1 commit 956f10c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
Expand All @@ -26,16 +27,22 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup uv
uses: yezz123/setup-uv@v4
if: matrix.python-version != '3.7'
- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
use-mamba: true
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
- name: Install Nox-under-test (uv)
if: matrix.python-version != '3.7'
run: uv pip install --system .
- name: Install Nox-under-test (pip)
if: matrix.python-version == '3.7'
run: python -m pip install --disable-pip-version-check .
- name: Run tests on ${{ matrix.os }} (tox <4)
run: nox --non-interactive --error-on-missing-interpreter --session "tests(python='${{ matrix.python-version }}', tox_version='<4')" -- --full-trace
- name: Run tox-to-nox tests on ${{ matrix.os }} (tox latest)
Expand All @@ -56,9 +63,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup uv
uses: yezz123/setup-uv@v4
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
run: uv pip install --system .
- name: Download individual coverage reports
uses: actions/download-artifact@v4
with:
Expand All @@ -78,8 +86,7 @@ jobs:
with:
python-version: 3.9
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
run: python -m pip install --disable-pip-version-check .
- name: Lint
run: nox --non-interactive --error-on-missing-interpreter --session "lint"
docs:
Expand All @@ -90,9 +97,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Setup uv
uses: yezz123/setup-uv@v4
- name: Install Nox-under-test
run: |
python -m pip install --disable-pip-version-check .
run: uv pip install --system .
- name: Docs
run: nox --non-interactive --error-on-missing-interpreter --session "docs"
deploy:
Expand Down
5 changes: 4 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

ON_WINDOWS_CI = "CI" in os.environ and platform.system() == "Windows"

nox.needs_version = ">=2024.3.2"
nox.options.default_venv_backend = "uv|virtualenv"

# Skip 'conda_tests' if user doesn't have conda installed
nox.options.sessions = ["tests", "cover", "lint", "docs"]
if shutil.which("conda"):
Expand Down Expand Up @@ -76,7 +79,7 @@ def tests(session: nox.Session, tox_version: str) -> None:
con.execute("DELETE FROM file WHERE SUBSTR(path, 2, 1) == ':'")


@nox.session(python=["3.7", "3.8", "3.9", "3.10"], venv_backend="conda")
@nox.session(python=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"], venv_backend="conda")
def conda_tests(session: nox.Session) -> None:
"""Run test suite with pytest."""
session.create_tmp() # Fixes permission errors on Windows
Expand Down

0 comments on commit 956f10c

Please sign in to comment.