SQLAlchemy 1.4, Django Tenants, and Pre-commit CI

·33m 08s
Shared point

SQLAlchemy 1.4 and Async Support

Recent developments in the Python ecosystem feature the release of SQLAlchemy 1.4, a massive update serving as a bridge to version 2.0. This release is significant for introducing native async/await support for ORM operations, allowing developers to integrate with frameworks like FastAPI in a scalable manner.

Key Changes

• Introduction of a new query API, moving away from session.query.
• Requirement for specific async drivers, such as aiosqlite for SQLite.
• Mandatory use of async with blocks to manage session objects.

Multi-tenancy with Django

Managing multiple client data instances within a single application is a common challenge for SaaS providers. The django-tenants package provides a solution using PostgreSQL schemas to isolate data logically while maintaining a single codebase.

Modernizing Version Control

Automation tools continue to improve development workflows. Key highlights include:
Pre-commit CI: A continuous integration service that automates the execution of pre-commit hooks, ensuring that all contributors adhere to formatting standards like Black without manual intervention.
Snyk Package Advisor: A tool for evaluating open-source package health, security, and maintenance status, helping developers make informed technology choices.
PyWebIO: A library that simplifies building browser-based GUI applications using Python, removing the burden of writing HTML and JavaScript.

Important Considerations

"Public service announcement, please do not remove old versions from PyPI because it just causes work for people that have to go find your old versions on GitHub."

The hosts discussed the importance of the PyPI Yank feature, which allows maintainers to deprecate specific package versions without breaking existing dependency graphs for users who have pinned those versions.

Topics

Chapters

7 chapters
Python Bytes
AI chat — answers grounded in episodes