Skip to content

Commit d8e56e1

Browse files
committed
build: Use Python 3.14 in Docker image and drop 3.9 support
1 parent e39bae6 commit d8e56e1

File tree

22 files changed

+461
-697
lines changed

22 files changed

+461
-697
lines changed

.github/actions/python-package-build/action.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,19 @@ runs:
4040
id: build
4141
shell: bash
4242
run: |
43-
uv build
43+
uv build --python ${{ inputs.python-version }}
4444
4545
# Set outputs
4646
WHEEL_FILE=$(ls dist/*.whl | head -1)
4747
echo "wheel-file=$WHEEL_FILE" >> $GITHUB_OUTPUT
4848
echo "dist-path=dist" >> $GITHUB_OUTPUT
4949
echo "Built wheel: $WHEEL_FILE"
5050
51-
- name: Install the built wheel
52-
shell: bash
53-
run: |
54-
uv venv
55-
uv pip install "${{ steps.build.outputs.wheel-file }}"
56-
5751
- name: Test package as CLI tool
5852
if: inputs.test-package == 'true'
5953
shell: bash
6054
run: |
55+
uv venv --python ${{ inputs.python-version }}
6156
uv pip install "${{ steps.build.outputs.wheel-file }}[cli]"
6257
uv run ${{ inputs.cli-test-command }}
6358

.github/workflows/build-test-python.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ jobs:
2424
test-package: "true"
2525
uv-version: "0.8.22"
2626
cli-test-command: "twyn --version"
27+
python-version: "3.10"

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
2020

2121
- name: Install the project
22-
run: uv sync --locked --group dev
22+
run: uv sync --locked --group dev --python 3.10
2323

2424
- name: Cache mypy cache
2525
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.1

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
publish: "false"
3030
uv-version: ${{ env.UV_VERSION }}
3131
cli-test-command: "twyn --version"
32+
python-version: "3.10"
3233

3334
- name: Upload package artifacts
3435
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.9", "3.13"]
18+
python-version: ["3.10", "3.14"]
1919
runs-on: [ubuntu-latest]
2020
steps:
2121
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PYTHON_IMAGE=3.13-slim@sha256:1020ca463dc51c26bbad49de85dbb2986d93b71050102f3fa2a7f0fc4c2ea81e
1+
ARG PYTHON_IMAGE=3.14-slim@sha256:4ed33101ee7ec299041cc41dd268dae17031184be94384b1ce7936dc4e5dead3
22

33
# --------------- `base` stage ---------------
44
FROM python:${PYTHON_IMAGE} AS base

dependencies/scripts/download_packages.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import json
22
import logging
3+
from collections.abc import Callable
34
from dataclasses import dataclass
45
from datetime import datetime
56
from pathlib import Path
6-
from typing import Any, Callable, Optional
7+
from typing import Any
78
from zoneinfo import ZoneInfo
89

910
import click
@@ -33,8 +34,8 @@ class ServerError(Exception):
3334
@dataclass(frozen=True)
3435
class Ecosystem:
3536
url: str
36-
params: Optional[dict[str, Any]]
37-
pages: Optional[int]
37+
params: dict[str, Any] | None
38+
pages: int | None
3839
parser: Callable[[dict[str, Any]], list[str]]
3940

4041

@@ -88,7 +89,7 @@ def download(
8889

8990

9091
def get_packages(
91-
base_url: str, parser: Callable[[dict[str, Any]], list[str]], params: Optional[dict[str, Any]] = None
92+
base_url: str, parser: Callable[[dict[str, Any]], list[str]], params: dict[str, Any] | None = None
9293
) -> list[str]:
9394
for attempt in stamina.retry_context(
9495
on=(httpx.TransportError, httpx.TimeoutException, ServerError),

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# VARIABLE DEFINITIONS
22
venv := ".venv"
3-
python_version :="3.13"
3+
python_version :="3.14"
44
run := "uv run"
55

66
venv-exists := path_exists(venv)

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ maintainers = [
99
{ name = "Daniel Sanz", email = "[email protected]" },
1010
{ name = "Sergio Castillo", email = "[email protected]" },
1111
]
12-
requires-python = "<4,>=3.9"
12+
requires-python = "<4,>=3.10"
1313
dependencies = [
1414
"requests<3.0.0,>=2.32.4",
1515
"rapidfuzz<4.0.0,>=2.13.7",
1616
"pyparsing<4.0.0,>=3.2.3",
1717
"tomlkit<0.14.0,>=0.11.6",
18-
"tomli<3.0.0,>=2.2.1; python_version < \"3.13\"",
1918
"pydantic>=2.11.7,<3.0.0",
2019
"pyyaml>=6.0.2",
2120
]
@@ -70,7 +69,7 @@ requires = ["hatchling"]
7069
build-backend = "hatchling.build"
7170

7271
[tool.ruff]
73-
target-version = "py39"
72+
target-version = "py310"
7473
line-length = 120
7574

7675
src = ["twyn", "tests"]
@@ -115,7 +114,7 @@ ignore = [
115114
convention = "pep257"
116115

117116
[tool.mypy]
118-
python_version = "3.9"
117+
python_version = "3.10"
119118
ignore_missing_imports = true
120119
namespace_packages = true
121120
explicit_package_bases = true

src/twyn/base/constants.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Literal
4-
5-
from typing_extensions import TypeAlias
3+
from typing import TYPE_CHECKING, Literal, TypeAlias
64

75
from twyn import dependency_parser
86
from twyn.trusted_packages import selectors

0 commit comments

Comments
 (0)