Poetry: Please support .venv

Created on 14 Jun 2018  路  14Comments  路  Source: python-poetry/poetry

Please support a local .venv directory or link containing the virtualenv.
This way some tools like PyCharm just recognise the .venv and use it.

And for a manual link creation it would help to print out the full path rather than
"Creating virtualenv django-secrets-py3.6 in /Users/andy/Library/Caches/pypoetry/virtualenvs"
This sadly cant be used for copy and paste.

Most helpful comment

A .venv directory is already supported by poetry.

If you already have one it will be used automatically. If you want all your virtualenvs to be created in the local .venv you have to set the appropriate setting:

poetry config settings.virtualenvs.in-project true

All 14 comments

A .venv directory is already supported by poetry.

If you already have one it will be used automatically. If you want all your virtualenvs to be created in the local .venv you have to set the appropriate setting:

poetry config settings.virtualenvs.in-project true

could you please document that and all other missing settings?

ill leave that ticket open as a reminder

It would be really nice if poetry config --list would list all options and defaults, not just the one that was changed.

yes, good point - maybe the changed valued on top or if there are many options, maybe another --list-all switch

or 'poetry config' - with no arguments could list the current config block ? Maybe with a help message describing how to set overrides.

@kakulukia I've documented the available settings on #232. I'd appreciate if you could take a look at it :)

looks great ! still - its always nice when tools can be self-documenting. And 'poetry config' should output something - a link to those docs, or a usage message - or something.

@Imaclean74 I agree 100%. I'm going to leave that decision to @sdispater, though.

@Imaclean74 In version 0.11, poetry config --list outputs all values, even if unset.

nice!

I didn't see a summary in the documentation, so this is my understanding of what I've gleaned above. If I've set poetry config settings.virtualenvs.in-project true, then poetry install will create a project .venv directory and populate it with the correct python version based on pyproject.toml (?). If the project has a .venv directory in the project, then it will be respected regardless of settings.virtualenvs.in-project. poetry shell will use .venv and $VIRTUAL_ENV will be the path to that directory. There doesn't seem to be a convention about what the directory should be named, so I'll follow whatever default you have coded up. Please advise. Thanks.

@mcarifio There is no convention to what the virtual env directory is named, but the most common are env, .env, venv, and .venv. The last one is probably the most popular and is the one poetry checks. I'm not sure if it looks for the other names, but it's simple enough to check by creating a new empty project with a virtual env in it.

@chingc ty

Was this page helpful?
0 / 5 - 0 ratings

Related issues

probablykasper picture probablykasper  路  3Comments

jackemuk picture jackemuk  路  3Comments

jeremy886 picture jeremy886  路  3Comments

ulope picture ulope  路  3Comments

AWegnerGitHub picture AWegnerGitHub  路  3Comments