Skip to content

Unset PIP_REQUIRE_VIRTUALENV when running 'pip' #84

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pep517/envbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import toml
import shutil
from subprocess import check_call
import subprocess
import sys
from sysconfig import get_paths
from tempfile import mkdtemp
Expand Down Expand Up @@ -97,11 +97,17 @@ def pip_install(self, reqs):
cmd = [
sys.executable, '-m', 'pip', 'install', '--ignore-installed',
'--prefix', self.path] + list(reqs)
check_call(
env = os.environ.copy()
# Allow pip to operate without an activated virtualenv
env.pop("PIP_REQUIRE_VIRTUALENV", None)
retcode = subprocess.Popen(
cmd,
stdout=LoggerWrapper(log, logging.INFO),
stderr=LoggerWrapper(log, logging.ERROR),
)
env=env,
).wait()
if retcode != 0:
raise subprocess.CalledProcessError(retcode, cmd)

def __exit__(self, exc_type, exc_val, exc_tb):
needs_cleanup = (
Expand Down