Skip to content

Perform Requires-Python check before downloading dependencies  #9925

@tekumara

Description

@tekumara

What's the problem this feature will solve?

When installing a package that requires a specific python version its dependencies are installed first, which

  1. downloads a bunch of dependencies unnecessarily
  2. can result in a confusing message when those dependencies don't have a distribution

eg:

myapi has python_requires=">=3.7" and depends on mylib. mylib has only been built for python 3.6.

pip install myapi with the Python 3.6 interpreter will download all dependencies and error with:

pip._internal.exceptions.DistributionNotFound: No matching distribution found for mylib==1.2.3

Describe the solution you'd like

pip install myapi with the Python 3.6 interpreter won't download dependencies and will error with the more helpful:

ERROR: Package 'myapi' requires a different Python: 3.6.10 not in '>=3.7'

Alternative Solutions

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions