mirror of
https://github.com/rommapp/romm.git
synced 2026-03-03 00:37:00 +00:00
misc: Upgrade to Python 3.13
Small changes to upgrade Python to version 3.13, and fixes based on a `pyupgrade` run using the `--py313-plus` flag.
This commit is contained in:
4
.github/workflows/i18n.yml
vendored
4
.github/workflows/i18n.yml
vendored
@@ -15,10 +15,10 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python 3.12
|
- name: Set up Python 3.13
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.13"
|
||||||
|
|
||||||
- name: Run localization check
|
- name: Run localization check
|
||||||
run: python frontend/src/locales/check_i18n_locales.py
|
run: python frontend/src/locales/check_i18n_locales.py
|
||||||
|
|||||||
4
.github/workflows/pytest.yml
vendored
4
.github/workflows/pytest.yml
vendored
@@ -42,10 +42,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pipx install poetry
|
pipx install poetry
|
||||||
|
|
||||||
- name: Set up Python 3.12
|
- name: Set up Python 3.13
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.13"
|
||||||
cache: "poetry"
|
cache: "poetry"
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
3.12
|
3.13
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ cli:
|
|||||||
plugins:
|
plugins:
|
||||||
sources:
|
sources:
|
||||||
- id: trunk
|
- id: trunk
|
||||||
ref: v1.7.0
|
ref: v1.7.1
|
||||||
uri: https://github.com/trunk-io/plugins
|
uri: https://github.com/trunk-io/plugins
|
||||||
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes)
|
||||||
runtimes:
|
runtimes:
|
||||||
enabled:
|
enabled:
|
||||||
- go@1.21.0
|
- go@1.21.0
|
||||||
- node@22.16.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)
|
# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration)
|
||||||
lint:
|
lint:
|
||||||
disabled:
|
disabled:
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ RUN npm install
|
|||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install Python 3.12
|
# Install Python 3.13
|
||||||
RUN pyenv install 3.12 && pyenv global 3.12
|
RUN pyenv install 3.13 && pyenv global 3.13
|
||||||
|
|
||||||
# Install pipx and poetry for the non-root user
|
# Install pipx and poetry for the non-root user
|
||||||
RUN pip3 install pipx poetry \
|
RUN pip3 install pipx poetry \
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ logging.config.dictConfig(LOGGING_CONFIG)
|
|||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
|
async def lifespan(app: FastAPI) -> AsyncGenerator[None]:
|
||||||
async with initialize_context():
|
async with initialize_context():
|
||||||
app.state.aiohttp_session = ctx_aiohttp_session.get()
|
app.state.aiohttp_session = ctx_aiohttp_session.get()
|
||||||
app.state.httpx_client = ctx_httpx_client.get()
|
app.state.httpx_client = ctx_httpx_client.get()
|
||||||
|
|||||||
@@ -14,9 +14,7 @@ ctx_httpx_client: ContextVar[httpx.AsyncClient] = ContextVar("httpx_client")
|
|||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def set_context_var(
|
async def set_context_var(var: ContextVar[_T], value: _T) -> AsyncGenerator[Token[_T]]:
|
||||||
var: ContextVar[_T], value: _T
|
|
||||||
) -> AsyncGenerator[Token[_T], None]:
|
|
||||||
"""Temporarily set a context variables."""
|
"""Temporarily set a context variables."""
|
||||||
token = var.set(value)
|
token = var.set(value)
|
||||||
yield token
|
yield token
|
||||||
@@ -24,7 +22,7 @@ async def set_context_var(
|
|||||||
|
|
||||||
|
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def initialize_context() -> AsyncGenerator[None, None]:
|
async def initialize_context() -> AsyncGenerator[None]:
|
||||||
"""Initialize context variables."""
|
"""Initialize context variables."""
|
||||||
async with (
|
async with (
|
||||||
aiohttp.ClientSession() as aiohttp_session,
|
aiohttp.ClientSession() as aiohttp_session,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
ARG ALPINE_VERSION=3.22
|
ARG ALPINE_VERSION=3.22
|
||||||
ARG NGINX_VERSION=1.29.0
|
ARG NGINX_VERSION=1.29.0
|
||||||
ARG NODE_VERSION=20.19
|
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
|
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS frontend-build
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ for lang_dir in lang_dirs:
|
|||||||
en_file_path = os.path.join(en_dir, filename)
|
en_file_path = os.path.join(en_dir, filename)
|
||||||
lang_file_path = os.path.join(lang_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)
|
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)
|
lang_data = json.load(f)
|
||||||
|
|
||||||
missing_keys = []
|
missing_keys = []
|
||||||
|
|||||||
9
poetry.lock
generated
9
poetry.lock
generated
@@ -182,7 +182,6 @@ files = [
|
|||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
idna = ">=2.8"
|
idna = ">=2.8"
|
||||||
sniffio = ">=1.1"
|
sniffio = ">=1.1"
|
||||||
typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""}
|
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
doc = ["Sphinx (>=7.4,<8.0)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx_rtd_theme"]
|
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
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.7"
|
||||||
groups = ["main"]
|
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 = [
|
files = [
|
||||||
{file = "greenlet-3.1.1-cp310-cp310-macosx_11_0_universal2.whl", hash = "sha256:0bbae94a29c9e5c7e4a2b7f0aae5c17e8e90acbfd3bf6270eeba60c39fce3563"},
|
{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"},
|
{file = "greenlet-3.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fde093fb93f35ca72a556cf72c92ea3ebfda3d79fc35bb19fbe685853869a83"},
|
||||||
@@ -2287,7 +2286,6 @@ files = [
|
|||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
psycopg-c = {version = "3.2.4", optional = true, markers = "implementation_name != \"pypy\" and extra == \"c\""}
|
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\""}
|
tzdata = {version = "*", markers = "sys_platform == \"win32\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
@@ -3524,7 +3522,6 @@ files = [
|
|||||||
packaging = ">=20.0"
|
packaging = ">=20.0"
|
||||||
python-dateutil = ">=2.0"
|
python-dateutil = ">=2.0"
|
||||||
sqlalchemy = ">=1.3.11"
|
sqlalchemy = ">=1.3.11"
|
||||||
typing-extensions = {version = ">=4.7,<5", markers = "python_version < \"3.13\""}
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlalchemy"
|
name = "sqlalchemy"
|
||||||
@@ -4454,5 +4451,5 @@ test = ["fakeredis", "pytest", "pytest-asyncio", "pytest-env", "pytest-mock", "p
|
|||||||
|
|
||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.1"
|
lock-version = "2.1"
|
||||||
python-versions = "^3.12"
|
python-versions = "^3.13"
|
||||||
content-hash = "94c9ec6caf38454d244fccefa6ff4222745d4adf727e11b240dc839385f94986"
|
content-hash = "04d856c636fd06d52c2704d9b2d649442c6a61e3e0efde0c365e0be631a2906a"
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ authors = [
|
|||||||
{ name = "Arcane", email = "arcane@romm.app" },
|
{ name = "Arcane", email = "arcane@romm.app" },
|
||||||
{ name = "Adamantike", email = "adamantike@romm.app" },
|
{ name = "Adamantike", email = "adamantike@romm.app" },
|
||||||
]
|
]
|
||||||
requires-python = "^3.12"
|
requires-python = "^3.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"PyYAML == 6.0.1",
|
"PyYAML == 6.0.1",
|
||||||
"SQLAlchemy[mariadb-connector,mysql-connector,postgresql-psycopg] ~= 2.0",
|
"SQLAlchemy[mariadb-connector,mysql-connector,postgresql-psycopg] ~= 2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user