Commit 228f0f96 by Sébastien Eustace

Fix an error on Python 3.5+ for git dependencies with recursive symlinks

parent f4ad371e
......@@ -6,6 +6,7 @@
- Fixed a recursion error with circular dependencies.
- Fixed the `config` command setting incorrect values for paths.
- Fixed an `OSError` on Python >= 3.5 for `git` dependencies with recursive symlinks.
## [0.11.4] - 2018-07-30
......
import glob
import logging
import os
import pkginfo
......@@ -25,6 +26,7 @@ from poetry.mixology.term import Term
from poetry.repositories import Pool
from poetry.utils._compat import PY35
from poetry.utils._compat import Path
from poetry.utils.helpers import parse_requires
from poetry.utils.toml_file import TomlFile
......@@ -193,7 +195,20 @@ class Provider:
try:
venv.run("python", "setup.py", "egg_info")
egg_info = next(tmp_dir.glob("**/*.egg-info"))
# Sometimes pathlib will fail on recursive
# symbolic links, so we need to workaround it
# and use the glob module instead.
# Note that this does not happen with pathlib2
# so it's safe to use it for Python < 3.4.
if PY35:
egg_info = next(
Path(p)
for p in glob.glob(
os.path.join(str(tmp_dir), "**", "*.egg-info")
)
)
else:
egg_info = next(tmp_dir.glob("**/*.egg-info"))
meta = pkginfo.UnpackedSDist(str(egg_info))
......
......@@ -17,6 +17,7 @@ except NameError: # Python 3
PY2 = sys.version_info[0] == 2
PY35 = sys.version_info >= (3, 5)
PY36 = sys.version_info >= (3, 6)
......
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