-
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
install-poetry.py
: Use new official install location
#15
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not affiliated with asdf, asdf-poetry, or Poetry, but this looks good to me.
559b7b8
to
bbfbadc
Compare
Additionally I've been using this script installation method on a production website (with poetry |
I'm currently testing locally with the following code, combining #14 and #15 as you suggest. install_poetry() {
local install_type=$1
local version=$2
local install_path=$3
# Ensure the installer will work even if the user has the
# PIP_REQUIRE_VIRTUALENV variable set. Can be removed after this issue is
# resolved: https://github.com/python-poetry/poetry/issues/4089
unset PIP_REQUIRE_VIRTUALENV
if [ "$install_type" != "version" ]; then
fail "asdf-poetry supports release installs only"
fi
semver_ge "$ASDF_INSTALL_VERSION" 1.1.9 && vercomp="ge" || vercomp="lt"
if [ $vercomp == "ge" ]; then
install_url="https://install.python-poetry.org/install-poetry.py"
curl -sSL "$install_url" | POETRY_HOME=$install_path python3 - --version "$version"
else
install_url="https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py"
curl -sSL "$install_url" | POETRY_HOME=$install_path python3 - --version "$version" --no-modify-path
fi
}
install_poetry "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" I have an empty example project in which I'm testing the changes, but it doesn't appear to solve the issue in #10. Here is what I'm running: flynn@MBP ~/projects/poetrytesting
% asdf local python 3.10.0
flynn@MBP ~/projects/poetrytesting
% asdf uninstall poetry 1.1.9
flynn@MBP ~/projects/poetrytesting
% asdf install poetry 1.1.9
Retrieving Poetry metadata
# Welcome to Poetry!
This will download and install the latest version of Poetry,
a dependency and package manager for Python.
It will add the `poetry` command to Poetry's bin directory, located at:
/Users/flynn/.asdf/installs/poetry/1.1.9/bin
You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.
Installing Poetry (1.1.9): Installing Poetry
Installing Poetry (1.1.9): Done
Poetry (1.1.9) is installed now. Great!
To get started you need Poetry's bin directory (/Users/flynn/.asdf/installs/poetry/1.1.9/bin) in your `PATH`
environment variable.
Add `export PATH="/Users/flynn/.asdf/installs/poetry/1.1.9/bin:$PATH"` to your shell configuration file.
Alternatively, you can call Poetry explicitly with `/Users/flynn/.asdf/installs/poetry/1.1.9/bin/poetry`.
You can test that everything is set up by executing:
`poetry --version`
flynn@MBP ~/projects/poetrytesting
% asdf local poetry 1.1.9
flynn@MBP ~/projects/poetrytesting
% asdf local python 3.9.5
flynn@MBP ~/projects/poetrytesting
% rm -rf .venv
flynn@MBP ~/projects/poetrytesting
% poetry run python -V
Creating virtualenv poetrytesting in /Users/flynn/projects/poetrytesting/.venv
Python 3.10.0 For the last few commands I expect the output to be I haven't really explored the newest (extracted) installer. Is part of the intent to resolve this issue in particular or just to decouple the installer from the poetry repo? It appears to be working the same just from a different location. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can merge this with this change since it seems to be the new url for the new installer. Unfortunately it does not resolve #10
bbfbadc
to
642b8a7
Compare
This operates independently of poetry releases so it can pull bugfixes merged outside of poetry's own release cadence. See also: - https://github.com/python-poetry/install.python-poetry.org - python-poetry/poetry#3345 (comment) In conjunction with asdf-community#14 this gets python 3.10 working with poetry 1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.
642b8a7
to
8b92b4f
Compare
@crflynn Updated to the URL specified (via squashing)
It's decoupled from the poetry repo, just the new URL. But the reason why I claimed it'd be potentially related comments around this: python-poetry/poetry#3345 (comment) |
The key point from the Poetry maintainer, and I believe the reason @crflynn experienced no joy, is that the needed patches have been merged to |
This operates independently of poetry releases so it can pull
bugfixes merged outside of poetry's own release cadence.
Error:
ModuleNotFoundError: No module named 'cleo'
Versions: Python 3.10 and poetry 1.1.7 - 1.1.11
See also:
In conjunction with #14 this gets python 3.10 working with poetry
1.1.11 where ModuleNotFoundError: No module named 'cleo' was raised.