-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add locator for pixi environments #22968
Conversation
@microsoft-github-policy-service agree company="Prefix.dev GmbH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, please create an issue corresponding to the same, we hope to get to this shortly.
Ofc, see #22978 |
I took the time to also add tests. These are based on the ones from hatch and poetry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work, I'm happy with it overall. If you could also work on the test plan item to verify it, that would be great. for eg. #21298, #21102.
See #22779 (comment) for similar ask from another tool, feel free to let me know if there's any questions,
Looking at #22779 (comment) this PR currently only adds discovery, (I would like to work on the rest after this). Would a test-plan like this suffice? Requirements:
Verification:
|
@baszalmstra maybe also add multi envs to the test plan? |
@pavelzw That sounds fine for discovery, I think this PR might also cover additional scenarios, as pixi environments are essential conda under the hood: Activation and Execution:Installation:
If this doesn't work, we might need to add a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge conflicts ⚔️ Here's an example test plan item for the Discovery & Activation part: #23088. Please @ me once this is done, unsubscribing for now.
Will this also work for R? |
One strange thing for me is the fact that VS Code detects python |
@niemiaszek This is not merged yet. There was a bug in python extension, we released a bug fix last week. |
@baszalmstra Would it be possible to address the merge conflict. |
I suspect this is a bug with VS Code's detection of Conda environments, and doesn't have to do with Pixi. I see it in projects where I'm not using pixi. I suspect it arises from the Python executable detection since Conda environments with, for example, Python 3.12 include |
Could it be because conda env's contain symlinks from |
Yes, that's precisely my suspicion. Shall we split this off into a separate issue so that we can focus on the pixi locator? I believe this bug is not at all specific to this PR. EDIT: I moved the details to a new issue #23649 |
@maresb seems like a good idea to me! |
I know quite a lot of people are waiting on this to make the transition to Pixi. When can we expect the next release python extension @DonJayamanne? 👏 |
This should be available in the pre-release published this morning. |
Closes #22978 This adds a locator implementation that properly detects [Pixi](https://pixi.sh/) environments. Pixi environments are essentially conda environments but placed in a specific directory inside the project/workspace. This PR properly detects these and does not do much else. This would unblock a lot of pixi users. I would prefer to use a custom pixi plugin but since the [contribution endpoints are not available yet](#22797) I think this is the next best thing. Before I put more effort into tests I just want to verify that this approach is valid. Let me know what you think! :) --------- Co-authored-by: Tim de Jager <tim@prefix.dev>
Closes microsoft#22978 This adds a locator implementation that properly detects [Pixi](https://pixi.sh/) environments. Pixi environments are essentially conda environments but placed in a specific directory inside the project/workspace. This PR properly detects these and does not do much else. This would unblock a lot of pixi users. I would prefer to use a custom pixi plugin but since the [contribution endpoints are not available yet](microsoft#22797) I think this is the next best thing. Before I put more effort into tests I just want to verify that this approach is valid. Let me know what you think! :) --------- Co-authored-by: Tim de Jager <tim@prefix.dev>
Hi. Thank you very much! Should this now be shipped in v1.91 ? For me it doesn't seem to work. When I follow the steps here: https://holoviz-dev.github.io/panel/developer_guide/index.html#pixi Also: the version number shown in the Python selector is incorrect for some conda envs. E.g. I have a conda env called ![]() |
@cdeil, I believe you need to distinguish between "VS Code" releases and "Python extension" releases because they are decoupled. Here are the Python extension versions I see: The last regular release of the Python extension is from 3 weeks ago, which is older than the first prerelease containing the fix, so this isn't yet generally available. Installing the prerelease is as simple as clicking a button, see #23649 (comment) |
@maresb - Thanks! Indeed when I switch to Python pre-release the pixi env is discovered. However trying to use it for a Jupyter notebook didn't work for me. Reported it here: microsoft/vscode-jupyter#15831 |
I'm using pip and venv for my package management and virutal environemnts Is there a way not to use pixi? some enable/disable flag? |
@yuvalpick Could you share the message you are getting? Do you have |
@ruben-arts I'm currently getting
and the test discovery hangs indefinitely btw, my vscode is version EDIT
but now tested are being discovered |
@yuvalpick As far as I see, this shouldn't break your other work. I think we should make this a verbose message instead of a normal warning level message. |
This only seems to work if the pixi.toml is in the root folder of the vscode project. How can I move it to a different location but still detect the envs in vscode? |
In my case, I'm using a multi-root workspace with a single pixi.toml at the root folder. I had to create symlinks to the .pixi in each of the folders for it to actually work. |
Closes #22978
This adds a locator implementation that properly detects Pixi environments. Pixi environments are essentially conda environments but placed in a specific directory inside the project/workspace. This PR properly detects these and does not do much else. This would unblock a lot of pixi users.
I would prefer to use a custom pixi plugin but since the contribution endpoints are not available yet I think this is the next best thing.
Before I put more effort into tests I just want to verify that this approach is valid. Let me know what you think! :)