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

Direct references are not working #4447

Closed
Dominik1123 opened this issue Apr 15, 2017 · 4 comments
Closed

Direct references are not working #4447

Dominik1123 opened this issue Apr 15, 2017 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@Dominik1123
Copy link

  • Pip version: 9.0.1
  • Python version: 2.7.12
  • Operating system: Linux MyPC 4.4.0-72-generic pip doesn't handle "use_distribute" #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Description:

PEP 440 introduces the usage of direct references. The pip release notes report to have implemented this PEP (with some subsequent minor modifications).

However I can't get this feature to work. Particularly I wanted to use it in the install_requires section of a setup.py script. I tried all the different variations that are used as examples in the PEP specification however none of them worked. The response always is:

Could not find a version that satisfies the requirement [...]
No matching distribution found for [...]

I also tried install the package directly with pip on the CLI however this gave me the same error:

Could not find a version that satisfies the requirement [...]

What I've run:

I've tried all the variations of examples that are given in the PEP 440 specification. Here's a collection of a few. Using git:

$ pip install "testpip @ git+https://github.com/Dominik1123/testpip.git"
Collecting testpip@ git+https://github.com/Dominik1123/testpip.git
  Could not find a version that satisfies the requirement testpip@ git+https://github.com/Dominik1123/testpip.git (from versions: )
No matching distribution found for testpip@ git+https://github.com/Dominik1123/testpip.git

$ pip install "testpip @ git+https://github.com/Dominik1123/[email protected]"
Collecting testpip@ git+https://github.com/Dominik1123/[email protected]
  Could not find a version that satisfies the requirement testpip@ git+https://github.com/Dominik1123/[email protected] (from versions: )
No matching distribution found for testpip@ git+https://github.com/Dominik1123/[email protected]

Using an archive:

$ pip install "testpip @ https://github.com/Dominik1123/testpip/archive/0.1.zip#sha1=619abe4c478a96670070e0b3bda1ca998b5ffd84"
Collecting testpip@ https://github.com/Dominik1123/testpip/archive/0.1.zip#sha1=619abe4c478a96670070e0b3bda1ca998b5ffd84
  Could not find a version that satisfies the requirement testpip@ https://github.com/Dominik1123/testpip/archive/0.1.zip#sha1=619abe4c478a96670070e0b3bda1ca998b5ffd84 (from versions: )
No matching distribution found for testpip@ https://github.com/Dominik1123/testpip/archive/0.1.zip#sha1=619abe4c478a96670070e0b3bda1ca998b5ffd84

However I've also verified that the following works:

$ pip install "ase @ git+https://gitlab.com/ase/ase.git"
Collecting ase@ git+https://gitlab.com/ase/ase.git
  Downloading ase-3.13.0.tar.gz (1.3MB)
    100% |████████████████████████████████| 1.3MB 966kB/s 
Building wheels for collected packages: ase
  Running setup.py bdist_wheel for ase ... done
  Stored in directory: /home/dominik/.cache/pip/wheels/7c/a1/c9/ef0be2feee12da75647eb2c24eb5a03cded81728a9a87f698d
Successfully built ase
Installing collected packages: ase
Successfully installed ase-3.13.0

I don't see what's the difference, really. In the former case it's not even attempting to download the repo while the command is similar to the latter case.

@di
Copy link
Member

di commented Apr 15, 2017

Support for this syntax was added in #4175, which was merged after 9.0.1 and thus hasn't been released yet.

@Dominik1123
Copy link
Author

Dominik1123 commented Apr 15, 2017

The release notes for 8.1.2 (2016-05-10) report something different:

Update environment marker support to fully support PEP 508 and legacy environment markers. (#3624)

Also how do you explain that

pip install "ase @ git+https://gitlab.com/ase/ase.git"

or

pip install "pip @ git+https://github.com/pypa/pip.git"

work without a problem? Just for this test repo it doesn't work. The only difference I can spot is that the former ones are all published on PyPi while the latter isn't. But direct references are meant to support packages which are not published on PyPi, aren't they? Or does pip use some kind of fallback on PyPi in case it doesn't understand this syntax?

@di
Copy link
Member

di commented Apr 16, 2017

The release notes here are a bit confusing and might better read:

Update environment marker support to fully support PEP 508 [environment markers] and legacy environment markers

Meaning it is only referring to https://www.python.org/dev/peps/pep-0508/#environment-markers and not to the @ url syntax.

The reason pip install "ase @ git+https://gitlab.com/ase/ase.git" seems to work is that before #4175, this essentially becomes the same as pip install ase, and what you are in fact installing is the source distribution on PyPI here, so in a way, yes, it is falling back on PyPI, due to not understanding the syntax.

@pradyunsg
Copy link
Member

As @di pointed out, this support will be there as a part of the next release of pip. On that note, I'm closing this issue. :)


The release notes here are a bit confusing

I'll make a PR fixing that. :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

3 participants