powerlevel10k icon indicating copy to clipboard operation
powerlevel10k copied to clipboard

add support for poetry virtualenv

Open ziirish opened this issue 3 years ago • 9 comments

Hi,

Here is a little patch in order to support poetry when looking for a project virtualenv.

This change adds two configuration variables:

# If set to "true", get the virtualenv from poetry if available
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_WITH_POETRY=false
# Show poetry venv only when in a directory tree containing pyproject.toml.
typeset -g POWERLEVEL9K_POETRY_VENV_PROJECT_ONLY=true

ziirish avatar Aug 25 '22 15:08 ziirish

Hello, I tried to use you branch, but it didn't work I see always virtualenv from "virtual env" , and not poetry one

AleksandrLiadov avatar Nov 21 '22 12:11 AleksandrLiadov

Hello, @romkatv Thanks for your awesome work! Could you consider to support Poetry in future?

AleksandrLiadov avatar Nov 21 '22 13:11 AleksandrLiadov

It's a valid feature request. Unfortunately, I cannot merge the PR as is. At this point I would need to go read about poetry and implement the thing. Unfortunately, I'm unlikely to ever find time for that.

romkatv avatar Nov 21 '22 14:11 romkatv

What could/should I do to improve this MR?

@AleksandrLiadov the way I implemented support for poetry is to extend the current support for python venv. This means that if you want to mix both poetry and pyenv or any other venv technology then p10k only pick one. Another problem you may be facing is p10k already has something in its cache regarding this location.

ziirish avatar Nov 21 '22 14:11 ziirish

+1 Poetry is fast becoming the way to do projects in Python.

huyz avatar Jan 06 '23 14:01 huyz

I'll give a +1! Would be nice, and agreed that Poetry is certainly becoming more popular

cjuracek avatar Jul 30 '23 14:07 cjuracek

Hello everyone! I commented on #2450 that there is an alternative to have Poetry support:

https://github.com/romkatv/powerlevel10k/pull/2450#issuecomment-1978792540

I hope that helps. Cheers!

android10 avatar Mar 05 '24 13:03 android10

+1 Poetry is fast becoming the way to do projects in Python.

Never mind. We may be moving on to https://github.com/astral-sh/rye lol. The Python ecosystem is becoming as nutty as JavaScript's…

huyz avatar Jul 12 '24 16:07 huyz