Skip to content

Commit 44f95b6

Browse files
committedJan 13, 2025··
Add 3.13 and run via uv in CI.
1 parent 20e91ef commit 44f95b6

File tree

3 files changed

+45
-46
lines changed

3 files changed

+45
-46
lines changed
 

Diff for: ‎.github/workflows/ci.yml

+27-32
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,37 @@ name: CI
22

33
on:
44
push:
5+
branches-ignore:
6+
- "wip*"
7+
tags:
8+
- "v*"
59
pull_request:
6-
release:
7-
types: [published]
810
schedule:
911
# Daily at 3:11
1012
- cron: "11 3 * * *"
11-
12-
env:
13-
PIP_DISABLE_PIP_VERSION_CHECK: "1"
14-
PIP_NO_PYTHON_VERSION_WARNING: "1"
13+
workflow_dispatch:
1514

1615
jobs:
17-
pre-commit:
18-
runs-on: ubuntu-latest
19-
steps:
20-
- uses: actions/checkout@v4
21-
- uses: actions/setup-python@v5
22-
with:
23-
python-version: "3.x"
24-
- uses: pre-commit/action@v3.0.1
25-
2616
list:
2717
runs-on: ubuntu-latest
2818
outputs:
2919
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
3020
steps:
3121
- uses: actions/checkout@v4
32-
- name: Set up nox
33-
uses: wntrblm/nox@2024.10.09
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
enable-cache: true
3426
- id: noxenvs-matrix
3527
run: |
3628
echo >>$GITHUB_OUTPUT noxenvs=$(
37-
nox --list-sessions --json | jq '[.[].session]'
29+
uvx nox --list-sessions --json | jq '[.[].session]'
3830
)
3931
4032
ci:
4133
needs: list
4234
runs-on: ${{ matrix.os }}
35+
4336
strategy:
4437
fail-fast: false
4538
matrix:
@@ -60,38 +53,40 @@ jobs:
6053
uses: actions/setup-python@v5
6154
with:
6255
python-version: |
63-
3.8
64-
3.9
65-
3.10
6656
3.11
6757
3.12
68-
pypy3.10
58+
3.13
6959
allow-prereleases: true
70-
- name: Set up nox
71-
uses: wntrblm/nox@2024.10.09
60+
61+
- name: Set up uv
62+
uses: astral-sh/setup-uv@v5
63+
with:
64+
enable-cache: true
65+
7266
- name: Run nox
73-
run: nox -s "${{ matrix.noxenv }}"
67+
run: uvx nox -s "${{ matrix.noxenv }}"
7468

7569
packaging:
7670
needs: ci
7771
runs-on: ubuntu-latest
7872
environment:
7973
name: PyPI
8074
url: https://pypi.org/p/sphinx-json-schema-spec
75+
8176
permissions:
8277
contents: write
8378
id-token: write
8479

8580
steps:
8681
- uses: actions/checkout@v4
87-
- name: Set up Python
88-
uses: actions/setup-python@v5
82+
- name: Set up uv
83+
uses: astral-sh/setup-uv@v5
8984
with:
90-
python-version: "3.x"
91-
- name: Install dependencies
92-
run: python -m pip install build
93-
- name: Create packages
94-
run: python -m build .
85+
enable-cache: true
86+
87+
- name: Build our distributions
88+
run: uv run --with 'build[uv]' -m build --installer=uv
89+
9590
- name: Publish to PyPI
9691
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
9792
uses: pypa/gh-action-pypi-publish@release/v1

Diff for: ‎noxfile.py

+17-14
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
docs=DOCS / "requirements.txt",
1313
)
1414
REQUIREMENTS_IN = [ # this is actually ordered, as files depend on each other
15-
path.parent / f"{path.stem}.in" for path in REQUIREMENTS.values()
15+
(path.parent / f"{path.stem}.in", path) for path in REQUIREMENTS.values()
1616
]
1717

18-
SUPPORTED = ["3.11", "3.12"]
19-
LATEST = "3.12"
18+
SUPPORTED = ["3.11", "3.12", "3.13"]
19+
LATEST = SUPPORTED[-1]
2020

21+
nox.options.default_venv_backend = "uv|virtualenv"
2122
nox.options.sessions = []
2223

2324

@@ -130,15 +131,17 @@ def docs_style(session):
130131
@session(default=False)
131132
def requirements(session):
132133
"""
133-
Update the project's pinned requirements. Commit the result.
134+
Update the project's pinned requirements.
135+
136+
You should commit the result afterwards.
134137
"""
135-
session.install("pip-tools")
136-
for each in REQUIREMENTS_IN:
137-
session.run(
138-
"pip-compile",
139-
"--resolver",
140-
"backtracking",
141-
"--strip-extras",
142-
"-U",
143-
each.relative_to(ROOT),
144-
)
138+
if session.venv_backend == "uv":
139+
cmd = ["uv", "pip", "compile"]
140+
else:
141+
session.install("pip-tools")
142+
cmd = ["pip-compile", "--resolver", "backtracking", "--strip-extras"]
143+
144+
for each, out in REQUIREMENTS_IN:
145+
# otherwise output files end up with silly absolute path comments...
146+
relative = each.relative_to(ROOT)
147+
session.run(*cmd, "--upgrade", "--output-file", out, relative)

Diff for: ‎pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ classifiers = [
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3.11",
2525
"Programming Language :: Python :: 3.12",
26+
"Programming Language :: Python :: 3.13",
2627
"Programming Language :: Python :: Implementation :: CPython",
2728
"Programming Language :: Python :: Implementation :: PyPy",
2829
"Framework :: Sphinx :: Extension",

0 commit comments

Comments
 (0)
Please sign in to comment.