Commit 6f7c2803 authored by Xavier Thompson's avatar Xavier Thompson

[wkrd] Fix dist's project_name

Setuptools extracts/guesses the project name of a source distribution
found in a package index from its download link. This may not exactly
match the project name of the requirement that initially prompted the
search in the package index. More so since PEP 625, which states that
sdists must have normalized - in particular, lowercased - filenames.

This change seems not strictly necessary, but can help avoid needless
inconsistencies.
parent 43321e47
...@@ -545,7 +545,12 @@ class Installer(object): ...@@ -545,7 +545,12 @@ class Installer(object):
# See https://github.com/buildout/buildout/issues/647 # See https://github.com/buildout/buildout/issues/647
project_name = requirement.project_name project_name = requirement.project_name
dists = [d for d in index[project_name] if d in requirement] dists = [
d if d.project_name == project_name else
# Fix the dist's project name to match the original requirement
d.clone(project_name=project_name)
for d in index[project_name] if d in requirement
]
# Workaround by also looking up the name with - instead of . # Workaround by also looking up the name with - instead of .
# and fixing the name of dists found back to . instead of -. # and fixing the name of dists found back to . instead of -.
......
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