Skip to content

Commit dc13d34

Browse files
authored
feat: update python version to 3.14 (#36)
* feat: update python version to 3.14 * ci: update the release please version
1 parent 2078a59 commit dc13d34

File tree

8 files changed

+406
-326
lines changed

8 files changed

+406
-326
lines changed

.github/workflows/lint-and-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313
steps:
1414
- name: Install system dependencies
1515
run: sudo apt update && sudo apt install --no-install-recommends -y make git
16-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v5
1717
- uses: actions/cache@v4
1818
with:
1919
path: ~/.cache
20-
key: self-runner-${{ runner.os }}-python-3.13-${{ hashFiles('uv.lock') }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
21-
- name: Set up Python 3.13
22-
uses: actions/setup-python@v5
20+
key: self-runner-${{ runner.os }}-python-3.14-${{ hashFiles('uv.lock') }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }}
21+
- name: Set up Python 3.14
22+
uses: actions/setup-python@v6
2323
with:
24-
python-version: "3.13"
24+
python-version: "3.14"
2525
- name: Install dependencies
2626
run: |
2727
python -m pip install --upgrade pip

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
needs: build
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: GoogleCloudPlatform/release-please-action@v3
19+
- uses: googleapis/release-please-action@v4
2020
with:
2121
token: ${{ secrets.GITHUB_TOKEN }}
2222
release-type: simple

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v5.0.0
3+
rev: v6.0.0
44
hooks:
55
- id: check-ast
66
- id: fix-byte-order-marker
@@ -18,7 +18,7 @@ repos:
1818
- id: trailing-whitespace
1919

2020
- repo: https://github.com/astral-sh/ruff-pre-commit
21-
rev: v0.11.4
21+
rev: v0.14.1
2222
hooks:
2323
- id: ruff
2424
- id: ruff-format

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##### Base Stage #####
2-
FROM python:3.13-slim-bookworm AS base
2+
FROM python:3.14-slim-bookworm AS base
33

44
# Set default path
55
ENV PATH="/app/.venv/bin:${PATH}"
@@ -22,6 +22,9 @@ COPY secure_qrcode ./secure_qrcode
2222
COPY templates ./templates
2323
COPY static ./static
2424

25+
# Compile all Python source files to bytecode
26+
RUN python -m compileall -f .
27+
2528
##### Final Stage #####
2629
FROM base
2730

pyproject.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ name = "secure-qrcode"
33
version = "0.1.0"
44
description = "Encrypt your data using the modern ChaCha20-Poly1305 cipher and export it into a secure QR code"
55
readme = "README.md"
6-
requires-python = ">=3.13,<3.14"
6+
requires-python = ">=3.14,<3.15"
77
dependencies = [
8-
"cryptography>=44.0.2",
9-
"fastapi>=0.114.2",
10-
"jinja2>=3.1.4",
11-
"pydantic-settings>=2.5.2",
12-
"qrcode[pil]>=7.4.2",
13-
"uvicorn[standard]>=0.30.6",
8+
"cryptography>=46.0.3,<47",
9+
"fastapi>=0.119.0,<1",
10+
"jinja2>=3.1.6,<4",
11+
"pydantic-settings>=2.11.0,<3",
12+
"qrcode[pil]>=8.2,<9",
13+
"uvicorn[standard]>=0.37.0,<1",
1414
]
1515

16-
[tool.uv]
17-
dev-dependencies = [
18-
"httpx>=0.27.2",
19-
"pre-commit>=3.8.0",
20-
"pytest-cov>=5.0.0",
21-
"pytest>=8.3.3",
16+
[dependency-groups]
17+
dev = [
18+
"httpx>=0.28.1",
19+
"pre-commit>=4.3.0",
20+
"pytest-cov>=7.0.0",
21+
"pytest>=8.4.2",
2222
]
2323

2424
[tool.pytest.ini_options]
25-
minversion = "8.2"
25+
minversion = "8.4"
2626
addopts = "-vvv --cov=secure_qrcode --cov-report=term-missing"

ruff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ line-ending = "auto"
2121
# "F": Pyflakes https://docs.astral.sh/ruff/rules/#pyflakes-f
2222
# "E", "W": pycodestyle https://docs.astral.sh/ruff/rules/#pycodestyle-e-w
2323
# "I": isort https://docs.astral.sh/ruff/rules/#isort-i
24+
# "B": bugbear https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
2425
[lint]
25-
select = ["UP", "F", "E", "W", "I"]
26+
select = ["UP", "F", "E", "W", "I", "B"]
2627
ignore = ["E203", "E501"]
2728

2829
# Isort config.

secure_qrcode/crypto.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ def decrypt(encrypted_data: EncryptedData, key: str) -> str:
4949

5050
try:
5151
plaintext = chacha.decrypt(nonce, ciphertext, associated_data)
52-
except InvalidTag:
53-
raise DecryptError("Incorrect decryption, exc=Invalid Tag")
52+
except InvalidTag as exc:
53+
raise DecryptError("Incorrect decryption, exc=Invalid Tag") from exc
5454
except Exception as exc:
55-
raise DecryptError(f"Incorrect decryption, exc={exc}")
55+
raise DecryptError(f"Incorrect decryption, exc={exc}") from exc
5656

5757
return plaintext.decode("utf-8")

uv.lock

Lines changed: 375 additions & 299 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)