-
Notifications
You must be signed in to change notification settings - Fork 122
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
Isolated build environment has access to build's environment when run from a Python environment #97
Comments
Hum, I am pretty sure I was passing |
That would only partially fix the issue — |
I will keep this short, otherwise I will rant about this. It happens because of the presence of |
Opened pypa/pyproject-hooks#92 which is required to fix this issue. |
Keeping it short. IMO |
You mean PEP 405 was a breaking change? When PEPs propose a change Python semantics, they're never implemented in minor versions. Looks like PEP 405 was introduced in Python 3.3 (Python does not use semver — backwards-incompatible changes are allowed in point releases like 3.2 → 3.3).
This is a somewhat vague description of the problem. I don't really understand the isolation / environment code well enough to understand why this would be a problem. From what I can tell,
One possible (very hacky) workaround in the meantime might be to monkey-patch |
Yes, but AFAIK you don't change behaviors, you deprecate stuff and remove them, but I might be wrong. Changing how something behaves is very problematic. In this case, I see absolutely no reason for
Okay, this is the issue: (on
(on a virtual environment,
So, if With PEP 405, the Python interpreter is not self-contained, it depends on external environment variables we might not control. I chose |
Interesting, I wonder if it's worth tweaking the documentation to make it more clear that |
Can you not use the Python |
That does work, yes.
|
@pganssle can you confirm that the current master fixes the issue for you? |
Ping. Should this be closed now? |
I think so. |
Okay, we can reopen if needed. |
It seems that when constructing the isolated environment,
python-build
still uses the packages in the outer environment if they are present, rather than installing into a "clean" environment.One consequence of this is that if you have an older version of your build backend in the environment that contains
python-build
,pip install
won't install an upgraded version of it. For example, construct a project with apyproject.toml
like so:And a
virtualenv
like so:When you run
python-build -w .
, when satisfyingsetuptools
,pip
will not upgradesetuptools
, since it is "already satisfied":Preferably,
pip
would consider the isolated environment a blank slate, and you'd get the latestsetuptools
, unless--no-isolation
is passed.This is not only a problem with
pip
— the build environment used contains all the packages from the environmentpython-build
was invoked in, as you can see if you create asetup.py
like so:If you run this in the virtualenv we created above, it will succeed and print the "dateutil not found" message. If you then run
pip install python-dateutil
in the virtualenv, thepython-build -w .
will fail, indicating that the build is being carried out in an environment not isolated from the base environment.These results on Arch Linux using
virtualenv==20.0.26
,build==0.0.4
and Python version 3.8.2 (via pyenv). I have not attempted to replicate this without a virtualenv.The text was updated successfully, but these errors were encountered: