Skip to content

Commit 7fce36c

Browse files
author
Joakim Nordling
authored
Updates (#54)
Update dependencies, especially FastAPI to allow updates of starlette to version without CVE. Also updates other dependencies and GitHub actions. Drop support for Python 3.9 as it is EOL, run tests on Python 3.14, as it's now officially released. Tell datamodel-code-generator to generate models compatible with Python >=3.10 instead of 3.9.
1 parent a23d0f4 commit 7fce36c

8 files changed

Lines changed: 200 additions & 169 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout 🔁
14-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
14+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
1515

1616
- name: Set up Python 🐍
17-
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
17+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
1818
with:
19-
python-version: "3.9"
19+
python-version: "3.13"
2020

2121
- name: Install Poetry and pre-commit 💈
2222
run: pip install poetry==1.8.5 pre-commit
@@ -34,7 +34,7 @@ jobs:
3434
run: poetry build
3535

3636
- name: Publish build artifact ⬆️
37-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 #v4.3.1
37+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 #v5.0.0
3838
with:
3939
name: package-dist
4040
path: dist
@@ -48,10 +48,10 @@ jobs:
4848
id-token: write
4949
steps:
5050
- name: Download build artifact ⬇️
51-
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe #v4.1.2
51+
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 #v6.0.0
5252
with:
5353
name: package-dist
5454
path: dist
5555

5656
- name: Publish package to PyPI 🙌
57-
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf #v1.8.11
57+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e #v1.13.0

.github/workflows/test_latest_python.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
python-version: ["3.14"]
1313
steps:
1414
- name: Checkout 🔁
15-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
15+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
1616

1717
- name: Set up Python ${{ matrix.python-version }} 🐍
18-
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
18+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
allow-prereleases: true

.github/workflows/tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
13+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1414
steps:
1515
- name: Checkout 🔁
16-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
16+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
1717

1818
- name: Set up Python ${{ matrix.python-version }} 🐍
19-
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
19+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ router = SpecRouter(specs, validators=[MyValidator])
255255

256256
You will need:
257257

258-
- Python 3.9+ (tested on 3.9 - 3.13)
258+
- Python 3.10+ (tested on 3.10 - 3.13)
259259
- [pre-commit](https://pre-commit.com/#install)
260260

261261
Before working on the project, make sure you run:

openapi_to_fastapi/model_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def generate_model_from_schema(
5151
base_class="pydantic.BaseModel",
5252
custom_template_dir=None,
5353
extra_template_data=None,
54-
target_python_version=PythonVersion.PY_39,
54+
target_python_version=PythonVersion.PY_310,
5555
dump_resolve_reference_action=None,
5656
extra_fields="forbid" if strict_validation else None,
5757
strict_types=strict_types,

poetry.lock

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

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "openapi-to-fastapi"
3-
version = "0.21.0"
3+
version = "0.22.0"
44
description = "Create FastAPI routes from OpenAPI spec"
55
authors = ["IOXIO Ltd"]
66
license = "BSD-3-Clause"
@@ -14,12 +14,12 @@ packages = [
1414
openapi-validator = "openapi_to_fastapi.cli:cli_validate_specs"
1515

1616
[tool.poetry.dependencies]
17-
python = "^3.9"
18-
datamodel-code-generator = "^0.33.0"
19-
fastapi = "^0.116.1"
20-
click = "^8.1.8"
17+
python = "^3.10"
18+
datamodel-code-generator = "^0.35.0"
19+
fastapi = "^0.121.1"
20+
click = "^8.3.0"
2121
coloredlogs = "^15.0.1"
22-
pydantic = {version = "^2.11.7", extras = ["email"]}
22+
pydantic = {version = "^2.12.4", extras = ["email"]}
2323

2424
[tool.poetry.group.dev.dependencies]
2525
isort = "^5.13.2"

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ exclude = .venv,.git,.mypy_cache
2020
[mypy]
2121
warn_return_any = True
2222
ignore_missing_imports = True
23-
python_version = 3.9
23+
python_version = 3.10

0 commit comments

Comments
 (0)