Install does not respect `PIP_NO_BUILD_ISOLATION`
See original GitHub issueDescription
In a new venv, I can install friendly
from trunk by using --no-build-isolation
. This doesn’t hold if I export PIP_NO_BUILD_ISOLATION=1
; looks like pip
ignores the setting passed via env var.
Expected behavior
The behaviour of PIP_NO_BUILD_ISOLATION=1 pip install git+https://<url>
should be the same as of pip install --no-build-isolation git+https://<url>
, if I read Environment Variables correctly.
pip version
21.1.1
Python version
3.9.4
OS
Fedora 34
How to Reproduce
$ python -m venv tst
$ source tst/bin/activate
$ pip install --upgrade pip
$ pip install pygments rich pure_eval wheel # install deps first
$ export PIP_NO_BUILD_ISOLATION=1
$ pip install git+https://github.com/aroberge/friendly@master
Output
Collecting git+https://github.com/aroberge/friendly@master
Cloning https://github.com/aroberge/friendly (to revision master) to ./pip-req-build-4j8mp19r
Running command git clone -q https://github.com/aroberge/friendly /tmp/pip-req-build-4j8mp19r
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /tmp/tst/bin/python /tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqe9axa75
cwd: /tmp/pip-req-build-4j8mp19r
Complete output (70 lines):
Traceback (most recent call last):
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 33, in __getattr__
return next(
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 387, in _parse_attr
return getattr(StaticModule(module_name), attr_name)
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 41, in __getattr__
raise AttributeError(
AttributeError: friendly has no attribute __version__
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
main()
File "/tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 114, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 154, in get_requires_for_build_wheel
return self._get_build_requires(
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 135, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 3, in <module>
setup()
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.9/distutils/core.py", line 121, in setup
dist.parse_config_files()
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 742, in parse_config_files
parse_configuration(self, self.command_options,
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 157, in parse_configuration
meta.parse()
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 463, in parse
section_parser_method(section_options)
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 436, in parse_section
self[name] = value
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 220, in __setitem__
value = parser(value)
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 552, in _parse_version
version = self._parse_attr(value, self.package_dir)
File "/tmp/pip-build-env-ilxve4yd/overlay/lib/python3.9/site-packages/setuptools/config.py", line 390, in _parse_attr
module = importlib.import_module(module_name)
File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/tmp/pip-req-build-4j8mp19r/friendly/__init__.py", line 38, in <module>
from . import editors_helpers
File "/tmp/pip-req-build-4j8mp19r/friendly/editors_helpers.py", line 18, in <module>
from .config import session
File "/tmp/pip-req-build-4j8mp19r/friendly/config.py", line 7, in <module>
from . import core
File "/tmp/pip-req-build-4j8mp19r/friendly/core.py", line 19, in <module>
from . import info_variables
File "/tmp/pip-req-build-4j8mp19r/friendly/info_variables.py", line 10, in <module>
from . import utils
File "/tmp/pip-req-build-4j8mp19r/friendly/utils.py", line 9, in <module>
import pure_eval
ModuleNotFoundError: No module named 'pure_eval'
----------------------------------------
WARNING: Discarding git+https://github.com/aroberge/friendly@master. Command errored out with exit status 1: /tmp/tst/bin/python /tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqe9axa75 Check the logs for full command output.
ERROR: Command errored out with exit status 1: /tmp/tst/bin/python /tmp/tst/lib64/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py get_requires_for_build_wheel /tmp/tmpqe9axa75 Check the logs for full command output.
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
pip is completely ignoring build-system requirements when ...
in it, pip does not sort them properly such that pyramid is installed first to respect the build dependencies. Pip is completely ignoring...
Read more >python - what does no-build-isolation do?
It means pip won't install the dependencies, so you have to install the dependencies if any by yourself first or the command will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@hoefling Apologies. I told you those “double-negative” command line options were weird. The value you need is
PIP_NO_BUILD_ISOLATION=0
(note, set it to 0 not 1). The option is--no-build-isolation
, so the variable isPIP_NO_BUILD_ISOLATION
. But the action isstore_false
, so you need to set the variable to 0 to get the same effect as supplying the flag. Yes, we know this is stupid. It’s on the list of things to fix, under “use a different option parsing library” (which as you can imagine is a non-trivial job).If you have any suggestions about how we could document this for people who hit it, a docs PR would be welcomed as a quick improvement for now.
@pfmoore ah, so what I have missed is the double negation - thank you for the clarification! Indeed,
PIP_NO_BUILD_ISOLATION=0
is the right env var for--no-build-isolation
flag. Thank you for your help!