Commit 4bd52524 authored by Xavier Thompson's avatar Xavier Thompson

[fix] Allow only installable DEVELOP_DIST in index

The package index considers may yield develop dists found on its local
search_path - sys.path by default - in addition to its index_url.

This commit discards such dists when they do not contain a setup.py
nor a pyproject.toml, as a good heuristic of whether they will be
installable or not.
parent 021cd43b
...@@ -481,8 +481,11 @@ class Installer(object): ...@@ -481,8 +481,11 @@ class Installer(object):
dists = [dist for dist in index[requirement.project_name] dists = [dist for dist in index[requirement.project_name]
if ((dist in requirement) if ((dist in requirement)
and and
((not source) or (dist.precedence == pkg_resources.SOURCE_DIST if source
(dist.precedence == pkg_resources.SOURCE_DIST) else not (dist.precedence == pkg_resources.DEVELOP_DIST
and {'setup.py', 'pyproject.toml'}.isdisjoint(
os.listdir(dist.location))
)
) )
) )
] ]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment