Skip to content

Commit 956bb71

Browse files
set python version in nox sessions when syncing uv (#138)
1 parent 0ae72c8 commit 956bb71

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ concurrency:
1313
env:
1414
PYTHONUNBUFFERED: "1"
1515
FORCE_COLOR: "1"
16-
PY_MAX_VERSION: "3.13"
17-
PY_MIN_VERSION: "3.9"
1816
UV_VERSION: "0.4.x"
1917

2018
jobs:
@@ -31,9 +29,6 @@ jobs:
3129
enable-cache: true
3230
version: ${{ env.UV_VERSION }}
3331

34-
- name: Install Python
35-
run: uv python install ${{ env.PY_MIN_VERSION }}
36-
3732
- id: set-matrix
3833
run: |
3934
uv run nox --session "gha_matrix"
@@ -54,9 +49,6 @@ jobs:
5449
enable-cache: true
5550
version: ${{ env.UV_VERSION }}
5651

57-
- name: Install Python
58-
run: uv python install ${{ matrix.python-version }}
59-
6052
- name: Run tests
6153
run: |
6254
uv run nox --session "tests(python='${{ matrix.python-version }}', django='${{ matrix.django-version }}')"
@@ -77,16 +69,14 @@ jobs:
7769
runs-on: ubuntu-latest
7870
steps:
7971
- uses: actions/checkout@v4
72+
8073
- name: Install uv
8174
uses: astral-sh/setup-uv@v3
8275
with:
8376
enable-cache: true
8477
version: ${{ env.UV_VERSION }}
8578

86-
- name: Install Python
87-
run: uv python install ${{ env.PY_MAX_VERSION }}
88-
89-
- name: Run mypy
79+
- name: Run type checks
9080
run: |
9181
uv run nox --session "types"
9282
@@ -101,9 +91,6 @@ jobs:
10191
enable-cache: true
10292
version: ${{ env.UV_VERSION }}
10393

104-
- name: Install Python
105-
run: uv python install ${{ env.PY_MIN_VERSION }}
106-
107-
- name: Run mypy
94+
- name: Generate code coverage
10895
run: |
10996
uv run nox --session "coverage"

noxfile.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ def tests(session, django):
7171
session.run_install(
7272
"uv",
7373
"sync",
74-
"--frozen",
7574
"--extra",
7675
"tests",
76+
"--frozen",
7777
"--inexact",
7878
"--no-install-package",
7979
"django",
80+
"--python",
81+
session.python,
8082
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
8183
)
8284

@@ -98,9 +100,11 @@ def coverage(session):
98100
session.run_install(
99101
"uv",
100102
"sync",
101-
"--frozen",
102103
"--extra",
103104
"tests",
105+
"--frozen",
106+
"--python",
107+
PY_LATEST,
104108
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
105109
)
106110

@@ -129,9 +133,11 @@ def types(session):
129133
session.run_install(
130134
"uv",
131135
"sync",
132-
"--frozen",
133136
"--extra",
134137
"types",
138+
"--frozen",
139+
"--python",
140+
PY_LATEST,
135141
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
136142
)
137143
command = ["python", "-m", "mypy", "."]
@@ -145,9 +151,11 @@ def demo(session):
145151
session.run_install(
146152
"uv",
147153
"sync",
148-
"--frozen",
149154
"--extra",
150155
"types",
156+
"--frozen",
157+
"--python",
158+
PY_DEFAULT,
151159
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
152160
)
153161

0 commit comments

Comments
 (0)