Skip to content

Commit

Permalink
chore: Require uv be used with Nox
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Jan 31, 2025
1 parent df11728 commit 096869a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
1 change: 0 additions & 1 deletion .github/workflows/resources/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
griffe~=1.5
nox==2024.10.9
pip==25.0
pre-commit==4.1.0
twine==6.1.0
48 changes: 19 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ concurrency:

env:
FORCE_COLOR: "1"
UV_VERSION: 0.5.26

jobs:
tests:
Expand Down Expand Up @@ -69,29 +70,25 @@ jobs:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pip install pip
pip --version
- uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pipx install 'nox[uv]'
uv tool install 'nox[uv]'
nox --version
- uses: actions/cache@v4
if: matrix.session == 'tests'
with:
path: http_cache.sqlite
key: http_cache-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.sqlalchemy }}
key: http_cache-${{ runner.os }}-${{ matrix.python-version }}

- name: Run Nox
env:
PIP_PRE: "1"
UV_PRERELEASE: allow
run: |
nox --verbose
Expand All @@ -100,7 +97,7 @@ jobs:
if: always() && (matrix.session == 'tests')
with:
include-hidden-files: true
name: coverage-data-nox_-${{ matrix.os }}-py${{ matrix.python-version }}_sqlalchemy_${{ matrix.sqlalchemy }}
name: coverage-data-nox_-${{ matrix.os }}-py${{ matrix.python-version }}
path: ".coverage.*"

tests-external:
Expand All @@ -124,23 +121,19 @@ jobs:
with:
python-version: ${{ env.NOXPYTHON }}

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pip install pip
pip --version
- uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pipx install 'nox[uv]'
uv tool install 'nox[uv]'
nox --version
- name: Run Nox
env:
PIP_PRE: "1"
UV_PRERELEASE: allow
run: |
nox -- -m "external"
Expand All @@ -157,23 +150,20 @@ jobs:
with:
python-version: '3.x'

- name: Upgrade pip
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pip install pip
pip --version
- uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true

- uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}

- name: Install Nox
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/resources/requirements.txt
run: |
pipx install 'nox[uv]'
uv tool install 'nox[uv]'
nox --version
- run: nox --install-only
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import nox

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

RUFF_OVERRIDES = """\
extend = "./pyproject.toml"
Expand Down

0 comments on commit 096869a

Please sign in to comment.