dbcli / pgspecial

Python implementation of postgres meta commands (backslash commands)
BSD 3-Clause "New" or "Revised" License
74 stars 54 forks source link

psycopg2 dependency #107

Closed xaniasd closed 3 years ago

xaniasd commented 3 years ago

Hi! I wanted to install pgspecial for a local test using pip, which is trying to build psycopg2. Is using psycopg2-binary instead an option?

thanks!

seperman commented 3 years ago

I'm in the same boat. Building psycopg2 is a pain. It is much easier to pip install psycopg2-binary.

BigJerBD commented 3 years ago

+1 , If there no reason to use the non-binary version, using psycopg2-binary would really simplify using this dependency projects

j-bennet commented 3 years ago

Unfortunately, psycopg2 does not recommend using binary distribution as depencency for other packages:

If you are the maintainer of a published package depending on psycopg2 you shouldn’t use psycopg2-binary as a module dependency. For production use you are advised to use the source distribution.

The binary packages come with their own versions of a few C libraries, among which libpq and libssl, which will be used regardless of other libraries available on the client: upgrading the system libraries will not upgrade the libraries used by psycopg2. Please build psycopg2 from source if you want to maintain binary upgradeability.

https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary

However, it is still possible to install and use psycopg2-binary. If psycopg2-binary is installed, but psycopg2 is not, pgcli / pgspecial will work just fine.

j-bennet commented 3 years ago

Related: https://github.com/dbcli/pgcli/issues/844