Skip to content

Commit

Permalink
build: added new version of Python interpreter
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/on_update.yml
#	.github/workflows/pre_release.yml
#	.github/workflows/tests.yml
#	Dockerfile.it
#	Dockerfile.local
#	examples/javascript/tox.ini
#	examples/minimal-async/tox.ini
#	examples/minimal/tox.ini
#	examples/modular/tox.ini
#	examples/multiplesite/tox.ini
#	examples/openrpc/tox.ini
#	requirements/typing.txt
#	src/flask_jsonrpc/contrib/browse/static/js/apps/browse/services.js
  • Loading branch information
alexted committed Oct 29, 2024
1 parent e5b8836 commit 8fdb783
Show file tree
Hide file tree
Showing 21 changed files with 109 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: ${{ matrix.language == 'python' }}
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Build Application using script
if: ${{ matrix.language == 'python' }}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/on_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -36,8 +36,8 @@ jobs:
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.11' }}
run: |
tox -e typing-pytype -p all
- name: Run tox (Style, Type checker, Security, Docs) | Python 3.12
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
- name: Run tox (Style, Type checker, Security, Docs) | Python 3.13
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.13' }}
run: |
tox -e style,typing-mypy,typing-pyright,security-bandit,docs -p all
- name: Run tox (Tests) | ${{ matrix.platform }}
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand All @@ -39,7 +39,7 @@ jobs:
run: |
py.test
- name: Upload coverage JUint report
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.12' }}
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == '3.13' }}
uses: actions/upload-artifact@v4
with:
name: test-n-coverage-report
Expand All @@ -58,7 +58,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Download a coverage artifact
uses: actions/download-artifact@v4
Expand All @@ -81,7 +81,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- macos-13 # intel
- macos-latest # apple silicon
- windows-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
- ubuntu-latest
- macos-latest
- windows-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.12"]
python-version: ["3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
matrix:
platform:
- ubuntu-latest
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout source at ${{ matrix.platform }}
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ exclude: '.git|.tox|.venv|.vscode|__pycache__|.pytest_cache|.eggs|.mypy_cache|.p
default_stages: [pre-commit]
fail_fast: true
default_language_version:
python: python3.12
python: python3.13
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-byte-order-marker
- id: check-case-conflict
Expand All @@ -20,7 +20,7 @@ repos:
- id: trailing-whitespace
- id: debug-statements
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.7.1
hooks:
- id: ruff
- id: ruff-format
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: '3.12'
python: 'latest'
python:
install:
- requirements: requirements/docs.txt
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.it
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-alpine AS builder
FROM python:alpine AS builder

RUN apk add --no-cache --update --virtual .build-deps \
build-base \
Expand All @@ -18,7 +18,7 @@ RUN pip install pip setuptools wheel --upgrade \
&& pip wheel --wheel-dir=/svc/wheels -r tests.txt \
&& pip install poetry-core>=1.0.0

FROM python:3.12-alpine
FROM python:alpine

ENV PYTHONUNBUFFERED=1 \
DEBUG=0 \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-alpine AS builder
FROM python:alpine AS builder

RUN apk add --no-cache --update --virtual .build-deps \
build-base \
Expand Down Expand Up @@ -31,7 +31,7 @@ RUN pip install pip wheel --upgrade \
&& python setup.py bdist_wheel --dist-dir /svc/dist \
|| pip wheel --wheel-dir=/svc/wheels -e ${PROJECT_PATH}

FROM python:3.12-alpine
FROM python:alpine

ENV PYTHONUNBUFFERED=1 \
DEBUG=0 \
Expand Down
39 changes: 39 additions & 0 deletions Dockerfile.py313.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM python:3.13-alpine

ENV PYTHONUNBUFFERED=1 \
PRAGMA_VERSION=py3.13 \
DEBUG=0

WORKDIR /code

COPY requirements/ /code/requirements/

RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
gcc \
musl-dev \
python3-dev \
git \
&& pip install pip setuptools wheel --upgrade \
&& pip install -r requirements/base.txt \
&& pip install -r requirements/style.txt \
&& pip install -r requirements/tests.txt \
poetry-core>=1.0.0 \
&& apk del .build-deps \
&& addgroup -S kuchulu \
&& adduser \
--disabled-password \
--gecos "" \
--ingroup kuchulu \
--no-create-home \
-s /bin/false \
kuchulu

ARG VERSION=1
RUN echo "Vesion: ${VERSION}"

COPY . /code/

RUN chown kuchulu:kuchulu -R /code

USER kuchulu
8 changes: 8 additions & 0 deletions bin/docker-compose-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,17 @@ DOCKER_WAIT_FOR_PY311=$?
)
DOCKER_WAIT_FOR_PY312=$?

(
set -e
docker wait ci-python3.13-1
docker logs ci-python3.13-1
)
DOCKER_WAIT_FOR_PY313=$?

docker compose -f ${DOCKER_COMPOSE_FILE_PATH} -p ci down --remove-orphans

if [ ${DOCKER_WAIT_FOR_PY39} -ne 0 ]; then echo "Test to Python 3.9 failed"; exit 1; fi
if [ ${DOCKER_WAIT_FOR_PY310} -ne 0 ]; then echo "Test to Python 3.10 failed"; exit 1; fi
if [ ${DOCKER_WAIT_FOR_PY311} -ne 0 ]; then echo "Test to Python 3.11 failed"; exit 1; fi
if [ ${DOCKER_WAIT_FOR_PY312} -ne 0 ]; then echo "Test to Python 3.12 failed"; exit 1; fi
if [ ${DOCKER_WAIT_FOR_PY313} -ne 0 ]; then echo "Test to Python 3.13 failed"; exit 1; fi
10 changes: 10 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
services:
python3.13:
build:
context: .
dockerfile: Dockerfile.py313.test
environment:
- PRAGMA_VERSION=py3.13
command: >
sh -c "ruff check . &&
pytest"
python3.12:
build:
context: .
Expand Down
6 changes: 3 additions & 3 deletions examples/javascript/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
6 changes: 3 additions & 3 deletions examples/minimal-async/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
6 changes: 3 additions & 3 deletions examples/minimal/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
6 changes: 3 additions & 3 deletions examples/modular/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
6 changes: 3 additions & 3 deletions examples/multiplesite/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
6 changes: 3 additions & 3 deletions examples/openrpc/tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{12,11,10,9,8}
py3{12,11,10,9,8}-async
py3{13,12,11,10,9,8}
py3{13,12,11,10,9,8}-async
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,7 +10,7 @@ wheel_build_env = .pkg
envtmpdir = {toxworkdir}/tmp/{envname}
constrain_package_deps = true
use_frozen_constraints = true
deps =
deps =
pytest==8.3.3
pytest-cov==5.0.0
pytest-xdist==3.6.1
Expand Down
Loading

0 comments on commit 8fdb783

Please sign in to comment.