Skip to content

Commit da2fedd

Browse files
committed
Drop 3.8, add 3.13, enable more ruff, and use uv.
1 parent 1388b7e commit da2fedd

File tree

5 files changed

+187
-47
lines changed

5 files changed

+187
-47
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,26 @@ on:
77
tags:
88
- "v*"
99
pull_request:
10-
release:
11-
types: [published]
1210
schedule:
13-
# Daily at 7:4
11+
# Daily at 7:04
1412
- cron: "4 7 * * *"
1513
workflow_dispatch:
1614

17-
env:
18-
PIP_DISABLE_PIP_VERSION_CHECK: "1"
19-
PIP_NO_PYTHON_VERSION_WARNING: "1"
20-
2115
jobs:
2216
list:
2317
runs-on: ubuntu-latest
2418
outputs:
2519
noxenvs: ${{ steps.noxenvs-matrix.outputs.noxenvs }}
2620
steps:
2721
- uses: actions/checkout@v4
28-
- name: Set up nox
29-
uses: wntrblm/nox@2024.10.09
22+
- name: Set up uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
enable-cache: true
3026
- id: noxenvs-matrix
3127
run: |
3228
echo >>$GITHUB_OUTPUT noxenvs=$(
33-
nox --list-sessions --json | jq '[.[].session]'
29+
uvx nox --list-sessions --json | jq '[.[].session]'
3430
)
3531
3632
ci:
@@ -45,7 +41,7 @@ jobs:
4541
posargs: [""]
4642
include:
4743
- os: ubuntu-latest
48-
noxenv: "tests-3.12"
44+
noxenv: tests-3.13
4945
posargs: coverage github
5046

5147
steps:
@@ -60,49 +56,49 @@ jobs:
6056
uses: actions/setup-python@v5
6157
with:
6258
python-version: |
63-
3.8
6459
3.9
6560
3.10
6661
3.11
6762
3.12
63+
3.13
6864
pypy3.10
6965
allow-prereleases: true
70-
cache: pip
66+
7167
- name: Set up uv
72-
uses: hynek/setup-cached-uv@v2
73-
- name: Set up nox
74-
uses: wntrblm/nox@2024.10.09
68+
uses: astral-sh/setup-uv@v5
69+
with:
70+
enable-cache: true
7571

7672
- name: Run nox
77-
run: nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
73+
run: uvx nox -s "${{ matrix.noxenv }}" -- ${{ matrix.posargs }}
7874

7975
packaging:
8076
needs: ci
8177
runs-on: ubuntu-latest
8278
environment:
8379
name: PyPI
8480
url: https://pypi.org/p/referencing-loaders
81+
8582
permissions:
8683
contents: write
8784
id-token: write
8885

8986
steps:
9087
- uses: actions/checkout@v4
91-
- name: Set up Python
92-
uses: actions/setup-python@v5
88+
- name: Set up uv
89+
uses: astral-sh/setup-uv@v5
9390
with:
94-
cache: pip
95-
python-version: "3.x"
96-
- name: Install dependencies
97-
run: python -m pip install build
98-
- name: Create packages
99-
run: python -m build .
91+
enable-cache: true
92+
93+
- name: Build our distributions
94+
run: uv run --frozen --with 'build[uv]' -m build --installer=uv
95+
10096
- name: Publish to PyPI
10197
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
10298
uses: pypa/gh-action-pypi-publish@release/v1
10399
- name: Create a Release
104100
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
105-
uses: softprops/action-gh-release@v2
101+
uses: softprops/action-gh-release@v1
106102
with:
107103
files: |
108104
dist/*

noxfile.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(path.parent / f"{path.stem}.in", path) for path in REQUIREMENTS.values()
1818
]
1919

20-
SUPPORTED = ["3.8", "3.9", "3.10", "pypy3.10", "3.11", "3.12"]
20+
SUPPORTED = ["3.9", "3.10", "pypy3.10", "3.11", "3.12", "3.13"]
2121
LATEST = SUPPORTED[-1]
2222

2323
nox.options.default_venv_backend = "uv|virtualenv"
@@ -82,9 +82,15 @@ def build(session):
8282
"""
8383
Build a distribution suitable for PyPI and check its validity.
8484
"""
85-
session.install("build", "twine")
85+
session.install("build[uv]", "twine")
8686
with TemporaryDirectory() as tmpdir:
87-
session.run("python", "-m", "build", ROOT, "--outdir", tmpdir)
87+
session.run(
88+
"pyproject-build",
89+
"--installer=uv",
90+
ROOT,
91+
"--outdir",
92+
tmpdir,
93+
)
8894
session.run("twine", "check", "--strict", tmpdir + "/*")
8995

9096

pyproject.toml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ source = "vcs"
88
[project]
99
name = "referencing-loaders"
1010
description = "Loading resources from various locations into referencing registries"
11+
requires-python = ">=3.9"
1112
readme = "README.rst"
12-
requires-python = ">=3.8"
13+
license = "MIT"
14+
license-files = ["COPYING"]
1315
keywords = ["json", "referencing", "jsonschema", "openapi", "asyncapi"]
1416
authors = [
1517
{ name = "Julian Berman", email = "Julian+referencing-loaders@GrayVines.com" },
1618
]
1719
classifiers = [
1820
"Development Status :: 4 - Beta",
1921
"Intended Audience :: Developers",
20-
"License :: OSI Approved :: MIT License",
2122
"Operating System :: OS Independent",
2223
"Programming Language :: Python",
23-
"Programming Language :: Python :: 3.8",
2424
"Programming Language :: Python :: 3.9",
2525
"Programming Language :: Python :: 3.10",
2626
"Programming Language :: Python :: 3.11",
2727
"Programming Language :: Python :: 3.12",
28-
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3.13",
2929
"Programming Language :: Python :: Implementation :: CPython",
3030
"Programming Language :: Python :: Implementation :: PyPy",
3131
"Topic :: File Formats :: JSON",
@@ -61,24 +61,16 @@ skip_covered = true
6161

6262
[tool.doc8]
6363
ignore = [
64-
"D000", # see PyCQA/doc8#125
65-
"D001", # one sentence per line, so max length doesn't make sense
64+
"D000", # see PyCQA/doc8#125
65+
"D001", # one sentence per line, so max length doesn't make sense
6666
]
6767

68-
[tool.isort]
69-
combine_as_imports = true
70-
ensure_newline_before_comments = true
71-
from_first = true
72-
include_trailing_comma = true
73-
multi_line_output = 3
74-
use_parentheses = true
75-
7668
[tool.pyright]
7769
reportUnnecessaryTypeIgnoreComment = true
7870
strict = ["**/*"]
7971
exclude = [
80-
"**/tests/__init__.py",
81-
"**/tests/test_*.py",
72+
"**/tests/__init__.py",
73+
"**/tests/test_*.py",
8274
]
8375

8476
[tool.ruff]
@@ -90,6 +82,7 @@ ignore = [
9082
"A001", # It's fine to shadow builtins
9183
"A002",
9284
"A003",
85+
"A005",
9386
"ARG", # This is all wrong whenever an interface is involved
9487
"ANN", # Just let the type checker do this
9588
"B006", # Mutable arguments require care but are OK if you don't abuse them
@@ -127,7 +120,7 @@ ignore = [
127120
"SIM300", # Not sure what heuristic this uses, but it's easily incorrect
128121
"SLF001", # Private usage within this package itself is fine
129122
"TD", # These TODO style rules are also silly
130-
"UP007", # We support 3.8 + 3.9
123+
"UP007", # We support 3.9
131124
]
132125

133126
[tool.ruff.lint.flake8-pytest-style]

referencing_loaders/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
from __future__ import annotations
66

77
from pathlib import Path
8-
from typing import TYPE_CHECKING, Any, Iterable
8+
from typing import TYPE_CHECKING, Any
99
import json
1010
import os
1111

1212
from referencing import Resource, Specification
1313

1414
if TYPE_CHECKING:
15+
from collections.abc import Iterable
1516
from importlib.resources.abc import Traversable
1617

1718
from referencing.typing import URI

0 commit comments

Comments
 (0)