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

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

Open
swirle13 opened this issue Feb 1, 2024 · 1 comment

Comments

@swirle13
Copy link

swirle13 commented Feb 1, 2024

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?

@jdx
Copy link
Member

jdx commented Feb 1, 2024

similar to my other thread, I'm just going to be very transparent. I don't work with python enough to be of that much help here.

If I find some time at some point I might be able to dig into this and figure out what to do. I just want to set expectations that this might be never. It also might be next wednesday when I have nothing better to do and feel particularly compelled and it turns out to be not that hard.

Dunno. Please help if you feel capable. I'm always in Discord if you want to chat about the mise side of things.

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

No branches or pull requests

2 participants