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

(python) Only skip creating the venv when the required (first or env._.python.venv.python) python version is missing #3569

Closed
syhol opened this issue Dec 14, 2024 · 2 comments · Fixed by #3576

Comments

@syhol
Copy link
Contributor

syhol commented Dec 14, 2024

As raised here: #1898

While inside directory with the following config:

[env]
_.python.venv = { path = "venv", create = true }

Currently the venv won't be created by mise if any of the requested python tool versions are missing. This enhancement is to instead only skip creating the venv if the specific python version for the venv is missing. The python version is decided as follows:

  1. If env._.python.venv.python is present, then the tool version specified in env._.python.venv.python, e.g.:
    • WHEN _.python.venv = { path = "venv", create = true, version = "3.10" }
    • THEN 3.10 is the venv version
  2. If the python tool is a list of versions, then the first tool version e.g.:
    • WHEN tools.python = ["3.9", "3.10", 3.11"]
    • THEN 3.9 is the venv version
  3. If the python tool is a single version, that version should be used:
    • WHEN tools.python = "3.11"
    • THEN 3.11 is the venv version

This ☝️ is already the effective behaviour for how the venv version is selected, however, how it works under the hood is that if a env._.python.venv.python isn't present then it will use whatever python3 resolves to on PATH.

@jdx
Copy link
Owner

jdx commented Dec 15, 2024

I suspect this isn't as important as it was when #1898 was created because that was when we didn't have precompiled pythons I think

@jdx jdx closed this as completed in #3576 Dec 15, 2024
@syhol
Copy link
Contributor Author

syhol commented Dec 15, 2024

Yeah, most mise installs only take a few seconds for me, but I am blessed with good internet speeds.

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

Successfully merging a pull request may close this issue.

2 participants