Skip to content

Support specifying postgresql drivers - #156

Merged
yakimka merged 7 commits into
testcontainers:masterfrom
KarolisL:postgres-driver-override
Apr 4, 2022
Merged

yakimka merged 7 commits into
testcontainers:masterfrom
KarolisL:postgres-driver-override

Conversation

@KarolisL

@KarolisL KarolisL commented Sep 25, 2021 •

Copy link
Copy Markdown
Contributor

I've found installing psycopg2 driver on MacOS Big Sur being too complicated: I didn't want to install postgres headers nor was I able to use the -binary version of the package.

I've decided to use pure-python driver, but wasn't able to do so due to the driver being hardcoded. This PR addresses the limitation by adding an optional field to the constructor to override the driver.

I've added a postgresql-pg8000 extra preset for convenience, but I'm happy to revert if you find it redundant ( 756f3e1 ).

@KarolisL

Copy link
Copy Markdown
Contributor Author

Btw, I wasn't able to quickly google the docstring format. Would you please point me to the spec so I could format the docstring properly? https://github.com/testcontainers/testcontainers-python/pull/156/files#diff-0d0163aaa012beed78914f91926197b1bd2fcd7fc84eaa6bf345367f2860d8cdR30

@yakimka
yakimka force-pushed the postgres-driver-override branch from ba94dad to 25af97e Compare April 2, 2022 15:12
Comment thread testcontainers/postgres.py Resolved
Comment thread setup.py Resolved
@yakimka

yakimka commented Apr 4, 2022

Copy link
Copy Markdown
Contributor

@KarolisL, please fix formatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants