Skip to content
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

add support for poetry virtualenv #1994

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ziirish
Copy link

@ziirish ziirish commented Aug 25, 2022

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

@AleksandrLiadov
Copy link

AleksandrLiadov commented Nov 21, 2022

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

@AleksandrLiadov
Copy link

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

@romkatv
Copy link
Owner

romkatv commented Nov 21, 2022

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.

@ziirish
Copy link
Author

ziirish commented Nov 21, 2022

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.

@huyz
Copy link

huyz commented Jan 6, 2023

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

@cjuracek
Copy link

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

alexjurkiewicz added a commit to alexjurkiewicz/powerlevel10k that referenced this pull request Oct 12, 2023
Heavily based on romkatv#1994.

Integrate Poetry virtualenv detection into the existing virtualenv
segment. For poetry virtualenvs, use the package name as reported by
`poetry version`.
@android10
Copy link

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

#2450 (comment)

I hope that helps. Cheers!

@huyz
Copy link

huyz commented Jul 12, 2024

+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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants