-
Notifications
You must be signed in to change notification settings - Fork 355
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
Automatic Python venv activation doesn't account for Framework builds on macOS #1354
Comments
potential "solution" here: #1357 |
Thanks for that discussion! I voted for the third option (add a setting, default off). That said, I don't think that's quite the same here, because I don't think this is a problem with venv creation. Since you're planning to retain the automatic activation feature, I think it'd still be useful to keep the "is this a mise-managed Python" check, which is where the problem really is in this case. You'd get the same warning with the code as-is if a user just ran There are two fixes to this logic that I can think of quickly. The first is that I think it'd be enough to check that the symlinked Python in the venv folder shares a common root (up to the first version number). For example, |
Not really, a use-case I'm trying to add is using the system python. Though I could detect if it should be mise-managed and do the check in that case. I'll have to think about it. What you said makes sense as a solution. Part of my thinking here is that this logic has been a very common source of problems and since I'm not a python dev I'm not sure if it'll ever be great. "Doing less" might be the smarter way to go here but I'm still trying to decide. |
Edit: I just reread your post and noticed the comma between "really" and "a", which totally inverts the meaning of the sentence 😅 Anyways, the last paragraph below is still relevant!
Anyhow, I fully support whatever you want to do here. I totally get not being a Python dev, and the conventions around virtual environments (and conda and poetry and...) are just bananas and always changing. Deleting this whole feature definitely makes sense to me from a maintenance standpoint! |
this check is now gone and venv creation is behind a setting so this should be resolved |
Describe the bug
Python on macOS supports a Framework build mode to bundle it as a macOS application. This is needed to access Mac GUI components properly, for example, for matplotlib plots to use Mac GUI windows. In a Framework build, the Python executable is located at
~/.local/share/mise/installs/python/3.10.13/Library/Frameworks/Python.framework/Versions/3.10/bin/python
. However, thevirtualenv
function of the Python core plugin assumes that the symlink binary is at~/.local/share/mise/installs/python/3.10.13/bin/python
and warns that the virtualenv is incorrect. Note that this is true for any recent Python, I happen to be using 3.10.To Reproduce
env PYTHON_CONFIGURE_OPTS="--enable-framework" mise install -v python@3.10 mise use python@3.10
edit
.mise.toml
to use thevirtualenv
setting, then allow mise to create the virtualenv and you get the output:Expected behavior
No warning is produced and the virtualenv is activated.
mise doctor
outputAdditional context
The problematic line is here: https://github.com/jdx/mise/blob/581b6e8aa56476d8d184c2cae2bd7657c8690143/src/plugins/core/python.rs#L153C39-L153C39
The text was updated successfully, but these errors were encountered: