diff --git a/.github/workflows/i18n.yml b/.github/workflows/i18n.yml index b487c37df..f513c62d0 100644 --- a/.github/workflows/i18n.yml +++ b/.github/workflows/i18n.yml @@ -15,10 +15,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Run localization check run: python frontend/src/locales/check_i18n_locales.py diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f9deec872..4d54dc469 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -42,10 +42,10 @@ jobs: run: | pipx install poetry - - name: Set up Python 3.12 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" cache: "poetry" - name: Install dependencies diff --git a/.python-version b/.python-version index e4fba2183..24ee5b1be 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.12 +3.13 diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 02a0b06db..8497af79d 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -7,14 +7,14 @@ cli: plugins: sources: - id: trunk - ref: v1.7.0 + ref: v1.7.1 uri: https://github.com/trunk-io/plugins # Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) runtimes: enabled: - go@1.21.0 - node@22.16.0 - - python@3.12.2 + - python@3.13.3 # This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) lint: disabled: diff --git a/Dockerfile b/Dockerfile index 97ff1c8bb..e002d094d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,8 +67,8 @@ RUN npm install # Set working directory WORKDIR /app -# Install Python 3.12 -RUN pyenv install 3.12 && pyenv global 3.12 +# Install Python 3.13 +RUN pyenv install 3.13 && pyenv global 3.13 # Install pipx and poetry for the non-root user RUN pip3 install pipx poetry \ diff --git a/backend/main.py b/backend/main.py index e55ba5d07..597e80e8d 100644 --- a/backend/main.py +++ b/backend/main.py @@ -54,7 +54,7 @@ logging.config.dictConfig(LOGGING_CONFIG) @asynccontextmanager -async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: +async def lifespan(app: FastAPI) -> AsyncGenerator[None]: async with initialize_context(): app.state.aiohttp_session = ctx_aiohttp_session.get() app.state.httpx_client = ctx_httpx_client.get() diff --git a/backend/utils/context.py b/backend/utils/context.py index bc8835174..5d0f2bb21 100644 --- a/backend/utils/context.py +++ b/backend/utils/context.py @@ -14,9 +14,7 @@ ctx_httpx_client: ContextVar[httpx.AsyncClient] = ContextVar("httpx_client") @asynccontextmanager -async def set_context_var( - var: ContextVar[_T], value: _T -) -> AsyncGenerator[Token[_T], None]: +async def set_context_var(var: ContextVar[_T], value: _T) -> AsyncGenerator[Token[_T]]: """Temporarily set a context variables.""" token = var.set(value) yield token @@ -24,7 +22,7 @@ async def set_context_var( @asynccontextmanager -async def initialize_context() -> AsyncGenerator[None, None]: +async def initialize_context() -> AsyncGenerator[None]: """Initialize context variables.""" async with ( aiohttp.ClientSession() as aiohttp_session, diff --git a/docker/Dockerfile b/docker/Dockerfile index 5a8fa9b65..fd70f13eb 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,7 +15,7 @@ ARG ALPINE_VERSION=3.22 ARG NGINX_VERSION=1.29.0 ARG NODE_VERSION=20.19 -ARG PYTHON_VERSION=3.12 +ARG PYTHON_VERSION=3.13 FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS frontend-build diff --git a/frontend/src/locales/check_i18n_locales.py b/frontend/src/locales/check_i18n_locales.py index 9adaf293e..2357efd2d 100644 --- a/frontend/src/locales/check_i18n_locales.py +++ b/frontend/src/locales/check_i18n_locales.py @@ -39,10 +39,10 @@ for lang_dir in lang_dirs: en_file_path = os.path.join(en_dir, filename) lang_file_path = os.path.join(lang_dir, filename) - with open(en_file_path, "r", encoding="utf-8") as f: + with open(en_file_path, encoding="utf-8") as f: en_data = json.load(f) - with open(lang_file_path, "r", encoding="utf-8") as f: + with open(lang_file_path, encoding="utf-8") as f: lang_data = json.load(f) missing_keys = [] diff --git a/poetry.lock b/poetry.lock index 84ee2ec14..4a6eefa89 100644 --- a/poetry.lock +++ b/poetry.lock @@ -182,7 +182,6 @@ files = [ [package.dependencies] idna = ">=2.8" sniffio = ">=1.1" -typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} [package.extras] doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx_rtd_theme"] @@ -954,7 +953,7 @@ description = "Lightweight in-process concurrent programming" optional = false python-versions = ">=3.7" groups = ["main"] -markers = "python_version < \"3.14\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")" +markers = "python_version == \"3.13\" and (platform_machine == \"aarch64\" or platform_machine == \"ppc64le\" or platform_machine == \"x86_64\" or platform_machine == \"amd64\" or platform_machine == \"AMD64\" or platform_machine == \"win32\" or platform_machine == \"WIN32\")" files = [ {file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"}, {file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"}, @@ -2287,7 +2286,6 @@ files = [ [package.dependencies] psycopg-c = {version = "3.2.4", optional = true, markers = "implementation_name != \"pypy\" and extra == \"c\""} -typing-extensions = {version = ">=4.6", markers = "python_version < \"3.13\""} tzdata = {version = "*", markers = "sys_platform == \"win32\""} [package.extras] @@ -3524,7 +3522,6 @@ files = [ packaging = ">=20.0" python-dateutil = ">=2.0" sqlalchemy = ">=1.3.11" -typing-extensions = {version = ">=4.7,<5", markers = "python_version < \"3.13\""} [[package]] name = "sqlalchemy" @@ -4454,5 +4451,5 @@ test = ["fakeredis", "pytest", "pytest-asyncio", "pytest-env", "pytest-mock", "p [metadata] lock-version = "2.1" -python-versions = "^3.12" -content-hash = "94c9ec6caf38454d244fccefa6ff4222745d4adf727e11b240dc839385f94986" +python-versions = "^3.13" +content-hash = "04d856c636fd06d52c2704d9b2d649442c6a61e3e0efde0c365e0be631a2906a" diff --git a/pyproject.toml b/pyproject.toml index 69f7489fc..db23036f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [ { name = "Arcane", email = "arcane@romm.app" }, { name = "Adamantike", email = "adamantike@romm.app" }, ] -requires-python = "^3.12" +requires-python = "^3.13" dependencies = [ "PyYAML == 6.0.1", "SQLAlchemy[mariadb-connector,mysql-connector,postgresql-psycopg] ~= 2.0",