-
Dear psycopg2 developers, I work on dbcli/pgcli#1085 We have psycopg2 in our https://github.com/dbcli/pgcli/blob/e0a4c18c4a074016beef46886b03e456102e2db1/setup.py#L15 Pgcli can't run without either psycopg2 or psycopg2-binary being installed. We don't care which one, either one is fine, but it's not an optional dependency and we can't move it to Before 2.8, we gave users who have problems installing psycopg2 from source to force binary install like this:
Since 2.8, this of course does not work anymore, because the psycopg2 package is source-only:
With setuptools, it does not seem that there's any way to specify depencency on "either psycopg2 or psycopg2-binary". We considered:
I don't know all the reasoning behind splitting psycopg2 into 2 different packages, but I really wish psycopg2 remained a single package with an option for users to use I hope you can advise, having the insider view of psycopg2. What is the right thing to do for pgcli, in your opinion? What can we advise to users that:
and how can we ensure that pgcli is successfully installable for both? Thank you! Irina Truong |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hello Irina, Unfortunately we had to drop the binary wheel from the psycopg2 package for problems of unreliability that can be easily found back searching in the github issues. Pip/python packages don't allow for a "prefer source" choice, so we had to make our "opt-in mechanism", and I agree it isn't pretty. The only thing we suggested for your project is to depend on psycopg2. The -binary package is not available for all the platform: binary wheels are not available for Alpine Linux because there is no standard tagging, for instance, it's not possible to build wheels on Apple M1, and anyway in general Apple will break binary compatibility every 6 months. You don't want to depend on the -binary package. It would be nice if it could be declared that both psycopg2 and psycopg2-binary package "provide psycopg2", there has been some discussion on the packaging groups but I am not aware of any progress. Short of dropping the -binary package altogether, given the limitation of the python packages metadata, I don't think we can do anything helpful. I have a proposal: what about switching pgcli to Psycopg 3? The advantages are:
FYI I have just finished adapting Django to psycopg3 and I have written FastAPI applications using it, so I believe stuff more complicated than what pgcli does have already been dealt with. |
Beta Was this translation helpful? Give feedback.
Hello Irina,
Unfortunately we had to drop the binary wheel from the psycopg2 package for problems of unreliability that can be easily found back searching in the github issues. Pip/python packages don't allow for a "prefer source" choice, so we had to make our "opt-in mechanism", and I agree it isn't pretty.
The only thing we suggested for your project is to depend on psycopg2. The -binary package is not available for all the platform: binary wheels are not available for Alpine Linux because there is no standard tagging, for instance, it's not possible to build wheels on Apple M1, and anyway in general Apple will break binary compatibility every 6 months. You don't want to depend on the -…