You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is pretty much the same scenario as described in #252.
Problem shown by @florimondmanca is still present and the solution he presented isn't necessarily the desired outcome for every use-case.
Expected behavior
Only local python interpreter versions should be considered when using pyenv local.
Actual behavior
If we add python interpreter with pyenv global 3.6.12 (for example) the nox session is executed. Otherwise we got an error:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'
But what if we want nox to skip session for this python version?
Original issue bellow:
Describe the bug
The shims inserted by pyenv into the shell fool the py.path.local.sysfind() call made here, and results in Nox not correctly skipping missing interpreters.
How to reproduce
Have pyenv installed with at least 2 different Python minor versions.
All sessions except the one using the Python version currently setup by pyenv (3.7 in my case) should be skipped, as explained in the docs
Actual behavior
Nox tries to run all versions, and fails. In my case, it fails on 3.6.
Full output:
$ nox
nox > Running session test-3.6
nox > Creating virtualenv using python3.6 in .nox/test-3-6
nox > Command /Users/florimond/.pyenv/versions/3.7.3/bin/python3.7 -m virtualenv /Users/florimond/Desktop/nox-pyenv/.nox/test-3-6 -p python3.6 failed with exit code 127:
pyenv: python3.6: command not found
The `python3.6' command exists in these Python versions:
3.6.8
Running virtualenv with interpreter /Users/florimond/.pyenv/shims/python3.6
nox > Session test-3.6 failed.
nox > Running session test-3.7
nox > Creating virtualenv using python3.7 in .nox/test-3-7
nox > Session test-3.7 was successful.
nox > Ran multiple sessions:
nox > * test-3.6: failed
nox > * test-3.7: success
Extra debugging material
Output of $ pyenv versions on my machine:
system
2.7.15
3.5.6
3.6.8
* 3.7.3 (set by /Users/florimond/.pyenv/version)
Output of checking for Python versions on my machine:
$ which python3.6
/Users/florimond/.pyenv/shims/python3.6
$ which python3.7
/Users/florimond/.pyenv/shims/python3.7
$ python3.6 -V
pyenv: python3.6: command not found
The `python3.6' command exists in these Python versions:
3.6.8
$ python3.7 -V
Python 3.7.3
Output of $ nox -l on my machine:
$ nox -l
Sessions defined in /Users/florimond/Desktop/nox-pyenv/noxfile.py:
* test-3.6
* test-3.7
sessions marked with * are selected, sessions marked with - are skipped.
Possible solutions
There's a difference in output when running sysfind() on a version that's available but not selected, and the version that's currently selected. Example in my case (running 3.7 with 3.6.8 available):
We could detect that we're running under pyenv, and if so only use the result from sysfind() if it doesn't contain shims in the path?
(We shouldn't rely on the output of sysfind to detect that we're using pyenv though, because the .pyenv shown there is the PYENV_ROOT, and that is configurable. I'd suggest to make a $ pyenv --version call instead.)
The text was updated successfully, but these errors were encountered:
This is pretty much the same scenario as described in #252.
Problem shown by @florimondmanca is still present and the solution he presented isn't necessarily the desired outcome for every use-case.
Expected behavior
Only
local
python interpreter versions should be considered when usingpyenv local
.Actual behavior
If we add python interpreter with
pyenv global 3.6.12
(for example) thenox
session is executed. Otherwise we got an error:But what if we want
nox
to skip session for this python version?Original issue bellow:
The text was updated successfully, but these errors were encountered: