Commit c615c5b2 by Sébastien Eustace

Fix dependency resolution on Windows when unpacking distributions

parent c4ad420b
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
### Fixed ### Fixed
- Fixed `add` command picking up prereleases by default. - Fixed `add` command picking up prereleases by default.
- Fixed dependendency resolution on Windows when unpacking distributions.
## [0.8.1] - 2018-04-13 ## [0.8.1] - 2018-04-13
......
...@@ -350,6 +350,7 @@ class PyPiRepository(Repository): ...@@ -350,6 +350,7 @@ class PyPiRepository(Repository):
# Still not dependencies found # Still not dependencies found
# So, we unpack and introspect # So, we unpack and introspect
suffix = filepath.suffix suffix = filepath.suffix
gz = None
if suffix == '.zip': if suffix == '.zip':
tar = zipfile.ZipFile(str(filepath)) tar = zipfile.ZipFile(str(filepath))
else: else:
...@@ -360,7 +361,13 @@ class PyPiRepository(Repository): ...@@ -360,7 +361,13 @@ class PyPiRepository(Repository):
tar = tarfile.TarFile(str(filepath), fileobj=gz) tar = tarfile.TarFile(str(filepath), fileobj=gz)
try:
tar.extractall(os.path.join(temp_dir, 'unpacked')) tar.extractall(os.path.join(temp_dir, 'unpacked'))
finally:
if gz:
gz.close()
tar.close()
unpacked = Path(temp_dir) / 'unpacked' unpacked = Path(temp_dir) / 'unpacked'
sdist_dir = unpacked / Path(filename).name.rstrip('.tar.gz') sdist_dir = unpacked / Path(filename).name.rstrip('.tar.gz')
......
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