Skip to content

Commit 8eb9392

Browse files
committed
Migrate to uv and update python version support
1 parent a80ee86 commit 8eb9392

7 files changed

Lines changed: 1420 additions & 46 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
version: 2
22
updates:
3-
- package-ecosystem: pip
3+
- package-ecosystem: uv
44
directory: "/"
55
schedule:
6-
interval: daily
7-
open-pull-requests-limit: 10
6+
interval: monthly
7+
groups:
8+
all-dependencies:
9+
patterns: ["*"]
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: "monthly"
14+
groups:
15+
all-actions:
16+
patterns: ["*"]

.github/workflows/build-release.yml

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,45 +15,57 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
include:
18-
- { name: "3.8", python: "3.8", tox: py38 }
19-
- { name: "lowest", python: "3.8", tox: py38-lowest }
20-
- { name: "3.12-apispecdev", python: "3.12", tox: py312-apispecdev }
18+
- { name: "3.10", tox: py310 }
19+
- { name: "3.14", tox: py314 }
20+
- { name: "lowest", tox: py310-lowest }
21+
- { name: "3.14-apispecdev", tox: py314-apispecdev }
2122
steps:
22-
- uses: actions/checkout@v3.1.0
23-
- uses: actions/setup-python@v4.3.0
23+
- uses: actions/checkout@v6
24+
- uses: astral-sh/setup-uv@v7
2425
with:
25-
python-version: ${{ matrix.python }}
26-
- run: python -m pip install --upgrade pip
27-
- run: python -m pip install tox
28-
- run: python -m tox -e ${{ matrix.tox }}
29-
26+
enable-cache: true
27+
- run: uv run tox -e ${{ matrix.tox }}
28+
build:
29+
name: Build package
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v6
33+
- uses: astral-sh/setup-uv@v7
34+
with:
35+
enable-cache: true
36+
- run: uv build
37+
- run: uvx twine check --strict dist/*
38+
- name: Store the distribution packages
39+
uses: actions/upload-artifact@v7
40+
with:
41+
name: python-package-distributions
42+
path: dist/
43+
# this duplicates pre-commit.ci, so only run it on tags
44+
# it guarantees that linting is passing prior to a release
3045
lint-pre-release:
31-
name: lint
3246
if: startsWith(github.ref, 'refs/tags')
3347
runs-on: ubuntu-latest
3448
steps:
35-
- uses: actions/checkout@v3.1.0
36-
- uses: actions/setup-python@v4.3.0
49+
- uses: actions/checkout@v6
50+
- uses: astral-sh/setup-uv@v7
3751
with:
38-
python-version: "3.11"
39-
- run: python -m pip install --upgrade pip
40-
- run: python -m pip install tox
41-
- run: python -m tox -e lint
42-
release:
43-
needs: [tests, lint-pre-release]
52+
enable-cache: true
53+
- run: uv run tox -e lint
54+
publish-to-pypi:
4455
name: PyPI release
45-
if: startsWith(github.ref, 'refs/tags')
56+
if: startsWith(github.ref, 'refs/tags/')
57+
needs: [build, tests, lint-pre-release]
4658
runs-on: ubuntu-latest
59+
environment:
60+
name: pypi
61+
url: https://pypi.org/p/apispec-webframeworks
62+
permissions:
63+
id-token: write
4764
steps:
48-
- uses: actions/checkout@v3.1.0
49-
- uses: actions/setup-python@v4.3.0
65+
- name: Download all the dists
66+
uses: actions/download-artifact@v7
5067
with:
51-
python-version: "3.11"
52-
- name: install requirements
53-
run: python -m pip install build twine
54-
- name: build dists
55-
run: python -m build
56-
- name: check package metadata
57-
run: twine check dist/*
58-
- name: publish
59-
run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*
68+
name: python-package-distributions
69+
path: dist/
70+
- name: Publish distribution to PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ repos:
2222
- id: mypy
2323
files: ^src/apispec_webframeworks/
2424
additional_dependencies: ["Flask==2.3.3", "tornado>=6", "bottle", "apispec[yaml]>=5.2.1", types-setuptools]
25+
- repo: https://github.com/astral-sh/uv-pre-commit
26+
rev: 0.10.9
27+
hooks:
28+
- id: uv-lock

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
---------
33

4+
unreleased
5+
++++++++++
6+
7+
Other:
8+
9+
* Support Python 3.10-3.14. Older versions are no longer supported.
10+
411
1.2.0 (2024-09-16)
512
++++++++++++++++++
613

pyproject.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,38 @@ name = "apispec-webframeworks"
33
version = "1.2.0"
44
description = "Web framework plugins for apispec."
55
readme = "README.rst"
6-
license = { file = "LICENSE" }
7-
maintainers = [{ name = "Steven Loria", email = "sloria1@gmail.com" }]
6+
license = "MIT"
7+
maintainers = [{ name = "Steven Loria", email = "oss@stevenloria.com" }]
88
classifiers = [
99
"Intended Audience :: Developers",
10-
"License :: OSI Approved :: MIT License",
1110
"Natural Language :: English",
1211
"Programming Language :: Python :: 3",
13-
"Programming Language :: Python :: 3.8",
14-
"Programming Language :: Python :: 3.9",
1512
"Programming Language :: Python :: 3.10",
1613
"Programming Language :: Python :: 3.11",
1714
"Programming Language :: Python :: 3.12",
15+
"Programming Language :: Python :: 3.13",
16+
"Programming Language :: Python :: 3.14",
1817
]
19-
requires-python = ">=3.8"
18+
requires-python = ">=3.10"
2019
dependencies = ["apispec[yaml]>=6.0.0"]
2120

2221
[project.urls]
2322
Funding = "https://opencollective.com/marshmallow"
2423
Issues = "https://github.com/marshmallow-code/apispec-webframeworks/issues"
2524
Source = "https://github.com/marshmallow-code/apispec-webframeworks"
2625

27-
[project.optional-dependencies]
26+
[dependency-groups]
2827
tests = [
2928
"pytest",
3029
"Flask>=2.3.3",
3130
"tornado>=6",
3231
"bottle>=0.12.25",
3332
"aiohttp>=3.9.3",
3433
]
35-
dev = ["apispec-webframeworks[tests]", "tox", "pre-commit>=3.5,<5.0"]
34+
dev = [{ include-group = "tests" }, "tox", "tox-uv", "pre-commit>=3.5,<5.0"]
35+
36+
[tool.uv]
37+
default-groups = ["dev"]
3638

3739
[build-system]
3840
requires = ["flit_core<4"]

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tox]
22
envlist=
33
lint
4-
py{38,39,310,311,312}
5-
py312-apispecdev
6-
py38-lowest
4+
py{310,311,312,313,314}
5+
py314-apispecdev
6+
py310-lowest
77

88
[testenv]
9-
extras = tests
9+
dependency_groups = tests
1010
deps =
1111
apispecdev: https://github.com/marshmallow-code/apispec/archive/dev.tar.gz
1212
lowest: aiohttp==3.9.3

0 commit comments

Comments
 (0)