Skip to content

Commit 335dd85

Browse files
add tests for python >= 3.13 (#73)
* add tests for python >= 3.13 * revert debug code * update tox version * specify flake8 versions * pin importib-metadata so that it's comptaible with flake8 * add supported python versions 3.13, 3.14 * remove parallel option for testing * use quotes to avoid exansion of {a,b} * exclude source code for post 313 * Fix argument order * move README description of dockerfile for testing * remove dynamic version for post 3.13 project file
1 parent dcc2be2 commit 335dd85

File tree

14 files changed

+83
-21
lines changed

14 files changed

+83
-21
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: 'pysen-test-post-313'
2+
description: 'Run pysen test, for python versions >= 3.13'
3+
runs:
4+
using: 'docker'
5+
image: '../../../version_testing/post_313/Dockerfile'
6+
entrypoint: '/bin/bash'
7+
args:
8+
- '-c'
9+
# Changing the ownership is required. See the following link for more details:
10+
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
11+
- "chown -R $(id -u):$(id -g) . && tox --parallel -e 'py{313,314}-post313'"

.github/actions/pysen-test/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: 'pysen-test'
22
description: 'Run pysen test'
33
runs:
44
using: 'docker'
5-
image: '../../../assets/Dockerfile'
5+
image: '../../../version_testing/post_310/Dockerfile'
66
entrypoint: '/bin/bash'
77
args:
88
- '-c'
99
# Changing the ownership is required. See the following link for more details:
1010
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
11-
- "chown -R $(id -u):$(id -g) . && tox --parallel"
11+
- "chown -R $(id -u):$(id -g) . && tox --parallel -e 'py{310}-dacite150-isort51-black{20,22}-mypy078, py{311,312}-dacite150-isort51-black22-mypy099, development, latest'"

.github/workflows/pysen-test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
- main
66
pull_request: {}
77
jobs:
8-
tox:
8+
tox_post_310:
99
name: Run pysen-test
1010
runs-on: ubuntu-24.04
1111
timeout-minutes: 15
@@ -16,3 +16,14 @@ jobs:
1616
path: ${{ env.CHECKOUT_PATH }}
1717
- name: Run test
1818
uses: ./.github/actions/pysen-test/
19+
tox_post_313:
20+
name: Run pysen-test-post-313
21+
runs-on: ubuntu-24.04
22+
timeout-minutes: 15
23+
steps:
24+
- uses: actions/checkout@v5
25+
with:
26+
lfs: false
27+
path: ${{ env.CHECKOUT_PATH }}
28+
- name: Run test
29+
uses: ./.github/actions/pysen-test-post-313/

assets/README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,4 @@
33
```bash
44
$ terminalizer render src/pysen.yml -o imgs/pysen.gif
55
$ terminalizer render src/pysen_vim.yml -o imgs/pysen_vim.gif
6-
```
7-
8-
## Build docker image for pysen-test
9-
10-
```bash
11-
$ docker build -t quay.io/pysen/pysen-test .
12-
$ docker push quay.io/pysen/pysen-test
13-
```
6+
```

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ py_version = "py310"
7272
isort_known_first_party = ["fakes", "pysen"]
7373
mypy_exclude = '''(?x)(
7474
^examples/simple_package/simple_package/excluded.\.py$
75+
| ^version_testing/.*\.py$
7576
)'''
7677
[[tool.pysen.lint.mypy_targets]]
7778
paths = ["src/pysen/", "tests/"]
@@ -83,7 +84,7 @@ mypy_exclude = '''(?x)(
8384
paths = ["examples/plugin_example"]
8485

8586
[tool.pysen.lint.source]
86-
excludes = ["build/", "dist/", "examples/", ".tox"]
87+
excludes = ["build/", "dist/", "examples/", ".tox", "version_testing/"]
8788

8889
[tool.pytest.ini_options]
8990
markers = ["examples"]

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ disallow_untyped_decorators = False
2525
disallow_untyped_defs = True
2626
exclude = (?x)(
2727
^examples/simple_package/simple_package/excluded.\.py$
28+
| ^version_testing/.*\.py$
2829
)
2930
ignore_errors = False
3031
ignore_missing_imports = True

src/pysen/py_version.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,6 @@ def parse_short_representation(value: str) -> "PythonVersion":
112112
"PY310": PythonVersion(3, 10),
113113
"PY311": PythonVersion(3, 11),
114114
"PY312": PythonVersion(3, 12),
115+
"PY313": PythonVersion(3, 13),
116+
"PY314": PythonVersion(3, 14),
115117
}

tox.ini

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{310}-dacite150-isort51-black{20,22}-mypy078, py{311,312}-dacite150-isort51-black22-mypy099, development, latest
2+
envlist = py{310}-dacite150-isort51-black{20,22}-mypy078, py{311,312}-dacite150-isort51-black22-mypy099, development, latest, py{313,314}-post313
33
isolated_build = True
44

55
[testenv]
@@ -19,10 +19,6 @@ deps =
1919
mypy099: mypy==0.991
2020
flake8==4.0.1
2121
flake8-bugbear==21.9.2
22-
23-
commands =
24-
pytest -m "not examples"
25-
2622
setenv =
2723
LANG = C
2824

@@ -47,3 +43,17 @@ commands =
4743
pip install .
4844
pysen run lint
4945
pytest
46+
47+
[testenv:py{313,314}-post313]
48+
deps =
49+
pipenv==2026.0.2
50+
mypy==1.19.0
51+
isort==7.0.0
52+
black==25.12.0
53+
flake8==7.3.0
54+
flake8-bugbear==25.11.29
55+
importlib-metadata==8.7.0
56+
changedir = version_testing/post_313
57+
commands =
58+
pip install ../../
59+
pysen run lint

version_testing/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Build docker image for pysen-test
2+
3+
```bash
4+
$ docker build -t quay.io/pysen/pysen-test .
5+
$ docker push quay.io/pysen/pysen-test
6+
```
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# Dockerfile for pysen-test
22
FROM alpine:3.17
33

4-
COPY --from=python:3.8.16-alpine3.17 /usr/local/ /usr/local/
5-
COPY --from=python:3.9.16-alpine3.17 /usr/local/ /usr/local/
64
COPY --from=python:3.10.11-alpine3.17 /usr/local/ /usr/local/
75
COPY --from=python:3.11.3-alpine3.17 /usr/local/ /usr/local/
86
COPY --from=python:3.12.0-alpine3.17 /usr/local/ /usr/local/
97

108
RUN apk add --no-cache expat gcc libffi musl-dev \
11-
&& for MINOR in 8 9 10 11 12; do \
9+
&& for MINOR in 10 11 12; do \
1210
sed "s|^#!/usr/local/bin/python$|#!/usr/local/bin/python3.${MINOR}|" \
1311
-i /usr/local/bin/*3.${MINOR}; done
1412

1513
RUN apk add --no-cache bash git \
1614
&& pip3.12 install --no-cache-dir tox==3.15.0
17-
ENV TOX_PARALLEL_NO_SPINNER 1
15+
ENV TOX_PARALLEL_NO_SPINNER=1

0 commit comments

Comments
 (0)