Skip to content

Commit

Permalink
Add pep517 to environment path
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Ryan <[email protected]>
  • Loading branch information
techalchemy committed Jan 24, 2019
1 parent 846b67f commit 23ee483
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions pipenv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ def activated(self, include_extras=True, extra_dists=None):
vendor_dir = parent_path.joinpath("vendor").as_posix()
patched_dir = parent_path.joinpath("patched").as_posix()
parent_path = parent_path.as_posix()
self.add_dist("pip")
prefix = self.prefix.as_posix()
with vistir.contextmanagers.temp_environ(), vistir.contextmanagers.temp_path():
os.environ["PATH"] = os.pathsep.join([
Expand All @@ -496,6 +497,13 @@ def activated(self, include_extras=True, extra_dists=None):
sys.path = self.sys_path
sys.prefix = self.sys_prefix
site.addsitedir(self.base_paths["purelib"])
pip = self.safe_import("pip")
pip_vendor = self.safe_import("pip._vendor")
pep517_dir = os.path.join(os.path.dirname(pip_vendor.__file__), "pep517")
site.addsitedir(pep517_dir)
os.environ["PYTHONPATH"] = os.pathsep.join([
os.environ["PYTHONPATH"], pep517_dir
])
if include_extras:
site.addsitedir(parent_path)
sys.path.extend([parent_path, patched_dir, vendor_dir])
Expand Down
4 changes: 2 additions & 2 deletions pipenv/vendor/requirementslib/models/requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,9 +1586,9 @@ def from_line(cls, line, editable=None, extras=None):
relpath = None
parsed_line = Line(line)
if editable:
line.editable = editable
parsed_line.editable = editable
if extras:
line.extras = extras
parsed_line.extras = extras
if line.startswith("-e "):
editable = True
line = line.split(" ", 1)[1]
Expand Down

0 comments on commit 23ee483

Please sign in to comment.