build
build copied to clipboard
How to pass parameters to be used during preparation of isolated build venv using --config-setting ?
I've encountered a problem that doesn't seem to be covered very well in the docs.
I'm working in a corporate network with a corporate VPN and nominally use conda to manage my environments (using both private and public PyPI indeces). Getting packages to be installed in such conda env is easy with pip - either by setting HTTP_PROXY=<corp proxy>
and HTTPS_PROXY=<corp proxy>
env variables or using pip install some_package --proxy=<corp_proxy>
explicitly.
However, when I'm trying to build packages with python -m build
(setuptools backend), the process hangs indefinitely on fetching dependencies for the isolated build venv that is being created.
I figured out that happens because that venv is unaware of my environmental variables and tries to use stock pip install
.
I can circumvent the problem by installing build dependencies in my dev conda env, followed by build without isolation using python -m build --no-isolation
.
However, I realize that is a rather dirty way, I'd much prefer to inject proxy settings into venv construction process. Is there a way to do that with --config-setting
? I searched the net and read some issues here as well (#517 for example), but they seem to revolve more about build parameters than the venv itself.
The closest related issue I found was #464 , but those flags don't seem to be properly passed in by conda when venv is created automatically.