-
Notifications
You must be signed in to change notification settings - Fork 95
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
Use correct Python version in Poetry init #179
Conversation
Hi @nfzd, I'm not sure I understand the fix - the |
Hi @jkhenning, true. But An alternative would be to set up the Perhaps it would make sense to remove the |
45202c0
to
522fb07
Compare
The thing is that when resolving the version there, the code actually verifies this is a viable executable. In your change, you simply take the value from the task, and in case this is not a python version that's available in the execution environment, I assume we'll end up with a failure... |
Looks to me like that check is done before the values are written to |
I think you're right, however that won't handle cases where the executable is overridden, such as here |
Right. This case is currently also not handled (but I'm not sure whether the default of |
@nfzd , apologies for the late reply - can't we just handle the override case as wll by updating the executable in the poetry class? |
@jkhenning Take a look, now it should use the value from the override (if configured) also for Poetry. |
0592d36
to
4ce3fed
Compare
Updated to fix the merge conflict. |
It seems that the Poetry initialization always uses the system's default Python version, and not the one requested for the task.
This causes issues because it results in packages being installed with the wrong version of Pip (when the main script execution starts, poetry is run with the correct Python version, i.e., the requested one, and it crashes).
With this patch, it works:
python = "^3.7.0"
poetry env use 3.7
andpoetry install
, then addpoetry.lock
to VCSpoetry run python main_which_will_exec_remotely.py