From 8fdb7836be7a4b51a79c2fd6e074e81dd740a8c1 Mon Sep 17 00:00:00 2001 From: Alex Ted Date: Sun, 27 Oct 2024 01:12:37 +0300 Subject: [PATCH] build: added new version of Python interpreter # 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 --- .github/workflows/codeql_analysis.yml | 2 +- .github/workflows/on_update.yml | 6 ++--- .github/workflows/pre_release.yml | 14 +++++----- .github/workflows/release.yml | 6 ++--- .github/workflows/tests.yml | 2 +- .pre-commit-config.yaml | 6 ++--- .readthedocs.yaml | 2 +- Dockerfile.it | 4 +-- Dockerfile.local | 4 +-- Dockerfile.py313.test | 39 +++++++++++++++++++++++++++ bin/docker-compose-test.sh | 8 ++++++ docker-compose.test.yml | 10 +++++++ examples/javascript/tox.ini | 6 ++--- examples/minimal-async/tox.ini | 6 ++--- examples/minimal/tox.ini | 6 ++--- examples/modular/tox.ini | 6 ++--- examples/multiplesite/tox.ini | 6 ++--- examples/openrpc/tox.ini | 6 ++--- pyproject.toml | 5 ++-- requirements/typing.txt | 2 +- tox.ini | 14 +++++----- 21 files changed, 109 insertions(+), 51 deletions(-) create mode 100644 Dockerfile.py313.test diff --git a/.github/workflows/codeql_analysis.yml b/.github/workflows/codeql_analysis.yml index 1903f4e3..8e1e6d0c 100644 --- a/.github/workflows/codeql_analysis.yml +++ b/.github/workflows/codeql_analysis.yml @@ -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: | diff --git a/.github/workflows/on_update.yml b/.github/workflows/on_update.yml index 6b4896a7..6eea8763 100644 --- a/.github/workflows/on_update.yml +++ b/.github/workflows/on_update.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index e20ab036..e02d6c85 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aea8b401..8cadcbcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 728f09c0..9dc2001d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc2071b7..7a0b3d80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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 diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 865c6859..3050550b 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -2,7 +2,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: '3.12' + python: 'latest' python: install: - requirements: requirements/docs.txt diff --git a/Dockerfile.it b/Dockerfile.it index a660a269..d5d55048 100644 --- a/Dockerfile.it +++ b/Dockerfile.it @@ -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 \ @@ -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 \ diff --git a/Dockerfile.local b/Dockerfile.local index 434e7f4d..a3e859bc 100644 --- a/Dockerfile.local +++ b/Dockerfile.local @@ -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 \ @@ -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 \ diff --git a/Dockerfile.py313.test b/Dockerfile.py313.test new file mode 100644 index 00000000..ad9efe37 --- /dev/null +++ b/Dockerfile.py313.test @@ -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 diff --git a/bin/docker-compose-test.sh b/bin/docker-compose-test.sh index 0c38b35a..23fbcb1c 100755 --- a/bin/docker-compose-test.sh +++ b/bin/docker-compose-test.sh @@ -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 diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 8aa76152..1a6433c9 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -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: . diff --git a/examples/javascript/tox.ini b/examples/javascript/tox.ini index 04d38d5f..08868065 100644 --- a/examples/javascript/tox.ini +++ b/examples/javascript/tox.ini @@ -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] @@ -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 diff --git a/examples/minimal-async/tox.ini b/examples/minimal-async/tox.ini index 04d38d5f..08868065 100644 --- a/examples/minimal-async/tox.ini +++ b/examples/minimal-async/tox.ini @@ -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] @@ -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 diff --git a/examples/minimal/tox.ini b/examples/minimal/tox.ini index 04d38d5f..08868065 100644 --- a/examples/minimal/tox.ini +++ b/examples/minimal/tox.ini @@ -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] @@ -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 diff --git a/examples/modular/tox.ini b/examples/modular/tox.ini index 04d38d5f..08868065 100644 --- a/examples/modular/tox.ini +++ b/examples/modular/tox.ini @@ -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] @@ -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 diff --git a/examples/multiplesite/tox.ini b/examples/multiplesite/tox.ini index 04d38d5f..08868065 100644 --- a/examples/multiplesite/tox.ini +++ b/examples/multiplesite/tox.ini @@ -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] @@ -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 diff --git a/examples/openrpc/tox.ini b/examples/openrpc/tox.ini index 04d38d5f..08868065 100644 --- a/examples/openrpc/tox.ini +++ b/examples/openrpc/tox.ini @@ -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] @@ -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 diff --git a/pyproject.toml b/pyproject.toml index ba200ea8..5663533b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Application Frameworks", ] @@ -245,7 +246,7 @@ exclude_lines = [ [tool.mypy] plugins = ["pydantic.mypy"] files = ["src/flask_jsonrpc"] -python_version = "3.12" +python_version = "3.13" pretty = true strict = true show_error_codes = true @@ -279,6 +280,6 @@ python_version = "3.11" disable = ["invalid-annotation"] [tool.pyright] -pythonVersion = "3.12" +pythonVersion = "3.13" include = ["src/flask_jsonrpc"] typeCheckingMode = "basic" diff --git a/requirements/typing.txt b/requirements/typing.txt index a618ee3a..1ca7950b 100644 --- a/requirements/typing.txt +++ b/requirements/typing.txt @@ -1,7 +1,7 @@ # Type check # ------------------------------------------------------------------------------ mypy==1.13.0;python_version>="3.11" # https://github.com/python/mypy -pytype==2024.1.5;python_version>="3.11" and python_version<"3.12" # https://github.com/google/pytype +pytype==2024.10.11;python_version~="3.11.0" # https://github.com/google/pytype types_setuptools==75.2.0.20241025 # https://github.com/python/typeshed typeguard==4.4.0 # https://github.com/agronholm/typeguard pyright==1.1.386;python_version>="3.11" # https://github.com/microsoft/pyright diff --git a/tox.ini b/tox.ini index 339efb16..e96e7c4c 100644 --- a/tox.ini +++ b/tox.ini @@ -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} + py3{13,12,11,10,9}-async style typing-{mypy,pytype,pyright} security-{safety,bandit} @@ -27,7 +27,7 @@ commands = pre-commit run --all-files --show-diff-on-failure [testenv:typing-mypy] -basepython=python3.12 +basepython=python3.13 deps = -r requirements/typing.txt commands = @@ -41,28 +41,28 @@ commands = pytype [testenv:typing-pyright] -basepython=python3.12 +basepython=python3.13 deps = -r requirements/typing.txt commands = pyright [testenv:security-safety] -basepython=python3.12 +basepython=python3.13 deps = safety commands = safety check -r requirements/production.txt [testenv:security-bandit] -basepython=python3.12 +basepython=python3.13 deps = bandit commands = bandit -r src/ [testenv:docs] -basepython=python3.12 +basepython=python3.13 deps = -r requirements/docs.txt commands =