Skip to content

Invalid requirement error with file URL and named project #10098

@jaraco

Description

@jaraco

Description

It's possible to install using a git+file scheme:

$ pip install 'git+file:///Users/jaraco/m/pytest-perf'
...
Installed...

It's also possible to specify the distribution name and extras when installing from a remote git repo:

$ pip install 'pytest-perf@git+https://github.com/jaraco/m/pytest-perf'
...
Installed...

But if one tries to install using a git+file scheme and specify the distribution name, an Invalid requirement error occurs:

$ pip install 'pytest-perf@git+file:///Users/jaraco/m/pytest-perf'
ERROR: Invalid requirement: 'pytest-perf@git+file:///Users/jaraco/m/pytest-perf'
Hint: It looks like a path. File 'pytest-perf@git+file:///Users/jaraco/m/pytest-perf' does not exist.

And thus because of #10097, it's not possible to install a local git repo with extras.

I'd really like for there to be some way to install a package at a given revision with extras:

$ pip install '*[testing]@git+file:path/to/repo@rev'

I need this for pytest-perf in order to compare performance of a package against the main branch.

Expected behavior

Honor the combination of the two syntaxes.

pip version

21.1.2

Python version

3.9.2

OS

macOS 11.4

How to Reproduce

x

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions