Repository navigation
fix: drop the hard psycopg2 dependency - #71
Merged
Merged
Conversation
desaintmartin
force-pushed
the
fix/drop-psycopg2-dependency
branch
from
October 19, 2026 12:01
eabfac0 to
30f6ab1
Compare
fregogui
self-requested a review
October 19, 2026 14:50
fregogui
approved these changes
Oct 19, 2026
Chartreuse imports no database driver. SQLAlchemy selects the driver from the dialect: "postgresql" means psycopg2 with SQLAlchemy 2.0 and psycopg (3) with SQLAlchemy 2.1. The hard psycopg2 dependency forced a compiled psycopg2 into images that migrate to psycopg 3. - Remove psycopg2 from the dependencies. - Add the extras "psycopg2" and "psycopg" to install a driver. - Build the URL with URL.create, so special characters in the user or the password do not break it. - Double "%" when writing alembic.ini, because ConfigParser and Alembic interpolate it. - Release as 7.1.0, with the Python 3.14 minimum from 8.0.0. The Helm chart requires the same major version as the package.
desaintmartin
force-pushed
the
fix/drop-psycopg2-dependency
branch
from
October 20, 2026 05:35
30f6ab1 to
7f17b4b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chartreuse imports no database driver. SQLAlchemy selects the driver from the dialect in the URL. The hard
psycopg2dependency forced a compiledpsycopg2into project images that migrate to psycopg 3.psycopg2fromdependenciesand fromrequirements.txt.chartreuse[psycopg2]andchartreuse[psycopg]. Thetestanddevextras keeppsycopg2for the e2e suite.sqlalchemy.engine.URL.create. Special characters in the user or the password (@,:,/,%) no longer break the URL.%when writingalembic.ini. ConfigParser and Alembic interpolate%, and an escaped password contains%XX.Driver selection
dialect: postgresqlusesA project can force a driver with
dialect: postgresql+psycopg. No change is needed in the configuration file format.Impact
A project that got
psycopg2only through Chartreuse must add a driver. It can use one of the new extras.Tests
chartreuse[psycopg]and nopsycopg2installed.create_engineon the built URL selects thepsycopgdriver.