From d8a6b91b77a2064af543ad88bd5197d214a1e697 Mon Sep 17 00:00:00 2001 From: Yusuke Miyazaki Date: Thu, 7 Nov 2024 16:14:22 +1000 Subject: [PATCH] Merge pull request #549 from ymyzk/dependabot/github_actions/google-github-actions/auth-2 Bump google-github-actions/auth from 1 to 2 --- .github/workflows/add-mypy-version.yml | 2 +- .github/workflows/ci.yml | 2 +- .github/workflows/deploy-gcp.yml | 2 +- .pre-commit-config.yaml | 2 +- app/Dockerfile | 2 +- app/Dockerfile-prod | 2 +- app/config.toml | 4 ++-- app/mypy_playground/app.py | 16 ++++++++++++++-- app/mypy_playground/utils.py | 4 ++-- app/pyproject.toml | 2 +- app/requirements.in | 2 -- app/requirements.txt | 8 ++------ app/setup.cfg | 6 +++--- sandbox/README.md | 2 +- sandbox/add_version.sh | 2 +- sandbox/cloud_functions/deploy.sh | 2 +- 16 files changed, 33 insertions(+), 27 deletions(-) diff --git a/.github/workflows/add-mypy-version.yml b/.github/workflows/add-mypy-version.yml index 5807c739..1728b0e2 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 5c64c76e..782a867e 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..82aaa89d 100644 --- a/.github/workflows/deploy-gcp.yml +++ b/.github/workflows/deploy-gcp.yml @@ -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 800bda13..621989af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: rev: 24.10.0 hooks: - id: black - language_version: python3.12 + language_version: python3.13 - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.8.2 diff --git a/app/Dockerfile b/app/Dockerfile index f99288ec..47d3eefc 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 210fe385..cec0be1d 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/mypy_playground/utils.py b/app/mypy_playground/utils.py index 143aefe4..d5f92990 100644 --- a/app/mypy_playground/utils.py +++ b/app/mypy_playground/utils.py @@ -2,7 +2,7 @@ from pathlib import Path from typing import Any, cast -import tomli +import tomllib from tornado.options import options @@ -73,7 +73,7 @@ def parse_toml_file(path: Path) -> None: if not path.is_file(): return with open(path, "rb") as f: - config = tomli.load(f) + config = tomllib.load(f) for option_name in options._options: value = config.get(option_name) if value is None: diff --git a/app/pyproject.toml b/app/pyproject.toml index 7a4ab925..411e2dd7 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.in b/app/requirements.in index 1d9b198c..37e22908 100644 --- a/app/requirements.in +++ b/app/requirements.in @@ -1,7 +1,5 @@ aiodocker>=0.13.0,<1.0 -dataclasses google-auth prometheus_client<1 requests # Until google-auth supports asyncio -tomli tornado>=6,<7 diff --git a/app/requirements.txt b/app/requirements.txt index ca749d4c..fc2c9276 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.13 # by the following command: # # pip-compile @@ -20,13 +20,11 @@ certifi==2024.8.30 # via requests charset-normalizer==3.4.0 # via requests -dataclasses==0.6 - # via -r requirements.in frozenlist==1.5.0 # via # aiohttp # aiosignal -google-auth==2.36.0 +google-auth==2.37.0 # via -r requirements.in idna==3.10 # via @@ -52,8 +50,6 @@ requests==2.32.3 # via -r requirements.in rsa==4.9 # via google-auth -tomli==2.2.1 - # via -r requirements.in tornado==6.4.2 # via -r requirements.in urllib3==2.2.3 diff --git a/app/setup.cfg b/app/setup.cfg index 2be50c2d..94599ce8 100644 --- a/app/setup.cfg +++ b/app/setup.cfg @@ -2,18 +2,18 @@ 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 = -r {toxinidir}/requirements.txt -r {toxinidir}/requirements.dev.txt -commands = pytest --cov=mypy_playground tests +commands = python -m pytest --cov=mypy_playground tests [testenv:mypy] commands = mypy . diff --git a/sandbox/README.md b/sandbox/README.md index 135758b3..2460bc20 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=python312 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..e0d2865e 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:=python312}" deploy() { VERSION="$1"