Skip to content

Commit 4bad0d6

Browse files
committed
support python3.13
1 parent 5448bff commit 4bad0d6

File tree

2 files changed

+40
-66
lines changed

2 files changed

+40
-66
lines changed

.github/workflows/test.yml

Lines changed: 31 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,95 +7,63 @@ on:
77
pull_request:
88

99
jobs:
10-
lint:
10+
lint-and-docs:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
- name: Set up Python
15-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: 3.9
18-
- name: Install test runner
19-
run: |
20-
python -m pip install --upgrade pip
21-
python -m pip install tox
22-
- name: Run linters
23-
run: tox -e lint
24-
25-
docs:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- uses: actions/checkout@v3
29-
- name: Set up Python
30-
uses: actions/setup-python@v4
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
3120
with:
3221
python-version: 3.9
33-
- name: Install test runner
34-
run: |
35-
python -m pip install --upgrade pip
36-
python -m pip install tox
22+
- name: Run linters
23+
run: uvx --with tox-uv tox r -e lint
3724
- name: Build docs
38-
run: tox -e docs
25+
run: uvx --with tox-uv tox r -e docs
3926
- name: Update docs
40-
if: |
41-
github.repository == 'avaldebe/PyPMS' &&
42-
github.event_name == 'push' &&
43-
startsWith(github.ref, 'refs/tags')
44-
run: tox -e docs-deploy -- --force
27+
if: github.ref_type == 'tag'
28+
run: uvx --with tox-uv tox r -e docs-deploy -- --force
4529

4630
test:
4731
runs-on: ubuntu-latest
4832
strategy:
4933
matrix:
50-
python-version: ['3.9', '3.10', '3.11', '3.12']
34+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
5135
steps:
52-
- uses: actions/checkout@v3
36+
- uses: actions/checkout@v4
5337
- name: Set up Python ${{ matrix.python-version }}
54-
uses: actions/setup-python@v4
38+
uses: actions/setup-python@v5
5539
with:
5640
python-version: ${{ matrix.python-version }}
57-
- name: Cache pip
58-
uses: actions/cache@v3
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@v5
5943
with:
60-
path: |
61-
~/.cache/pip
62-
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
63-
restore-keys: |
64-
${{ runner.os }}-pip-
65-
- name: Install test runner
66-
run: |
67-
python -m pip install --upgrade pip
68-
python -m pip install tox
44+
python-version: ${{ matrix.python-version }}
45+
enable-cache: true
6946
- name: Run tests
70-
run: tox -e py
47+
run: uvx --with tox-uv tox r -e py
7148

72-
build:
73-
needs: [test, lint]
49+
build-and-release:
50+
needs: [test, lint-and-docs]
7451
runs-on: ubuntu-latest
7552
steps:
76-
- uses: actions/checkout@v3
53+
- uses: actions/checkout@v4
7754
- name: Set up Python
78-
uses: actions/setup-python@v4
55+
uses: actions/setup-python@v5
7956
with:
80-
python-version: 3.8
81-
- name: Install PyPA build
82-
run: |
83-
python -m pip install --upgrade pip
84-
python -m pip install build
85-
- name: Build distribution package
86-
run: python -m build
87-
88-
release:
89-
runs-on: ubuntu-latest
90-
needs: [build, docs, test, lint]
91-
if: |
92-
github.repository == 'avaldebe/PyPMS' &&
93-
github.event_name == 'push' &&
94-
startsWith(github.ref, 'refs/tags')
95-
steps:
96-
- uses: actions/checkout@v3
57+
python-version: 3.13
58+
- name: Install uv
59+
uses: astral-sh/setup-uv@v5
60+
with:
61+
python-version: 3.13
62+
- name: Build package
63+
run: uv build
9764
- name: Release
98-
uses: softprops/action-gh-release@v1
65+
uses: softprops/action-gh-release@v2
66+
if: github.ref_type == 'tag'
9967
with:
10068
draft: true
10169
body_path: README.md

pyproject.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ classifiers = [
1717
"Programming Language :: Python :: 3.10",
1818
"Programming Language :: Python :: 3.11",
1919
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
2021
"License :: OSI Approved :: MIT License",
2122
"Operating System :: OS Independent",
2223
"Natural Language :: English",
@@ -101,22 +102,26 @@ cache-keys = [{ file = "pyproject.toml" }, { file = "src/pms/_version.py" }]
101102
[tool.tox]
102103
legacy_tox_ini = """
103104
[tox]
104-
envlist = lint, docs, py39, py310, py311, py312
105+
envlist = lint, docs, py39, py310, py311, py312, py313
105106
skip_missing_interpreters = True
106107
isolated_build = True
107108
requires =
108109
tox >=4.22
109110
tox-uv >=1.25
110111
111112
[testenv]
112-
commands_pre =
113-
python --version
113+
description =
114+
py39: test with lowest dependency versions
115+
!py39: test with {base_python}
116+
uv_resolution =
117+
py39: lowest
114118
commands =
115119
pytest -ra -q {posargs:--cov --no-cov-on-fail}
116120
dependency_groups =
117121
test
118122
119123
[testenv:lint]
124+
description = code quality
120125
skip_install=True
121126
commands =
122127
pre-commit autoupdate
@@ -126,6 +131,7 @@ deps =
126131
pre-commit-uv
127132
128133
[testenv:docs{,-serve,-deploy}]
134+
description = build docs
129135
commands =
130136
docs: mkdocs build --clean
131137
docs-serve: mkdocs serve

0 commit comments

Comments
 (0)