summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2021-12-22 10:07:47 +0000
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2021-12-22 10:07:47 +0000
commitc70575d153f9e11a15b8ef6afd4248c6bda4888d (patch)
tree219d18718ba74a08730f77958c4aeb7485df6997
parent7479892c117dc739d26f8c957c1b761870d192fa (diff)
downloadpython-setuptools-git-c70575d153f9e11a15b8ef6afd4248c6bda4888d.tar.gz
Improve path handling on move_license task
-rw-r--r--pavement.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pavement.py b/pavement.py
index d588e5ae..6d5d519f 100644
--- a/pavement.py
+++ b/pavement.py
@@ -74,13 +74,14 @@ def move_licenses(vendor):
def _find_license_dest(license_file, vendor):
basename = license_file.basename()
- pkg = license_file.dirname().replace(".dist-info", "")
+ pkg = license_file.dirname().basename().replace(".dist-info", "")
parts = pkg.split("-")
acc = []
for part in parts:
+ # Find actual name from normalized name + version
acc.append(part)
for option in ("_".join(acc), "-".join(acc), ".".join(acc)):
- candidate = Path(option)
+ candidate = vendor / option
if candidate.isdir():
return candidate / basename
if Path(f"{candidate}.py").isfile():