aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--setup.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index 8c18ae2..644f916 100644
--- a/setup.py
+++ b/setup.py
@@ -1027,15 +1027,21 @@ def main():
d = os.path.join(dist_base, nsp.full_package_name)
else:
d = 'dist'
+ dashed_vs = '-' + version_str + '-'
+ latest_mtime = -1
+ full_name = None
for x in os.listdir(d):
- dashed_vs = '-' + version_str + '-'
if x.endswith('.whl') and dashed_vs in x:
# remove .pth file from the wheel
- full_name = os.path.join(d, x)
- print('patching .pth from', full_name)
- with InMemoryZipFile(full_name) as imz:
- imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
- break
+ fn = os.path.join(d, x)
+ if os.path.getmtime(fn) > latest_mtime:
+ full_name = fn
+ if full_name is None:
+ print('no wheel file found in', d)
+ else:
+ print('patching .pth from {}'.format(full_name))
+ with InMemoryZipFile(full_name) as imz:
+ imz.delete_from_zip_file(nsp.full_package_name + '.*.pth')
return
for x in ['-c', 'egg_info', '--egg-base', 'pip-egg-info']:
if x not in sys.argv: