Skip to content

[BUG] Autoinstall doesn't work when python already has a virtualenv set #8

@swirle13

Description

@swirle13

Given the following .mise.toml:

[tools]
poetry = {version='latest', pyproject='pyproject.toml'}
python = {version="3.8", virtualenv="{{env.PROJECT}}/.venv"}

and having exported the following before navigating into my project:

export POETRY_VIRTUALENVS_CREATE=false
export MISE_POETRY_AUTO_INSTALL=1

My environment is correctly activated at ~/project/.venv/bin/python but when running python -m pip freeze, I receive empty output. Thus, poetry did not automatically install my project dependencies in my pyproject.toml.

I would like Poetry to use my given virtualenv within my project and not create its own buried in /Users/name/Library/Caches/pypoetry/virtualenvs/my-env-name

When I tried this without setting POETRY_VIRTUALENVS_CREATE=false, Poetry did install all of my dependencies from my pyproject.toml, but it created its own Poetry-managed venv, which I do not want.

How can I have poetry automatically install my dependencies into a venv located within my project directory (managed by me or Poetry, idc) when I navigate to the project root?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions