aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-07-25 16:11:18 +0200
committerAnthon van der Neut <anthon@mnt.org>2019-07-25 16:11:18 +0200
commit7e31d874e54d42c09f2192fe82814e11d17012db (patch)
tree58b59a19ad90d7bd7420f6ade69ceb0dc5fc6557
parentbfc6ed80a8491854443c74c5e1c6d4ca5f4ea09c (diff)
downloadruamel-yaml-clib-code-7e31d874e54d42c09f2192fe82814e11d17012db.tar.gz
patch latest .whl
-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: