Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed version spec from psycopg2-binary #10703

Closed
wants to merge 1 commit into from
Closed

Conversation

jaap3
Copy link
Contributor

@jaap3 jaap3 commented Nov 29, 2018

The earliest version of psycopg2-binary is 2.7.3.2 (https://pypi.org/project/psycopg2-binary/#history) so there's no reason to specify a minimal version here.

The earliest version of psycopg2-binary is 2.7.3.2 (https://pypi.org/project/psycopg2-binary/#history) so there's no reason to specify a minimal version here.
@timgraham
Copy link
Member

Someone brought this up before but I think it's better to keep the requirement for documentation purposes in case anyone is using the non-binary package.

@timgraham timgraham closed this Nov 29, 2018
@jaap3
Copy link
Contributor Author

jaap3 commented Nov 29, 2018

Ah, maybe it would be clearer to change the content of this file to something like this then:

# psycopg2>=2.5.4
psycopg2-binary

It's not obvious that the usage of a non-existent minimal version of one package is used to signal a minimum version of an alternate version of that package.

(I force pushed this change to my branch, but it doesn't show up here)

@timgraham
Copy link
Member

I don't see it as a big source of confusion that requires adding a commit in Django's history, but tell me if it tripped you up.

@jaap3
Copy link
Contributor Author

jaap3 commented Nov 29, 2018

It did cause some confusion when I tried to run Django's test suite in a docker python-alpine based container.

pip doesn't actually install a binary/wheel for the psycopg2-binary package on that specific flavour of linux and instead downloads the source tarball. This in turn causes an error because none of the tools required to build psycopg2 are available in that container.

At first I thought it was caused by trying to install psycopg2, but looking at the requirements file I saw that psycopg2-binary was listed. So then I looked at PyPI and noticed that psycopg2-binary doesn't even have a version < 2.7.3.2.

This caused me to think that somehow the version spec caused pip to install psycopg2. It obviously doesn't, but it did trip me up.

None of this is really Django's fault, psycopg2-binary probably shouldn't list a source tarball on PyPI in the first place. But having a version spec in the requirements file did lead me on a bit of a wild goose chase.

@jaap3
Copy link
Contributor Author

jaap3 commented Nov 29, 2018

Related issues in the psycopg2 repository:

psycopg/psycopg2#684
psycopg/psycopg2#761

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants