-
Notifications
You must be signed in to change notification settings - Fork 16
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
poetry installed with install-poetry.py does not respect asdf python version #10
Comments
This seems like an issue with the new installer provided by poetry. The issue is discussed here:
I don't know if there is an easy workaround here until they resolve this (if they choose to), but it unfortunately breaks the way we use poetry with asdf. We could go back to the old installer, and this problem would go away. However we wouldn't be able to use 1.2+ versions of poetry, and the old installer is planned to be deprecated. I don't think there is much we can easily do here unless poetry changes the way it is installed. |
That makes sense, thank you for the thorough response! Bummer that the installer changed that, I really liked being able to have different poetry versions available via asdf. My workaround for now is to install poetry with the script, then just point it to the correct python asdf version by running Feel free to close this if you'd like, I understand this is pretty much out of your hands. |
I'm wondering if we can incorporate some workaround here to have it use the asdf specified version of python. Otherwise I'm considering using the old installer until it is fully deprecated. |
I'm not sure this would get you the virtualenv. I might suggest using
instead when creating a new venv, especially if you also specify a local python version using |
@smorimoto if I could ask for some bash help I wonder if we can conditionally install with the legacy |
Hopefully the workaround that worked for me works for you all as well. |
The maintainers of Poetry recently pointed out (c.f., #3345) that they have since resolved this issue on |
@Kurt-von-Laven: Correct, since June 2021.
https://github.com/python-poetry/poetry/releases/tag/1.1.7 first release supporting install-poetry.py. Due to bugs in 1.1.7 and 1.1.8, install-poetry.py may break in usage due to a hash bug: python-poetry/poetry#4409. For that reason I made a PR for 1.1.9+ to not set up users to fail. Line 34 in 6176ff2
This updating this resolves the |
If we're receiving Installer's new repo: https://github.com/python-poetry/install.python-poetry.org (independent of poetry releases)
We can now use: https://install.python-poetry.org in place of the URL at Line 37 in 6176ff2
PR at #15 |
There is now an open PR proposing the addition of a setting that would allow the installation of Poetry using the current version of Python. The author, @finswimmer, is asking for feedback. Would there be any concerns with using such an option to install Poetry in this asdf plugin? |
I've did a test with My default system python is
|
@Kurt-von-Laven On a separate note, in the issue you are testing with 1.1.7 (where I still get the error) if you use In my testing this is working, but I've installed via this: How does it work then? (It's difficult to track all the issues between this and poetry's tracker, so trying to get an idea what's working and what's not as of now) |
@tony, sorry I completely missed this. I am using |
This is fixed by #21, though only for poetry 1.2+. |
On the latest version of asdf (0.11.1) and poetry (1.3.2), this is still a problem. The local python version is ignored by poetry unless I create the environment with |
Are you able to reproduce the issue after uninstalling Poetry and then reinstalling it while the desired version of Python is active? The local Python version at the time of installation is the one that is used, but it doesn't automatically update. |
Setting the virtualenvsprefer-active-python-experimental to
NOTE: I specify Thanks to @finswimmer for posting this python-poetry/poetry#1888 (comment) |
Explicitly specify project root for poetry
Due to the way poetry is installed by asdf and the way that poetry decides which python verion it should use, it is only able to use the version of python that is created as a venv in it's install path when it is installed.
Example:
Set asdf to use python 3.8.7 globally
Output during
poetry install
with python version specified as "^3.8" in pyproject.toml:Output of
poetry env
:I believe this is related to this issue, specifically the comment by finswimmer: python-poetry/poetry#1888
The text was updated successfully, but these errors were encountered: