-
-
Notifications
You must be signed in to change notification settings - Fork 164
session.conda_install fails when specifying min/max version with newer conda #951
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
Comments
This is needed on Windows, but not on other systems ( |
@henryiii Even if my resolution is not correct the issue still exists and should be reopened However, I am not seeing where Also the shell escaping issue you describe would exist no matter what executable is called, so why is |
I just saw that you did patch the issue for platforms other than windows. Thanks! |
#957 fixed this on UNIX, and left the behavior alone on Windows (yes, so this should remain open till fixed on Windows). That's out in 2025.05.01, which was just released. I don't understand why it's happening, I don't see Better investigation will require me actually to be on Windows, which I'm not going to do for a while. I'd really like to at least verify that |
Okay, I dug into the windows side and there is a difference depending on whether the batch file or executable is being invoked. The batch file + Popen does not appear to properly pass on the quoting/escaping. Here is what I tried:
Edit: if you want to use the bat file this escaping seems to work
Edit2: This seems really hacky but seems to force Popen to properly quote them and works for both the batch file and executable
|
I don't know if it will go anywhere, but I filed this behavior as a bug in cpython python/cpython#133545 |
Current Behavior
nox > Running session flake8
nox > Creating conda env in .nox/flake8 with python=3.9
nox > conda install --yes --prefix /home/jeff/workspace/nox_test/.nox/flake8 '"flake8>=4.0.1"'
nox > Command conda install --yes --prefix /home/jeff/workspace/nox_test/.nox/flake8 '"flake8>=4.0.1"' failed with exit code 1:
InvalidMatchSpec: Invalid spec '"flake8>=4.0.1"': Invalid version '4.0.1"': invalid character(s)
nox > Session flake8 failed.
Expected Behavior
I expect the package to be installed when specifying a min or max version
Steps To Reproduce
noxfile.py:
Environment
Anything else?
Temporary workaround:
nox.sessions._dblquote_pkg_install_args = lambda args: args
You appear to routing this through subprocess.Popen which states:
I believe that this quoting can be removed completely: https://github.com/wntrblm/nox/blob/main/nox/sessions.py#L726-L727
Fails with:
Works with:
The text was updated successfully, but these errors were encountered: