Skip to content
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

Need to be able to add site packages into temporary venvs #727

Open
JamesTheAwesomeDude opened this issue Jan 24, 2024 · 2 comments
Open

Comments

@JamesTheAwesomeDude
Copy link

JamesTheAwesomeDude commented Jan 24, 2024

On networks that use fake root certificates for TLS MitM ALG proxies (such as corporate firewalls or certain antivirus software), pip version 23.3* or newer is required because it allows the user to prefer the system-wide configuration over a hard-coded CA bundle.

I have the upgraded pip installed in my user packages; it's the only site package I have. But version 1.0.3 of pypa build has hard-coded that there's no way to pass system_site_packages=True to the EnvBuilder, for users who "really know what they're doing" and want to "contaminate" the venv.

Of course, the "upgrade" logic currently in there will not work for this use-case, since you can't use a non-functioning version of pip to install a functioning version.

*Technically, the feature was "added" in version 22.2, but it doesn't actually function in that version due to a catch-22 of requiring a 3rd-party package to be installed before any 3rd-party packages can be installed.

@henryiii
Copy link
Contributor

Not directly an answer, but can you use virtualenv instead of venv? That should have a recent version of pip, I think?

@JamesTheAwesomeDude
Copy link
Author

JamesTheAwesomeDude commented Jan 24, 2024

Well, that's a fantastic fix, thanks @henryiii

cd Documents\code\proj1
REM modifying system-wide packages, need to use a light touch
py -m pip install --user "virtualenv >= 20.24.6"
py -m virtualenv .venv

.venv\Scripts\activate.bat
REM in dev environment now, can install anything needed to build this package
python -m pip install black build twine
python -m pip install "virtualenv >= 20.24.6"
python -m build

—this works perfectly; it looks like build automatically detects virtualenv, uses it, and the result is an upgraded & functioning version of pip in the temporary venvs, which leads to a functioning build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants