Skip to content

Commit b1cc4d7

Browse files
committed
chore: support for py310-314, GHA improvements
- update actions - use uv instead of tox - cleanup dependency groups
1 parent 6478d61 commit b1cc4d7

10 files changed

Lines changed: 85 additions & 63 deletions

File tree

.github/workflows/pre-commit.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
main:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
11-
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
11+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1212
with:
1313
python-version: 3.x
1414
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
15-
- uses: pre-commit-ci/lite-action@9d882e7a565f7008d4faf128f27d1cb6503d4ebf # v1.0.2
15+
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
1616
if: ${{ !cancelled() }}

.github/workflows/publish.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
build:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
11-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
11+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1212
with:
1313
python-version: '3.x'
1414
cache: pip
@@ -17,7 +17,7 @@ jobs:
1717
# Use the commit date instead of the current date during the build.
1818
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
1919
- run: python -m build
20-
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
20+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
2121
with:
2222
path: ./dist
2323
create-release:
@@ -26,7 +26,7 @@ jobs:
2626
permissions:
2727
contents: write
2828
steps:
29-
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
29+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
3030
- name: create release
3131
run: >
3232
gh release create --draft --repo ${{ github.repository }}
@@ -44,11 +44,11 @@ jobs:
4444
permissions:
4545
id-token: write
4646
steps:
47-
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
48-
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
47+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
48+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
4949
with:
5050
repository-url: https://test.pypi.org/legacy/
5151
packages-dir: artifact/
52-
- uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
52+
- uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
5353
with:
5454
packages-dir: artifact/

.github/workflows/tests.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,22 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24+
- {python: '3.14'}
2425
- {python: '3.13'}
2526
- {python: '3.12'}
2627
- {python: '3.11'}
2728
- {python: '3.10'}
28-
- {python: '3.9'}
2929
steps:
30-
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
31-
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
30+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3232
with:
3333
python-version: ${{ matrix.python }}
34-
allow-prereleases: true
35-
cache: pip
36-
- run: pip install tox
37-
- run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }}
34+
- run: uv run pytest
35+
minversions:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39+
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
40+
with:
41+
python-version: '3.10'
42+
- run: uv run --resolution=lowest-direct pytest --override-ini=filterwarnings=

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ env/
2222

2323
# Editors
2424
.idea
25+
26+
uv.lock

CHANGES.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 0.4.3
2+
-------------
3+
4+
Unreleased
5+
6+
- Remove python 3.9 support
7+
- Add python 3.14 support
8+
19
Version 0.4.2
210
-------------
311

MANIFEST.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

pyproject.toml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,28 @@ classifiers = [
1616
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
1717
"Topic :: Software Development :: Libraries :: Application Frameworks",
1818
]
19-
requires-python = ">=3.9"
19+
requires-python = ">=3.10"
2020
dependencies = [
2121
"WTForms>=3.1",
2222
"SQLAlchemy>=1.4",
2323
]
2424
dynamic = ["version"]
2525

26+
[dependency-groups]
27+
docs = [
28+
"Sphinx~=7.0.0",
29+
"Pallets-Sphinx-Themes~=2.2.0",
30+
"sphinx-issues~=4.0.0",
31+
"sphinxcontrib-log-cabinet~=1.0.1",
32+
"python-dateutil~=2.8.2",
33+
]
34+
dev = [
35+
"coverage>=7.0",
36+
"pytest>=8.0",
37+
"prek>=0.1",
38+
"tox-uv>=1.28.1",
39+
]
40+
2641
[project.urls]
2742
Documentation = "https://wtforms-sqlalchemy.readthedocs.io/"
2843
Changes = "https://wtforms-sqlalchemy.readthedocs.io/changes/"
@@ -46,7 +61,6 @@ include = [
4661
"docs/",
4762
"tests/",
4863
"CHANGES.rst",
49-
"tox.ini",
5064
]
5165
exclude = [
5266
"docs/_build/",
@@ -58,6 +72,42 @@ filterwarnings = [
5872
"error",
5973
]
6074

75+
[tool.tox]
76+
env_list = [
77+
"py313",
78+
"py312",
79+
"py311",
80+
"py310",
81+
"pypy310",
82+
"style",
83+
"docs",
84+
"minversions",
85+
]
86+
87+
[tool.tox.env_run_base]
88+
runner = "uv-venv-runner"
89+
dependency_groups = ["dev"]
90+
commands = [["pytest", "{posargs}"]]
91+
92+
[tool.tox.env.style]
93+
skip_install = true
94+
commands = [["prek", "run", "--all-files", "--show-diff-on-failure"]]
95+
96+
[tool.tox.env.docs]
97+
dependency_groups = ["docs"]
98+
commands = [["sphinx-build", "-W", "-b", "html", "-d", "{env_tmp_dir}/doctrees", "docs", "{env_tmp_dir}/html"]]
99+
100+
[tool.tox.env.coverage]
101+
commands = [
102+
["coverage", "run", "-m", "pytest", "--tb=short", "--basetemp={env_tmp_dir}", "{posargs}"],
103+
["coverage", "html"],
104+
["coverage", "report"],
105+
]
106+
107+
[tool.tox.env.minversions]
108+
uv_resolution = "lowest-direct"
109+
commands = [["pytest", "--override-ini=filterwarnings=", "{posargs}"]]
110+
61111
[tool.coverage.run]
62112
branch = true
63113
source = ["wtforms_sqlalchemy", "tests"]

tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def contains_validator(field, v_type):
5454
class DummyPostData(dict):
5555
def getlist(self, key):
5656
v = self[key]
57-
if not isinstance(v, (list, tuple)):
57+
if not isinstance(v, list | tuple):
5858
v = [v]
5959
return v
6060

tox.ini

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)