Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unset PIP_REQUIRE_VIRTUALENV when running 'pip'
If the PIP_REQUIRE_VIRTUALENV environment variable is set, it blocks `pip install` from running without a virtualenv being activated. This broke using `python -m pep517.build` on my project: ``` $ python -m pep517.build . ERROR: Could not find an activated virtualenv (required). Traceback (most recent call last): File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pep517/build.py", line 124, in <module> main(parser.parse_args()) File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pep517/build.py", line 120, in main build(args.source_dir, dist, args.out_dir) File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pep517/build.py", line 87, in build env.pip_install(system['requires']) File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pep517/envbuild.py", line 100, in pip_install check_call( File "/Users/chainz/.pyenv/versions/3.8.3/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/Users/chainz/.pyenv/versions/3.8.3/bin/python', '-m', 'pip', 'install', '--ignore-installed', '--prefix', '/var/folders/kq/02p9h16n7zv_z7bhzmg6y_pm0000gn/T/pep517-build-env-fkh9ckg8', 'setuptools >= 40.6.0', 'wheel']' returned non-zero exit status 3. ``` This change makes pep517 unset the environment variable since its installs are safe to run.
- Loading branch information