Replies: 2 comments 1 reply
|
@jdx with uv integration enhancements a stated goal for 2025, might this warrant an issue? The workaround is ok, but it would be nice to be able to set Thanks for considering. |
0 replies
|
FWIW, here is how I'm currently handling this to get support for devs who do and don't want to use a local .venv: # ~/.config/mise.toml
[env]
UV_PROJECT_ENVIRONMENT = { value='{% if env.PROJECT_SLUG %}/home/rsyring/.cache/uv-venvs/{{ env.PROJECT_SLUG }}{% endif %}', tools = true }
[settings]
python_venv_auto_create = trueAnd then in a project's PROJECT_SLUG = '{{ config_root | basename | slugify }}'
_.python.venv.path = '{% if env.UV_PROJECT_ENVIRONMENT %}{{ env.UV_PROJECT_ENVIRONMENT }}{% else %}.venv{% endif %}'
_.python.venv.create = trueWould still be nice to see mise recognize The upstream solution would be for uv to support a centralized location for virtualenvs. That is being tracked at: astral-sh/uv#1495 |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
uv's default is to use
.venvfor a project's virtualenv. However, a different path can be provided by using UV_PROJECT_ENVIRONMENT.Currently, mise doesn't check for an alternate location.
This is probably obvious, but the variable being used should come from the result of mise's environment variable processing pipeline.
My current workaround is to set:
But it would be cleaner if I could just:
and trust that whatever uv is doing, mise will play along.
FWIW, my higher-level goal is to support some of our users wanting to use
.venvand some users wanting to put those files in a temporary/cache location. So, our actual project files look like:And then
~/mise.tomlhas:or:
All reactions