Skip to content

Confusing error when setup.py, setup.cfg and pyproject.toml are absent #9944

Closed
@sbidoul

Description

@sbidoul

Description

When installing from a location where there is no setup.py, setup.cfg nor pyproject.toml, the error message is confusing.

Expected behavior

There should be an easier to understand message saying that no python project was found at the requested location.

pip version

21.1.1

Python version

3.8, not relevant

OS

Linux, probably not relevant

How to Reproduce

In the example below, notice #subdirectory=tests which points to a directory where there is no setup.py, setup.cfg nor pyproject.toml.

In pip <21.1, pip install "pip-test-package @ git+https://github.com/pypa/pip-test-package#subdirectory=tests" reports a file not found error. The error message is not pretty (a stack trace) but easily understandable.

In pip 21.1, the same command results in WARNING: Generating metadata for package pip-test-package produced metadata for project name unknown. Fix your #egg=pip-test-package fragments..

This might follow from #9547, I've not investigated yet.
Not sure if this should be classified as a bug (a slight regression) or feature request.

Output

No response

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions