asdf-community / asdf-poetry

Poetry plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
77 stars 16 forks source link

Unable to install poetry on ubuntu #44

Open pythoninthegrass opened 9 months ago

pythoninthegrass commented 9 months ago

Provide environment information

OS:
Linux $HOSTNAME 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

SHELL:
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

BASH VERSION:
5.1.16(1)-release

ASDF VERSION:
v0.14.0-ccdd47d

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=~/.asdf
ASDF_DIR=~/.asdf
ASDF_CONFIG_FILE=~/.asdfrc

ASDF INSTALLED PLUGINS:
awscli                       https://github.com/MetricMike/asdf-awscli.git main 2e31396
gcloud                       https://github.com/jthegedus/asdf-gcloud main 00cdf06
golang                       https://github.com/kennyp/asdf-golang.git master 033730c
helm                         https://github.com/Antiarchitect/asdf-helm.git master a39e17b
helmfile                     https://github.com/nwiizo/asdf-helmfile.git main d58d7df
kompose                      https://github.com/technikhil314/asdf-kompose.git master 2706fa5
kubectl                      https://github.com/asdf-community/asdf-kubectl.git master cbe6df4
kubectx                      https://github.com/virtualstaticvoid/asdf-kubectx.git master 4e8e865
kustomize                    https://github.com/Banno/asdf-kustomize.git master 8e929af
lazydocker                   https://github.com/comdotlinux/asdf-lazydocker.git master abb6f71
lazygit                      https://github.com/nklmilojevic/asdf-lazygit.git main 78e04f1
mongodb                      https://github.com/sylph01/asdf-mongodb.git master 9818a8d
nodejs                       https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
packer                       https://github.com/asdf-community/asdf-hashicorp.git master 197e3ec
poetry                       https://github.com/asdf-community/asdf-poetry.git master e2a3c34
python                       https://github.com/danhper/asdf-python.git master 5e277e2
ruby                         https://github.com/asdf-vm/asdf-ruby.git master 7a22142
rust                         https://github.com/asdf-community/asdf-rust.git master 8436012
terraform                    https://github.com/asdf-community/asdf-hashicorp.git master 197e3ec
vault                        https://github.com/asdf-community/asdf-hashicorp.git master 197e3ec

Ubuntu version

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

To Reproduce

$ asdf install poetry latest
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:

~/.asdf/installs/poetry/1.7.1/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.7.1): Done

Poetry (1.7.1) is installed now. Great!

To get started you need Poetry's bin directory (~/.asdf/installs/poetry/1.7.1/bin) in your `PATH`
environment variable.

Add `export PATH="~/.asdf/installs/poetry/1.7.1/bin:$PATH"` to your shell configuration file.

Alternatively, you can call Poetry explicitly with `~/.asdf/installs/poetry/1.7.1/bin/poetry`.

You can test that everything is set up by executing:

`poetry --version`

Configuring poetry to behave properly with asdf ...
Running: "poetry config virtualenvs.prefer-active-python true".

Unclosed array (at line 7, column 5)

Cleanup: Something went wrong!

60 ~/.asdf/plugins/poetry/bin/install: "$install_path"/bin/poetry config virtualenvs.prefer-active-python true

Describe the Bug

The ~/.asdf/plugins/poetry/bin/install script is not installing poetry due to a syntax error on line 60. Tried editing to get it to work, but it was a bigger lift than expected.

Configuring poetry to behave properly with asdf ...
Running: "poetry config virtualenvs.prefer-active-python true".

Unclosed array (at line 7, column 5)

Cleanup: Something went wrong!

60 ~/.asdf/plugins/poetry/bin/install: "$install_path"/bin/poetry config virtualenvs.prefer-active-python true

Expected Behaviour

Should be able to run asdf install poetry latest and it finds the current release, installs, then adds to asdf's shims.

Don't have the same problem on my local dev box running macOS 14.2 (23C64) (M2 Pro).

mikecsmith commented 9 months ago

EDIT: Sorry - I meant to reply to the MacOS issue - apologies the link below may not help.


Hope the fix in this issue helps @pythoninthegrass: https://github.com/mise-plugins/mise-poetry/issues/9

It'll be slightly different paths for ASDF but I've literally just been dealing with this and came across the fix for mise.

pythoninthegrass commented 9 months ago

Should note, the official installer script works as expected

$ curl -sSL https://install.python-poetry.org | python3 -
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:

/home/wpai/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.7.1): Done

Poetry (1.7.1) is installed now. Great!

You can test that everything is set up by executing:

`poetry --version`

And the version

$ poetry --version
Poetry (version 1.7.1)
mikecsmith commented 9 months ago

Sorry - left a comment above - I replied to the wrong issue. Apologies for taking up your time 👍

pythoninthegrass commented 9 months ago

EDIT: Sorry - I meant to reply to the MacOS issue - apologies the link below may not help.

Hope the fix in this issue helps @pythoninthegrass: mise-plugins#9

It'll be slightly different paths for ASDF but I've literally just been dealing with this and came across the fix for mise.

Haha no worries @mikecsmith! Appreciate the quick response regardless.

Really appreciate you all putting your work out in the open for OSS 🙏