-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix fallback to other interpreters when specifying a patchlevel. #3475
Fix fallback to other interpreters when specifying a patchlevel. #3475
Conversation
I guess I should elaborate, I hit this when I upgraded my Ubuntu system from 18.04 to 20.04. The upgrade switched the default python interpreter to 3.8 and the project I was working on had a dependency that was only available for python<3.8. And to add to the fun, another dependency claimed to only support python>=3.6.1. So I installed python-3.6.12 from the deadsnakes ppa and switched the dependency from Some debugging later, I found that when it is looking for the version of installed python interpreters there is an optimization that skips running interpreters that do not fall in the requested range of supported python versions. And, as is, the test runs |
d0bf642
to
ed920f6
Compare
ed920f6
to
9e7ae34
Compare
SonarCloud Quality Gate failed. 0 Bugs No Coverage information |
I'm just rebasing this PR periodically and make sure all the tests still work locally with tox. Right now I'm locally getting a type error from the python3.7 tests, which is also present in the upstream version without my patch. Also for some reason sonarcloud seems to be complaining about code duplication in test_env.py, but in a part of the file unrelated to the modifications from this patch. The PR has been waiting for review since December, is there anything I can do to help it make progress? |
9e7ae34
to
0b43d6d
Compare
ping @python-poetry/triage In my environment, I have multiple python version installed locally, The default python3 interpreter is 3.8.10 but I also have python-3.6.15. The following pyproject.toml is unable to find the 3.6.15 interpreter without this patch. [tool.poetry]
name = "python_version"
version = "0.1.0"
description = ""
authors = ["test <test@example.org>"]
[tool.poetry.dependencies]
python = ">=3.6.5,<3.7"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" Without patch $ poetry shell
The currently activated Python version 3.8.10 is not supported by the project (>=3.6.5,<3.7).
Trying to find and use a compatible version.
NoCompatiblePythonVersionFound
Poetry was unable to find a compatible version. If you have one, you can explicitly use it via the "env use" command. With patch $ poetry shell
The currently activated Python version 3.8.10 is not supported by the project (>=3.6.5,<3.7).
Trying to find and use a compatible version.
Using python3.6 (3.6.15)
Creating virtualenv python-version-avkAwIfu-py3.6 in /home/.../.cache/pypoetry/virtualenvs
Spawning shell within /home/.../.cache/pypoetry/virtualenvs/python-version-avkAwIfu-py3.6 |
When a project specifies a narrow range for the supported python versions, i.e. "python ~= 3.6.1" and the current interpreter falls outside of that range, the fallback code fails to test an available python3.6 interpreter because of a too strict a test.
0b43d6d
to
70687f5
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When a project specifies a narrow range for the supported python
versions, i.e. "python ~= 3.6.1" and the current interpreter falls
outside of that range, the fallback code fails to test an available
python3.6 interpreter because of a too strict a test.
Pull Request Check List
Resolves: #3463