From 35a949cb74b00f906340d458bcbf328bee2c18b3 Mon Sep 17 00:00:00 2001 From: KotlinIsland <65446343+kotlinisland@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:14:22 +1000 Subject: [PATCH] python3.13 --- .github/workflows/add-mypy-version.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-gcp.yml | 4 +- .pre-commit-config.yaml | 2 +- app/Dockerfile | 2 +- app/Dockerfile-prod | 2 +- app/config.toml | 4 +- app/mypy_playground/app.py | 16 +++++++- app/pyproject.toml | 2 +- app/requirements.dev.txt | 52 ++++++++++++------------ app/requirements.txt | 56 +++++++++++--------------- app/setup.cfg | 4 +- sandbox/README.md | 2 +- sandbox/add_version.sh | 2 +- sandbox/cloud_functions/deploy.sh | 2 +- 15 files changed, 79 insertions(+), 75 deletions(-) diff --git a/.github/workflows/add-mypy-version.yml b/.github/workflows/add-mypy-version.yml index 4cf7c4b2..c3f18f05 100644 --- a/.github/workflows/add-mypy-version.yml +++ b/.github/workflows/add-mypy-version.yml @@ -11,7 +11,7 @@ on: description: Python version required: true type: string - default: "3.12" + default: "3.13" permissions: contents: write diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd0dac3f..2ee2ca30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.12'] + python-version: ['3.13'] steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 diff --git a/.github/workflows/deploy-gcp.yml b/.github/workflows/deploy-gcp.yml index f5286686..a5f4fd38 100644 --- a/.github/workflows/deploy-gcp.yml +++ b/.github/workflows/deploy-gcp.yml @@ -15,7 +15,7 @@ on: description: Runtime version required: true type: string - default: python312 + default: python313 permissions: contents: read @@ -23,7 +23,7 @@ permissions: env: MYPY_VERSION: ${{ github.event.inputs.mypy_version || 'master' }} - RUNTIME: ${{ github.event.inputs.runtime || 'python312' }} + RUNTIME: ${{ github.event.inputs.runtime || 'python313' }} jobs: gcp-deploy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2fe2bb02..58d84ba1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: rev: 23.9.1 hooks: - id: black - language_version: python3.12 + language_version: python3.13 - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.0.292 diff --git a/app/Dockerfile b/app/Dockerfile index 9fc9daa2..86569474 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine +FROM python:3.13-alpine ENV PYTHONUNBUFFERED 1 diff --git a/app/Dockerfile-prod b/app/Dockerfile-prod index b322137c..47b43e38 100644 --- a/app/Dockerfile-prod +++ b/app/Dockerfile-prod @@ -10,7 +10,7 @@ COPY ./frontend/ /app/ RUN npm run build -FROM python:3.12-alpine +FROM python:3.13-alpine ENV PYTHONUNBUFFERED 1 diff --git a/app/config.toml b/app/config.toml index cced36c4..585643fb 100644 --- a/app/config.toml +++ b/app/config.toml @@ -1,8 +1,8 @@ debug = "1" enable-prometheus = "1" -default-python-version = "3.12" -python-versions = ["3.9", "3.10", "3.11", "3.12"] +default-python-version = "3.13" +python-versions = ["3.9", "3.10", "3.11", "3.12", "3.13"] mypy-versions = [ ["mypy latest", "latest"], ["basedmypy latest", "basedmypy-latest"], diff --git a/app/mypy_playground/app.py b/app/mypy_playground/app.py index f3920704..636b28b6 100644 --- a/app/mypy_playground/app.py +++ b/app/mypy_playground/app.py @@ -34,13 +34,25 @@ define( "default_python_version", type=str, - default="3.12", + default="3.13", help="Default Python version", ) define( "python_versions", type=str, - default=["3.12", "3.11", "3.10", "3.9", "3.8", "3.7", "3.6", "3.5", "3.4", "2.7"], + default=[ + "3.13", + "3.12", + "3.11", + "3.10", + "3.9", + "3.8", + "3.7", + "3.6", + "3.5", + "3.4", + "2.7", + ], multiple=True, help="Python versions", ) diff --git a/app/pyproject.toml b/app/pyproject.toml index 32cae727..6a07a129 100644 --- a/app/pyproject.toml +++ b/app/pyproject.toml @@ -1,5 +1,5 @@ [tool.mypy] -python_version = '3.12' +python_version = '3.13' strict = true [[tool.mypy.overrides]] diff --git a/app/requirements.dev.txt b/app/requirements.dev.txt index 96422d43..744eb2d2 100644 --- a/app/requirements.dev.txt +++ b/app/requirements.dev.txt @@ -1,65 +1,65 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile requirements.dev.in -# -build==1.0.3 +# This file was autogenerated by uv via the following command: +# uv pip compile requirements.dev.in +build==1.2.2.post1 # via pip-tools click==8.1.7 # via pip-tools -coverage[toml]==7.2.7 +coverage==7.6.4 # via pytest-cov iniconfig==2.0.0 # via pytest -mypy==1.4.1 +mypy==1.13.0 # via -r requirements.dev.in mypy-extensions==1.0.0 # via mypy -packaging==23.1 +packaging==24.1 # via # build # pytest -pip-tools==7.3.0 +pip==24.3.1 + # via pip-tools +pip-tools==7.4.1 # via -r requirements.dev.in -pluggy==1.2.0 +pluggy==1.5.0 # via pytest -pyproject-hooks==1.0.0 - # via build -pytest==7.4.0 +pyproject-hooks==1.2.0 + # via + # build + # pip-tools +pytest==8.3.3 # via # -r requirements.dev.in # pytest-cov # pytest-mock # pytest-randomly # pytest-tornado -pytest-cov==4.1.0 +pytest-cov==6.0.0 # via -r requirements.dev.in -pytest-mock==3.11.1 +pytest-mock==3.14.0 # via -r requirements.dev.in -pytest-randomly==3.12.0 +pytest-randomly==3.16.0 # via -r requirements.dev.in pytest-tornado==0.8.1 # via -r requirements.dev.in +setuptools==75.3.0 + # via + # pip-tools + # pytest-tornado tornado==6.4.1 # via # -c requirements.txt # pytest-tornado types-chardet==5.0.4.6 # via -r requirements.dev.in -types-mock==5.0.0.7 +types-mock==5.1.0.20240425 # via -r requirements.dev.in -types-setuptools==68.0.0.0 +types-setuptools==75.3.0.20241107 # via -r requirements.dev.in -types-toml==0.10.8.6 +types-toml==0.10.8.20240310 # via -r requirements.dev.in typing-extensions==4.7.0 # via # -c requirements.txt # mypy -wheel==0.41.2 +wheel==0.44.0 # via pip-tools - -# The following packages are considered to be unsafe in a requirements file: -# pip -# setuptools diff --git a/app/requirements.txt b/app/requirements.txt index 5876d295..bca4fc56 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,64 +1,56 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile -# -aiodocker==0.21.0 +# This file was autogenerated by uv via the following command: +# uv pip compile requirements.in +aiodocker==0.23.0 # via -r requirements.in -aiohappyeyeballs==2.3.5 +aiohappyeyeballs==2.4.3 # via aiohttp -aiohttp==3.10.2 +aiohttp==3.10.10 # via aiodocker aiosignal==1.3.1 # via aiohttp -attrs==23.1.0 +attrs==24.2.0 # via aiohttp -cachetools==5.3.1 +cachetools==5.5.0 # via google-auth -certifi==2024.7.4 +certifi==2024.8.30 # via requests -charset-normalizer==3.1.0 +charset-normalizer==3.4.0 # via requests -dataclasses==0.6 +dataclasses==0.8 # via -r requirements.in -frozenlist==1.4.1 +frozenlist==1.5.0 # via # aiohttp # aiosignal -google-auth==2.21.0 +google-auth==2.36.0 # via -r requirements.in -idna==3.7 +idna==3.10 # via # requests # yarl -multidict==6.0.4 +multidict==6.1.0 # via # aiohttp # yarl -prometheus-client==0.17.0 +prometheus-client==0.21.0 # via -r requirements.in -pyasn1==0.5.0 +propcache==0.2.0 + # via yarl +pyasn1==0.6.1 # via # pyasn1-modules # rsa -pyasn1-modules==0.3.0 +pyasn1-modules==0.4.1 # via google-auth -requests==2.32.0 +requests==2.32.3 # via -r requirements.in rsa==4.9 # via google-auth -six==1.16.0 - # via google-auth -tomli==2.0.1 +tomli==2.0.2 # via -r requirements.in tornado==6.4.1 # via -r requirements.in -typing-extensions==4.7.0 - # via aiodocker -urllib3==1.26.19 - # via - # google-auth - # requests -yarl==1.9.2 +urllib3==2.2.3 + # via requests +yarl==1.17.1 # via aiohttp diff --git a/app/setup.cfg b/app/setup.cfg index 2be50c2d..59e33256 100644 --- a/app/setup.cfg +++ b/app/setup.cfg @@ -2,12 +2,12 @@ envlist = mypy pre-commit - py311 + py313 skipsdist = true [gh-actions] python = - 3.12: mypy, pre-commit, py312 + 3.13: mypy, pre-commit, py313 [testenv] deps = diff --git a/sandbox/README.md b/sandbox/README.md index 135758b3..2a3ef6a1 100644 --- a/sandbox/README.md +++ b/sandbox/README.md @@ -18,7 +18,7 @@ $ ./update_latest.sh 0.930 ### Deploy to Cloud Functions ```console -$ RUNTIME=python311 REGION=us-central1 INVOKER_MEMBER=serviceAccount:... SERVICE_ACCOUNT=... ./deploy.sh latest +$ RUNTIME=python313 REGION=us-central1 INVOKER_MEMBER=serviceAccount:... SERVICE_ACCOUNT=... ./deploy.sh latest ``` ### Build all Docker images diff --git a/sandbox/add_version.sh b/sandbox/add_version.sh index 7324335d..e58ca10f 100755 --- a/sandbox/add_version.sh +++ b/sandbox/add_version.sh @@ -36,7 +36,7 @@ mkdir "$docker_dir" cd "$docker_dir" cp "${cloud_functions_dir}/requirements.in" ./ cp "${cloud_functions_dir}/requirements.txt" ./ -echo 'FROM python:3.12-slim +echo 'FROM python:3.13-slim WORKDIR /tmp COPY ./requirements.txt /tmp/ diff --git a/sandbox/cloud_functions/deploy.sh b/sandbox/cloud_functions/deploy.sh index bd211f73..4de8b259 100755 --- a/sandbox/cloud_functions/deploy.sh +++ b/sandbox/cloud_functions/deploy.sh @@ -7,7 +7,7 @@ cd "$(dirname "$0")" : "${MAX_INSTANCES:=3}" : "${MEMORY:=1024MB}" : "${REGION:=asia-northeast1}" -: "${RUNTIME:=python311}" +: "${RUNTIME:=python313}" deploy() { VERSION="$1"