Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/pysen-test-post-313/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'pysen-test-post-313'
description: 'Run pysen test, for python versions >= 3.13'
runs:
using: 'docker'
image: '../../../version_testing/post_313/Dockerfile'
entrypoint: '/bin/bash'
args:
- '-c'
# Changing the ownership is required. See the following link for more details:
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
- "chown -R $(id -u):$(id -g) . && tox --parallel -e 'py{313,314}-post313'"
4 changes: 2 additions & 2 deletions .github/actions/pysen-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: 'pysen-test'
description: 'Run pysen test'
runs:
using: 'docker'
image: '../../../assets/Dockerfile'
image: '../../../version_testing/post_310/Dockerfile'
entrypoint: '/bin/bash'
args:
- '-c'
# Changing the ownership is required. See the following link for more details:
# https://github.blog/2022-04-12-git-security-vulnerability-announced/
- "chown -R $(id -u):$(id -g) . && tox --parallel"
- "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'"
13 changes: 12 additions & 1 deletion .github/workflows/pysen-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
pull_request: {}
jobs:
tox:
tox_post_310:
name: Run pysen-test
runs-on: ubuntu-24.04
timeout-minutes: 15
Expand All @@ -16,3 +16,14 @@ jobs:
path: ${{ env.CHECKOUT_PATH }}
- name: Run test
uses: ./.github/actions/pysen-test/
tox_post_313:
name: Run pysen-test-post-313
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
with:
lfs: false
path: ${{ env.CHECKOUT_PATH }}
- name: Run test
uses: ./.github/actions/pysen-test-post-313/
9 changes: 1 addition & 8 deletions assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,4 @@
```bash
$ terminalizer render src/pysen.yml -o imgs/pysen.gif
$ terminalizer render src/pysen_vim.yml -o imgs/pysen_vim.gif
```

## Build docker image for pysen-test

```bash
$ docker build -t quay.io/pysen/pysen-test .
$ docker push quay.io/pysen/pysen-test
```
```
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ py_version = "py310"
isort_known_first_party = ["fakes", "pysen"]
mypy_exclude = '''(?x)(
^examples/simple_package/simple_package/excluded.\.py$
| ^version_testing/.*\.py$
)'''
[[tool.pysen.lint.mypy_targets]]
paths = ["src/pysen/", "tests/"]
Expand All @@ -83,7 +84,7 @@ mypy_exclude = '''(?x)(
paths = ["examples/plugin_example"]

[tool.pysen.lint.source]
excludes = ["build/", "dist/", "examples/", ".tox"]
excludes = ["build/", "dist/", "examples/", ".tox", "version_testing/"]

[tool.pytest.ini_options]
markers = ["examples"]
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ disallow_untyped_decorators = False
disallow_untyped_defs = True
exclude = (?x)(
^examples/simple_package/simple_package/excluded.\.py$
| ^version_testing/.*\.py$
)
ignore_errors = False
ignore_missing_imports = True
Expand Down
2 changes: 2 additions & 0 deletions src/pysen/py_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,6 @@ def parse_short_representation(value: str) -> "PythonVersion":
"PY310": PythonVersion(3, 10),
"PY311": PythonVersion(3, 11),
"PY312": PythonVersion(3, 12),
"PY313": PythonVersion(3, 13),
"PY314": PythonVersion(3, 14),
}
20 changes: 15 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{310}-dacite150-isort51-black{20,22}-mypy078, py{311,312}-dacite150-isort51-black22-mypy099, development, latest
envlist = py{310}-dacite150-isort51-black{20,22}-mypy078, py{311,312}-dacite150-isort51-black22-mypy099, development, latest, py{313,314}-post313
isolated_build = True

[testenv]
Expand All @@ -19,10 +19,6 @@ deps =
mypy099: mypy==0.991
flake8==4.0.1
flake8-bugbear==21.9.2

commands =
pytest -m "not examples"

setenv =
LANG = C

Expand All @@ -47,3 +43,17 @@ commands =
pip install .
pysen run lint
pytest

[testenv:py{313,314}-post313]
deps =
pipenv==2026.0.2
mypy==1.19.0
isort==7.0.0
black==25.12.0
flake8==7.3.0
flake8-bugbear==25.11.29
importlib-metadata==8.7.0
changedir = version_testing/post_313
commands =
pip install ../../
pysen run lint
6 changes: 6 additions & 0 deletions version_testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Build docker image for pysen-test

```bash
$ docker build -t quay.io/pysen/pysen-test .
$ docker push quay.io/pysen/pysen-test
```
6 changes: 2 additions & 4 deletions assets/Dockerfile → version_testing/post_310/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Dockerfile for pysen-test
FROM alpine:3.17

COPY --from=python:3.8.16-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.9.16-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.10.11-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.11.3-alpine3.17 /usr/local/ /usr/local/
COPY --from=python:3.12.0-alpine3.17 /usr/local/ /usr/local/

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

RUN apk add --no-cache bash git \
&& pip3.12 install --no-cache-dir tox==3.15.0
ENV TOX_PARALLEL_NO_SPINNER 1
ENV TOX_PARALLEL_NO_SPINNER=1
2 changes: 2 additions & 0 deletions version_testing/post_310/src/example_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main(arg1: str, arg2: int) -> bool:
return arg1.isdigit() and arg2 > 0
8 changes: 8 additions & 0 deletions version_testing/post_313/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM alpine:3.23

COPY --from=python:3.13.11-alpine3.23 /usr/local/ /usr/local/
COPY --from=python:3.14.2-alpine3.23 /usr/local/ /usr/local/

RUN apk add --no-cache bash git \
&& pip3.14 install --no-cache-dir tox==3.28.0
ENV TOX_PARALLEL_NO_SPINNER=1
17 changes: 17 additions & 0 deletions version_testing/post_313/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[project]
name = "example_post_313"
requires-python = ">=3.13"
description = "example project for python version >=3.13"

[tool.pysen]
version = "0.11"

[tool.pysen.lint]
enable_black = true
enable_flake8 = true
enable_isort = true
enable_mypy = true
mypy_preset = "very_strict"
py_version = "py313"
[[tool.pysen.lint.mypy_targets]]
paths = ["src"]
2 changes: 2 additions & 0 deletions version_testing/post_313/src/example_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main(arg1: str, arg2: int) -> bool:
return arg1.isdigit() and arg2 > 0
Loading