Skip to content

Commit

Permalink
Ensure setuptools is installed
Browse files Browse the repository at this point in the history
Fix #174
  • Loading branch information
frostming committed Nov 23, 2020
1 parent eb952c9 commit f73c643
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/174.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure `setuptools` is installed before invoking editable install script.
9 changes: 6 additions & 3 deletions pdm/installers/installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pip_shims import shims

from pdm.iostream import stream
from pdm.models.builders import log_subprocessor
from pdm.models.builders import EnvBuilder
from pdm.models.requirements import parse_requirement

if TYPE_CHECKING:
Expand Down Expand Up @@ -84,9 +84,12 @@ def install_editable(self, ireq: shims.InstallRequirement) -> None:
paths["purelib"],
paths["scripts"],
]
with self.environment.activate(True):
with EnvBuilder(ireq.unpacked_source_directory, self.environment) as builder:
builder.install(["setuptools"])
extra_env = {"INJECT_SITE": "1"} if not self.environment.is_global else None
log_subprocessor(install_args, ireq.unpacked_source_directory, extra_env)
builder.subprocess_runner(
install_args, ireq.unpacked_source_directory, extra_env
)

def uninstall(self, dist: Distribution) -> None:
req = parse_requirement(dist.project_name)
Expand Down

0 comments on commit f73c643

Please sign in to comment.