-
-
Notifications
You must be signed in to change notification settings - Fork 525
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
When basepython is pythonX and is missing, try to use various pythonX.Y #854
Comments
This would translate to using Line 164 in 4e7d909
|
I'd rather see a cross-platform means of saying "python 2" or "python 3" (so the user's intent is explicit) than have tox search for all the possible minor versions. Suggested solution (which covers both this and #855):
That's an unfortunately confusing duplication, but it simply completes the existing set of options and makes them all work cross-platform. A more radical fix, for example to deprecate either |
I would be -1 on this. There are enough differences between the various minor versions of Python such that I can imagine this leading to confusion when debugging across environments. As a trivial example, one user has Python 3.7 installed, while another has Python 3.3 installed. Without realizing it, tests are failing for the latter user due to the tests implicitly assuming Python 3.6's dict ordering behavior. Again, a trivial example, but it might be confusing for a relatively new Python developer. |
If the user explicitly says they want "python3" without specifying which minor version, surely they are saying they don't care about the minor version? So it's hardly "without realising it" that the tests depend on what minor version is installed. If they cared, they should have specified Having said that, I'm not keen on this request as it stands. Tox shouldn't be hunting out a suitable Python version itself, it should simply run "python 3" and let the OS sort it out. The only proviso is that on Unix, running the |
Also -1 on this, Any unixlike machine which doesn't have |
In case of linters I see reasonable request for some support of this. I mean unit tests are bound for one given environment, however linters are more a case of need some environment. |
@pfmoore, I'm suggesting that a user may do this unintentionally. e.g., they think they're writing code that is compatible across all minor versions of Python 3, but are unintentionally relying on the specifics of one version. Another user comes along, running an older version on their system, and hits unexpected bugs. Realistically, I don't think this would be a huge issue, but it could be a potential point of confusion for relatively new Python developers. Either way, I don't have a very strong opinion over this. Just sharing my thoughts. |
The motivating example for this is something like https://github.com/pypa/pip/blob/master/tox.ini#L48 where we want to run our linter against the code using Python 3. We don't care which Python 3, as pylint should report the same errors whatever version is in use, and we don't want to force people to install a specific version of Python 3 just to do lint checks. But nevertheless, I do agree it's not tox that should be doing the guessing here - tox should just call the |
With #858 this is now solved, so I'll close this now. Wait for https://github.com/tox-dev/tox/milestone/3 and 🎉 |
Coming from pypa/pip#5526 (comment)
Sometimes, a project does not care about which minor version of an interpreter is being used. So, they may specify
python2
orpython3
as abasepython
. In these cases, if there is nopython3
on PATH, tox should try searching for other matching interpreters with minor version --python3.7
thenpython3.6
and so on instead of just failing.The text was updated successfully, but these errors were encountered: