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

Add contribution points to extension API to add external support for Rye, pixi etc #22797

Open
mitsuhiko opened this issue Jan 29, 2024 · 2 comments
Labels
feature-request Request for new features or functionality needs proposal Need to make some design decisions

Comments

@mitsuhiko
Copy link

This is not an issue I really wanted to open, because I was hoping I can avoid putting yet another thing into the ecosystem that requires custom handling. Unfortunately vscode currently installs tools itself (eg: black etc.) directly in this extension. Rye does not place pip in the virtualenv and requires you to install tools via other means.

Thus for Rye to work well, unfortunately it looks like this extension would have to be expanded.

  • a rye based module installed which invokes rye add --dev package-name followed by rye sync
  • optionally a config key which uses rye tools install package-name (globally instead?)
  • hooks to lint/format that directly uses rye lint and rye fmt which directly pass through to ruff which it bundles

I'm not at all happy that this might mean adding another tool to the list of things that this extension needs to maintain, so I'm open to alternatives. One thought that I had as to add hidden pip support to rye but unfortunately this breaks a lot of stuff. While I can make a fake pip command available that just internally calls rye add, the module check also requires that the pip module in installed which I don't want to do. It would make it impossible for a user to actually install pip if they need it.

I'm also not sure how much interest there is at this point for Rye support in vscode, so maybe that issue can also act as a way to track interest.

Relates to astral-sh/rye#556

@mitsuhiko mitsuhiko added the feature-request Request for new features or functionality label Jan 29, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 29, 2024
@baszalmstra
Copy link

baszalmstra commented Jan 29, 2024

We have the same problem with pixi.

Would it help if the registerEnvironmentProvider as suggested in Environment API would be available and modified to support this usecase e.g. adding additional packages to a custom environment?

It at least sounds like something I would wanna use for pixi as well.

@karthiknadig karthiknadig self-assigned this Jan 29, 2024
@brettcannon
Copy link
Member

We are starting to discuss the idea of a workflow API that would allow extensions to provide contribution points that we delegate to when available. That way we can provide a default experience that can be overridden as appropriate by other workflow tools (it would also mean we would pull out our own support for anything that isn't pip + venv into separate extensions). So this is an issue we are thinking about how to solve.

@baszalmstra FYI I've already talked to Wolf about this idea.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Jan 29, 2024
@karthiknadig karthiknadig added needs proposal Need to make some design decisions and removed info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team labels Jan 29, 2024
@karthiknadig karthiknadig removed their assignment Jan 29, 2024
@karthiknadig karthiknadig changed the title Add Rye Support Add contribution points to extension API to add external support for Rye, pixi etc Jan 29, 2024
karthiknadig pushed a commit that referenced this issue Jun 20, 2024
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>
DonJayamanne pushed a commit to DonJayamanne/pythonVSCode that referenced this issue Jun 24, 2024
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>
eleanorjboyd pushed a commit to eleanorjboyd/vscode-python that referenced this issue Jun 28, 2024
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality needs proposal Need to make some design decisions
Projects
None yet
Development

No branches or pull requests

4 participants