Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,10 @@ This example demonstrates the seamless integration of [FastAPI](https://fastapi.
with [Pydantic 2.0](https://github.com/pydantic/pydantic), a robust and powerful data validation library.
The integration is further enhanced by the use of [SQLAlchemy ORM](https://www.sqlalchemy.org/), a popular and feature-rich Object-Relational Mapping tool,
and [PostgreSQL17](https://www.postgresql.org/docs/17/release.html) relational database.

The entire stack is connected using the [asyncpg](https://github.com/MagicStack/asyncpg) Database Client Library,
which provides a robust and efficient way to interact with PostgreSQL databases in Python,
leveraging the power of asyncio and event loops.

Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] An empty line was removed after line 50, which changes the paragraph spacing. While this is a minor formatting change, it affects readability. The removed line helped separate the discussion of the technology stack from the "Built With" section.

Copilot uses AI. Check for mistakes.
Notably, this example showcases the latest and greatest versions of SQLAlchemy and psycopg,
which are renowned for their robustness, power, and speed. The inclusion of FastAPI adds a modern, fast, and high-performance web framework to the mix
allowing for the rapid development of APIs with Python 3.13.

FastAPI has received significant recognition in the industry, including a review on thoughtworks Technology Radar in April 2021,
where it was classified as a Trial technology, with comments praising its performance, ease of use,
and features such as API documentation using OpenAPI. Additionally, FastAPI was recognized in the Python Developers Survey 2023 Results,
conducted by the Python Software Foundation and JetBrains, where it was reported that 1 in 4 Python developers use FastAPI,
with a 4 percentage point increase from the previous year.


### Built With
[![FastAPI][fastapi.tiangolo.com]][fastapi-url]
[![Pydantic][pydantic.com]][pydantic-url]
Expand Down Expand Up @@ -106,7 +94,7 @@ Next models were generated with https://github.com/agronholm/sqlacodegen

To elevate the logging capabilities beyond simple colored output,
this project has transitioned to [Rotoger](https://github.com/tinyplugins/rotoger).
This powerful library provides a comprehensive, production-ready logging setup for modern asynchronous applications,
This tiny library provides a comprehensive, production-ready logging setup for modern asynchronous applications,
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The word "powerful" has been changed to "tiny" when describing the Rotoger library. While "tiny" may be factually accurate regarding the library's size, this change could be perceived as downplaying the library's capabilities. Consider using a more balanced description like "lightweight yet comprehensive" or "compact but powerful" to maintain the positive tone while acknowledging its size.

Suggested change
This tiny library provides a comprehensive, production-ready logging setup for modern asynchronous applications,
This lightweight yet comprehensive library provides a production-ready logging setup for modern asynchronous applications,

Copilot uses AI. Check for mistakes.
addressing challenges like log management, performance, and readability.

Rotoger is built upon the excellent [structlog](http://structlog.org/) library and brings several key advantages:
Expand Down Expand Up @@ -218,7 +206,7 @@ I've included a few of my favorites to kick things off!

## Change Log
<details>
<summary>2025 (3 changes)</summary>
<summary>2025 (7 changes)</summary>
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change log summary has been updated from "3 changes" to "7 changes" in 2025, but the PR title is "bump project deps" which suggests this is primarily a dependency update. If this PR includes 4 additional changes beyond the dependency bumps, they should be documented in the change log. If not, the count should reflect only the changes actually made in this PR.

Suggested change
<summary>2025 (7 changes)</summary>
<summary>2025 (6 changes)</summary>

Copilot uses AI. Check for mistakes.
<ul>
<li>[SEP 2 2025] add sample high availability with nginx as load balancer</li>
<li>[AUG 23 2025] intro exception handlers</li>
Expand Down
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def lifespan(app: FastAPI):
def create_app() -> FastAPI:
app = FastAPI(
title="Stuff And Nonsense API",
version="0.20.0",
version="1.22.0",
lifespan=lifespan,
)
app.include_router(stuff_router)
Expand Down
61 changes: 29 additions & 32 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
[project]
name = "fastapi-sqlalchemy-asyncpg"
version = "0.22.0"
version = "1.22.0"
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The project version has been bumped from 0.22.0 to 1.22.0, which is a major version change (0.x to 1.x). This signals a major release and typically indicates breaking changes or a stable API. Ensure this version bump is intentional and follows semantic versioning principles. If this is just a dependency update without breaking API changes, consider using 0.23.0 instead.

Suggested change
version = "1.22.0"
version = "0.23.0"

Copilot uses AI. Check for mistakes.
description = "A modern FastAPI application with SQLAlchemy 2.0 and AsyncPG for high-performance async database operations. Features include JWT authentication with Redis token storage, password hashing, connection pooling, data processing with Polars, Rich logging, task scheduling with APScheduler, and Shakespeare datasets integration."
readme = "README.md"
requires-python = ">=3.14"
requires-python = "==3.14.0"
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Python version constraint changed from >=3.14 to ==3.14.0, which is overly restrictive. This will prevent the project from working with any Python 3.14.x patch releases (e.g., 3.14.1, 3.14.2). Consider using >=3.14,<3.15 or ~=3.14.0 to allow patch version updates while maintaining compatibility.

Suggested change
requires-python = "==3.14.0"
requires-python = ">=3.14,<3.15"

Copilot uses AI. Check for mistakes.
dependencies = [
"fastapi[all]>=0.116.2",
"pydantic[email]>=2.12.0a1",
"pydantic-settings>=2.10.1",
"fastapi[all]==0.121.1",
"pydantic[email]==2.12.4",
"pydantic-settings==2.12.0",
"sqlalchemy==2.0.44",
"uvicorn==0.38.0",
"asyncpg>=0.30.0",
"alembic>=1.16.5",
"httpx>=0.28.1",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"uvloop>=0.21.0",
"httptools>=0.6.4",
"rich>=14.1.0",
"pyjwt>=2.10.1",
"redis>=6.4.0",
"bcrypt>=4.3.0",
"polars==1.35.2",
"python-multipart>=0.0.20",
"fastexcel>=0.15.1",
"inline-snapshot>=0.29.0",
"dirty-equals>=0.10.0",
"polyfactory>=2.22.2",
"granian>=2.5.4",
"uvicorn[standard]==0.38.0",
"asyncpg==0.30.0",
"alembic==1.17.2",
"httpx==0.28.1",
"pytest==9.0.1",
"pytest-cov==7.0.0",
"uvloop==0.22.1",
"httptools==0.7.1",
"rich==14.2.0",
"pyjwt==2.10.1",
"redis==7.0.1",
"bcrypt==5.0.0",
"polars[pyarrow]==1.35.2",
"python-multipart==0.0.20",
"fastexcel==0.16.0",
"inline-snapshot==0.31.1",
"dirty-equals==0.10.0",
"polyfactory==3.0.0",
"granian==2.5.7",
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependency pinning strategy has changed from using minimum version specifiers (>=) to exact version pinning (==) for most dependencies. While this provides reproducibility, it prevents automatic security patches and bug fixes. This is particularly concerning for security-sensitive packages like bcrypt, pyjwt, and redis. Consider using ~= for compatible releases (e.g., bcrypt~=5.0.0) to allow patch updates while preventing breaking changes.

Copilot uses AI. Check for mistakes.
"apscheduler[redis,sqlalchemy]>=4.0.0a6",
"rotoger==0.2.1",
]

[tool.uv]
dev-dependencies = [
"ruff>=0.13.1",
"ruff>=0.14.5",
"devtools[pygments]>=0.12.2",
"pyupgrade>=3.20.0",
"ipython>=9.5.0",
"sqlacodegen<=3.1.1",
"tryceratops>=2.4.1",
"locust>=2.40.5"

"pyupgrade==3.21.1",
"ipython==9.7.0",
"tryceratops==2.4.1",
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locust and sqlacodegen have been removed from dev dependencies. If these tools are still being used for load testing or model generation, they should remain in the dependencies. If they're no longer needed, ensure all references to them have been removed from documentation and scripts.

Suggested change
"tryceratops==2.4.1",
"tryceratops==2.4.1",
"locust",
"sqlacodegen",

Copilot uses AI. Check for mistakes.
]


Expand All @@ -50,7 +47,7 @@ strict = true
exclude = ["venv", ".venv", "alembic"]

[tool.ruff]
target-version = "py313"
target-version = "py314"
Copy link

Copilot AI Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ruff target version has been updated from py313 to py314, but this is inconsistent with the actual Python version being used (3.14.0). However, py314 is not a valid ruff target version identifier. The correct identifier should be py314 only if ruff version 0.14.5+ supports Python 3.14. Please verify that the version of ruff being used (0.14.5) actually supports the py314 target version.

Suggested change
target-version = "py314"
target-version = "py313"

Copilot uses AI. Check for mistakes.
exclude = ["alembic"]

[tool.ruff.lint]
Expand Down
Loading
Loading