-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
setenv PATH behavior change with tox 4 #2691
Comments
PR to fix this is welcome. |
We want to resolve the python executable using PATH from the environment rather than using any PATH which may be configured set_env. (See tox-dev#2691.)
On second thought, I'm not sure this is a valid use case. Because we use PATH to discover valid commands in |
We need to document this as a breaking change and provide the |
That's not quite right.
So, The issue is what PATH to use when constructing the virtualenv, where the PATH is used (solely, I think) to find candidate python executables for the environment. Personally, I don't see any reason that PATH has to be the same as the PATH used when running the Adding If It's already the case that a different set of environment variables are used when constructing the virtual environment (VirtualEnv.virtualenv_env_vars) than when running As noted above, I believe the only use of PATH during virtual environment creation is for locating the appropriate python executable. If that's the case, we lose nothing by not allowing a way to customize that PATH. If the user would like to use a python other than what would be found via |
If you take that ad
This kind of different behavior is confusing users because the boundaries where something applies or not are very confusing. For that reason, tox 4 no longer wants differing behaviors.
By design, as said above. This use case is rare enough that I'm happy to make that breaking change. tox 3 and 4 is intended to be mostly compatible, not under all circumstance. This is one of those.
Strongly opposed to any non-generic behavior. Such exceptions always just confuse the user and the maintainer alike. Might be handy for your specific use case, but in long term causes more issues than worth it.
The only differing environment variables are the ones that configure how virtualenv works. That's expected. |
I see PATH as one of those environment variables that configure how virtualenv works, since it determines how virtualenv chooses a python executable. Agree to disagree, I guess... |
And it would be OK to append the PATH there, but not to overwrite what the user already asked in |
Tox version 4 broke our scheme for hiding external utilities (imagemagick, git, ffmpeg, etc) from Lektor. (See tox-dev/tox#2691)
Tox version 4 broke our scheme for hiding external utilities (imagemagick, git, ffmpeg, etc) from Lektor. (See tox-dev/tox#2691)
Tox version 4 broke our scheme for hiding external utilities (imagemagick, git, ffmpeg, etc) from Lektor. (See tox-dev/tox#2691)
I also relied on modifying
So it means my script currently has a And in my case, I need to use I can rework them to explicitly set the |
That's expected because the later runs at runtime, while the earlier is evaluated at startup, before any tox environments are created. That's by design and we'll not change it. |
Tox version 4 broke our scheme for hiding external utilities (imagemagick, git, ffmpeg, etc) from Lektor. (See tox-dev/tox#2691)
Issue
We have some python code that can use certain external binaries to provide extra functionality but is supposed to degrade gracefully if said binaries are not installed. To test that graceful degradation, we have been using
with the intention that running
tox -e py311-noutils
would run our tests withPATH
set to a broken value so that our code under test could not find the external binaries.This worked up until tox 4. With tox 4
tox -e py311-noutils
reportspy311-noutils: skipped because could not find python interpreter with spec(s): py311
Apparently, the broken PATH setting in
setenv
now breaks tox's ability to find available python interpreters.A minimal example is provided below.
Is this expected? (If so, is there another suggested approach for my use case?)
Minimal example
With this
tox.ini
and this minimal
pyproject.toml
Using tox 4.0.5
Using tox 3.27.1
Note that
tox -e py311
works as expected (the test is run, but the test fails sincels
is inPATH
) under either version of tox.The text was updated successfully, but these errors were encountered: