nat-n / poethepoet

A task runner that works well with poetry.
https://poethepoet.natn.io/
MIT License
1.39k stars 56 forks source link

docs recommended method fails to install as plugin at MacOS with poetry 1.8.3 #220

Closed mshonichev closed 2 months ago

mshonichev commented 3 months ago

Official way to install poetry at MacOS is:

brew install poetry

that gives me poetry 1.8.3

After that installing poe as the poetry plugin with command recommended by the documentation becomes severely impossible:

poetry self add 'poethepoet[poetry_plugin]'  
Using version ^0.26.1 for poethepoet

Updating dependencies
Resolving dependencies... (8.7s)

Package operations: 4 installs, 20 updates, 0 removals

  - Downgrading certifi (2024.2.2 /usr/local/lib/python3.12/site-packages -> 2023.11.17): Installing...
  - Downgrading idna (3.7 -> 3.6): Installing...
  - Downgrading more-itertools (10.2.0 -> 10.1.0): Failed

...
  ERROR: Cannot uninstall more-itertools 10.2.0, RECORD file not found. Hint: The package was installed by brew.

Why does poe require older version of more-itertools (also urllib, idna) in that scenario?

Workaround: install via pip

pip install 'poethepoet[poetry_plugin]'

goes flawlessly as DOES NOT require downgrading at all

nat-n commented 3 months ago

Hi @mshonichev, thanks for reporting this issue.

I'm quite surprised that the brew installation can impact what gets installed in the poetry venv. I'll investigate a bit when I have some time.

I wonder if that error is really related to poethepoet, because it only depends on any of those things via poetry (because poetry plugins have to depend on poetry).

nat-n commented 2 months ago

Hi @mshonichev, I just looked at this again and am forced to conclude that the brew installation of poetry is a bit problematic . I didn't replicate this issue but I encountered other issues with the poetry venv created by brew being broken (as it appears to have been for you).

I would advise using the official installer, which hasn't doesn't seem to have this kind of issue.

The following works aas expected for me:

curl -sSL https://install.python-poetry.org | python3 -
poetry self add 'poethepoet[poetry_plugin]'