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

ci: use uv #805

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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.os != 'windows-latest' || 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.os != 'windows-latest' || matrix.python-version != '3.7'
run: uv pip install --system .
- name: Install Nox-under-test (pip)
if: matrix.os == 'windows-latest' && 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
Loading