perfect_python_project's People
Forkers
kennyrich xareelee mkbdes michelssousa joiltonrsilva pablobispo barahlush pingu1m jfa1c0 lucasll37 yerzhaisang mzagliaperfect_python_project's Issues
Squash Migrations Using Alembic and Postgres
From time to time, it is desirable to squash the migrations to keep them short. This article proposes an interesting approach.
Encode/Databases 0.8.0 breaks fastapi-complete tests
According to 0.8.0 release notes:
This release improves isolation of connections and transactions across concurrent tasks:
- Database connections are now task-local and are not inherited by child tasks
- The @db.transaction decorator uses the calling task's connection
- Each new task uses a new connection unless a connection is explicitly provided
These changes improve the consistency of behavior and fix bugs where connections and transactions were not properly isolated such as: encode/databases#123, encode/databases#125, encode/databases#134, encode/databases#155, encode/databases#424, and encode/databases#452.
In most cases, these changes should not be breaking. However, if using an open transaction across tasks, the active connection (db.connection()) now needs to be explicitly passed to each task. See the new documentation for an example.
Those changes break the app
fixture which wraps the app with a db.transaction(force_rollback=True):
to roll back all changes made during testing.
Replaces Flake8 with Ruff
Pydantic adopted Ruff as its linter. Let's try it here too.
poetry.lock should be part of the template
Since pyproject.toml
does not record any version restrictions, we need poetry.lock
to define the currently used versions. Otherwise, we cannot guarantee that a newly created template instance will run. For example, fastapi-complete
doesn't work with databases 0.8.0
yet but this version will be used during the template instantiation anyway because of the lack of a restriction in pyproject.toml
or in poetry.lock
.
I prefer to keep pyproject.toml
the way it is, so it will be possible to run poetry update
to update all dependencies to their latest versions anytime.
Can't install
Create a default handler to log uncaught exceptions in FastAPI projects
Improve FastAPI (minimum and complete) projects to log uncaught errors.
Other ideas that can be used are well presented at FastAPI Server Errors And Logs โ Take Back Control
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.