Skip to content

Commit 7f5d6f7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into pin-actions-by-sha
2 parents dcc780e + bba8d07 commit 7f5d6f7

File tree

12 files changed

+108
-18
lines changed

12 files changed

+108
-18
lines changed

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,23 @@ repos:
4747
language: unsupported
4848
pass_filenames: false
4949

50+
- id: local-ty
51+
name: ty check
52+
entry: uv run ty check backend/app
53+
require_serial: true
54+
language: unsupported
55+
pass_filenames: false
56+
5057
- id: generate-frontend-sdk
5158
name: Generate Frontend SDK
5259
entry: bash ./scripts/generate-client.sh
5360
pass_filenames: false
5461
language: unsupported
5562
files: ^backend/.*$|^scripts/generate-client\.sh$
63+
64+
- id: add-release-date
65+
language: unsupported
66+
name: add date to latest release header
67+
entry: uv run python scripts/add_latest_release_date.py
68+
files: ^release-notes\.md$
69+
pass_filenames: false

backend/app/alembic/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def run_migrations_online():
6363
6464
"""
6565
configuration = config.get_section(config.config_ini_section)
66+
assert configuration is not None
6667
configuration["sqlalchemy.url"] = get_url()
6768
connectable = engine_from_config(
6869
configuration,

backend/app/alembic/versions/1a31ce608336_add_cascade_delete_relationships.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def upgrade():
2929

3030
def downgrade():
3131
# ### commands auto generated by Alembic - please adjust! ###
32-
op.drop_constraint(None, 'item', type_='foreignkey')
32+
op.drop_constraint('item_owner_id_fkey', 'item', type_='foreignkey')
3333
op.create_foreign_key('item_owner_id_fkey', 'item', 'user', ['owner_id'], ['id'])
3434
op.alter_column('item', 'owner_id',
3535
existing_type=sa.UUID(),

backend/app/api/routes/items.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def read_items(
4141
)
4242
items = session.exec(statement).all()
4343

44-
return ItemsPublic(data=items, count=count)
44+
items_public = [ItemPublic.model_validate(item) for item in items]
45+
return ItemsPublic(data=items_public, count=count)
4546

4647

4748
@router.get("/{id}", response_model=ItemPublic)

backend/app/api/routes/users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def read_users(session: SessionDep, skip: int = 0, limit: int = 100) -> Any:
4747
)
4848
users = session.exec(statement).all()
4949

50-
return UsersPublic(data=users, count=count)
50+
users_public = [UserPublic.model_validate(user) for user in users]
51+
return UsersPublic(data=users_public, count=count)
5152

5253

5354
@router.post(

backend/app/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class UserRegister(SQLModel):
3131

3232
# Properties to receive via API on update, all are optional
3333
class UserUpdate(UserBase):
34-
email: EmailStr | None = Field(default=None, max_length=255) # type: ignore
34+
email: EmailStr | None = Field(default=None, max_length=255) # type: ignore[assignment]
3535
password: str | None = Field(default=None, min_length=8, max_length=128)
3636

3737

@@ -80,7 +80,7 @@ class ItemCreate(ItemBase):
8080

8181
# Properties to receive on item update
8282
class ItemUpdate(ItemBase):
83-
title: str | None = Field(default=None, min_length=1, max_length=255) # type: ignore
83+
title: str | None = Field(default=None, min_length=1, max_length=255) # type: ignore[assignment]
8484

8585

8686
# Database model, database table inferred from class name

backend/app/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pathlib import Path
55
from typing import Any
66

7-
import emails # type: ignore
7+
import emails # type: ignore[import-untyped]
88
import jwt
99
from jinja2 import Template
1010
from jwt.exceptions import InvalidTokenError

backend/pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dependencies = [
2525
dev = [
2626
"pytest<8.0.0,>=7.4.3",
2727
"mypy<2.0.0,>=1.8.0",
28+
"ty>=0.0.25",
2829
"ruff<1.0.0,>=0.2.2",
2930
"prek>=0.2.24,<1.0.0",
3031
"coverage<8.0.0,>=7.4.3",
@@ -75,3 +76,6 @@ sort = "-Cover"
7576

7677
[tool.coverage.html]
7778
show_contexts = true
79+
80+
[tool.ty.terminal]
81+
error-on-warning = true

backend/scripts/lint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ set -e
44
set -x
55

66
mypy app
7+
ty check app
78
ruff check app
89
ruff format app --check

release-notes.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
### Internal
1919

20+
* 🔨 Add pre-commit hook to ensure latest release header has date. PR [#2205](https://github.com/fastapi/full-stack-fastapi-template/pull/2205) by [@YuriiMotov](https://github.com/YuriiMotov).
21+
* 👷 Add `ty` to precommit. PR [#2227](https://github.com/fastapi/full-stack-fastapi-template/pull/2227) by [@svlandeg](https://github.com/svlandeg).
2022
* ⬆ Bump dorny/paths-filter from 3 to 4. PR [#2230](https://github.com/fastapi/full-stack-fastapi-template/pull/2230) by [@dependabot[bot]](https://github.com/apps/dependabot).
2123
* ⬆ Bump pyjwt from 2.10.1 to 2.12.0. PR [#2231](https://github.com/fastapi/full-stack-fastapi-template/pull/2231) by [@dependabot[bot]](https://github.com/apps/dependabot).
2224
* ⬆ Bump @types/node from 25.3.2 to 25.5.0. PR [#2233](https://github.com/fastapi/full-stack-fastapi-template/pull/2233) by [@dependabot[bot]](https://github.com/apps/dependabot).
@@ -51,7 +53,7 @@
5153
* ⬆ Bump @types/node from 25.0.9 to 25.0.10. PR [#2149](https://github.com/fastapi/full-stack-fastapi-template/pull/2149) by [@dependabot[bot]](https://github.com/apps/dependabot).
5254
* ⬆ Bump @tanstack/react-router-devtools from 1.153.2 to 1.156.0. PR [#2147](https://github.com/fastapi/full-stack-fastapi-template/pull/2147) by [@dependabot[bot]](https://github.com/apps/dependabot).
5355

54-
## 0.10.0
56+
## 0.10.0 (2026-01-23)
5557

5658
### Features
5759

@@ -122,7 +124,7 @@
122124
* ⬆ Bump vite from 7.2.7 to 7.3.0 in /frontend. PR [#2047](https://github.com/fastapi/full-stack-fastapi-template/pull/2047) by [@dependabot[bot]](https://github.com/apps/dependabot).
123125
* ⬆ Bump react-dom from 19.2.1 to 19.2.3 in /frontend. PR [#2046](https://github.com/fastapi/full-stack-fastapi-template/pull/2046) by [@dependabot[bot]](https://github.com/apps/dependabot).
124126

125-
## 0.9.0
127+
## 0.9.0 (2025-12-08)
126128

127129
### Features
128130

@@ -306,7 +308,7 @@
306308
* ⬆ Bump astral-sh/setup-uv from 5 to 6. PR [#1566](https://github.com/fastapi/full-stack-fastapi-template/pull/1566) by [@dependabot[bot]](https://github.com/apps/dependabot).
307309
* 🔧 Add npm and docker package ecosystems to Dependabot configuration. PR [#1535](https://github.com/fastapi/full-stack-fastapi-template/pull/1535) by [@alejsdev](https://github.com/alejsdev).
308310

309-
## 0.8.0
311+
## 0.8.0 (2025-02-19)
310312

311313
### Features
312314

@@ -366,7 +368,7 @@
366368
* 👷 Tweak generate client to error out if there are errors. PR [#1377](https://github.com/fastapi/full-stack-fastapi-template/pull/1377) by [@tiangolo](https://github.com/tiangolo).
367369
* 👷 Generate and commit client only on same repo PRs, on forks, show the error. PR [#1376](https://github.com/fastapi/full-stack-fastapi-template/pull/1376) by [@tiangolo](https://github.com/tiangolo).
368370

369-
## 0.7.1
371+
## 0.7.1 (2024-09-27)
370372

371373
### Highlights
372374

@@ -429,7 +431,7 @@
429431
* 👷 Add GitHub Action add-to-project. PR [#1297](https://github.com/fastapi/full-stack-fastapi-template/pull/1297) by [@tiangolo](https://github.com/tiangolo).
430432
* 👷 Update issue-manager. PR [#1288](https://github.com/fastapi/full-stack-fastapi-template/pull/1288) by [@tiangolo](https://github.com/tiangolo).
431433

432-
## 0.7.0
434+
## 0.7.0 (2024-08-02)
433435

434436
Lots of new things! 🎁
435437

@@ -574,7 +576,7 @@ Lots of new things! 🎁
574576
* 🔥 Delete leftover celery file. PR [#727](https://github.com/tiangolo/full-stack-fastapi-template/pull/727) by [@dr-neptune](https://github.com/dr-neptune).
575577
* ⚙️ Update pre-commit config with Prettier and ESLint. PR [#714](https://github.com/tiangolo/full-stack-fastapi-template/pull/714) by [@alejsdev](https://github.com/alejsdev).
576578

577-
## 0.6.0
579+
## 0.6.0 (2024-03-12)
578580

579581
Latest FastAPI, Pydantic, SQLModel 🚀
580582

@@ -758,7 +760,7 @@ Test cov > 90% ✅
758760
* Add [GitHub Sponsors](https://github.com/sponsors/tiangolo) button. PR [#201](https://github.com/tiangolo/full-stack-fastapi-template/pull/201).
759761
* Simplify scripts and development, update docs and configs. PR [#155](https://github.com/tiangolo/full-stack-fastapi-template/pull/155).
760762

761-
## 0.5.0
763+
## 0.5.0 (2020-04-19)
762764

763765
* Make the Traefik public network a fixed default of `traefik-public` as done in DockerSwarm.rocks, to simplify development and iteration of the project generator. PR [#150](https://github.com/tiangolo/full-stack-fastapi-template/pull/150).
764766
* Update to PostgreSQL 12. PR [#148](https://github.com/tiangolo/full-stack-fastapi-template/pull/148). by [@RCheese](https://github.com/RCheese).
@@ -783,7 +785,7 @@ Test cov > 90% ✅
783785
* Add new CRUD utils based on DB and Pydantic models. Initial PR [#23](https://github.com/tiangolo/full-stack-fastapi-template/pull/23) by [@ebreton](https://github.com/ebreton).
784786
* Add normal user testing Pytest fixture. PR [#20](https://github.com/tiangolo/full-stack-fastapi-template/pull/20) by [@ebreton](https://github.com/ebreton).
785787

786-
## 0.4.0
788+
## 0.4.0 (2019-05-29)
787789

788790
* Fix security on resetting a password. Receive token as body, not query. PR [#34](https://github.com/tiangolo/full-stack-fastapi-template/pull/34).
789791

@@ -805,7 +807,7 @@ Test cov > 90% ✅
805807

806808
* Update Jupyter Lab installation and util script/environment variable for local development.
807809

808-
## 0.3.0
810+
## 0.3.0 (2019-04-19)
809811

810812
* PR <a href="https://github.com/tiangolo/full-stack-fastapi-template/pull/14" target="_blank">#14</a>:
811813
* Update CRUD utils to use types better.
@@ -820,19 +822,19 @@ Test cov > 90% ✅
820822

821823
* Upgrade Python to 3.7 as Celery is now compatible too. PR <a href="https://github.com/tiangolo/full-stack-fastapi-template/pull/10" target="_blank">#10</a> by <a href="https://github.com/ebreton" target="_blank">@ebreton</a>.
822824

823-
## 0.2.2
825+
## 0.2.2 (2019-04-11)
824826

825827
* Fix frontend hijacking /docs in development. Using latest https://github.com/tiangolo/node-frontend with custom Nginx configs in frontend. <a href="https://github.com/tiangolo/full-stack-fastapi-template/pull/6" target="_blank">PR #6</a>.
826828

827-
## 0.2.1
829+
## 0.2.1 (2019-03-29)
828830

829831
* Fix documentation for *path operation* to get user by ID. <a href="https://github.com/tiangolo/full-stack-fastapi-template/pull/4" target="_blank">PR #4</a> by <a href="https://github.com/mpclarkson" target="_blank">@mpclarkson</a> in FastAPI.
830832

831833
* Set `/start-reload.sh` as a command override for development by default.
832834

833835
* Update generated README.
834836

835-
## 0.2.0
837+
## 0.2.0 (2019-03-11)
836838

837839
**<a href="https://github.com/tiangolo/full-stack-fastapi-template/pull/2" target="_blank">PR #2</a>**:
838840

0 commit comments

Comments
 (0)