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

RFC: Resolvers and environment management in ASV #1436

Open
HaoZeke opened this issue Oct 7, 2024 · 5 comments
Open

RFC: Resolvers and environment management in ASV #1436

HaoZeke opened this issue Oct 7, 2024 · 5 comments

Comments

@HaoZeke
Copy link
Member

HaoZeke commented Oct 7, 2024

There are now a bunch of front-end (CLI) tools which handle dependency resolution and installation of environments, including rip, rye (both already dropped out1), and uv.

A key issue is that most of these tools (including mamba) don't actually expose the functionality which asv really needs2, that is the dependency resolution / a Python API (e.g. see astral-sh/uv#7345) itself. This is accomplished via pubgrub-rs in uv, resolvo in pixi / rip and the venerable libsolv in mamba.

Somewhat related are these issues around the ecosystem:

Basically, moving forward, it seems like the best approach is to generate bindings to uv internals like the dependency resolution while extracting the environment management out further. Or by using py-rattler (here). Although the CycloneDX SBOM might also be of interest as an intermediate file format 3.

Another option is to use subprocess to drive calls to uv or something similar, but in the long run this is more problematic, since parsing CLI is never a great idea, and also leaves the project vulnerable to changes in the in internal lock file representation.

Footnotes

  1. e.g. this comment

  2. e.g. the trouble with the libmambapy dependency which needed a new release since part of the API was removed.

  3. https://github.com/CycloneDX/cyclonedx-python

@HaoZeke
Copy link
Member Author

HaoZeke commented Oct 7, 2024

For some more context, this matters to asv because when run with existing environments, we still need to know the changes to versions relative to the last known configuration.

@lucascolley
Copy link
Contributor

@HaoZeke with mamba 2.0 it seems like some of the things we need have been made public. gh-1438 reports that the current mamba plugin is incompatible with mamba 2.0. Just to check, do you have any plans to move forwards with an alternative like uv or rattler and deprecate support for new versions of mamba? If not, I've started a very rough draft of changing the mamba plugin for 2.0 compatibility at #1439. The mamba docs aren't great here, so I've been asking for some clarifications at mamba-org/mamba#3567.

@HaoZeke
Copy link
Member Author

HaoZeke commented Oct 30, 2024

Great questions.

Just to check, do you have any plans to move forwards with an alternative like uv or rattler and deprecate support for new versions of mamba?

I'm not planning that, although if I get this correct then I'd spin out all the environment managers except virtualenv into their own packages, so asv itself will not have a release schedule tied to mamba or conda.

If not, I've started a very rough draft of changing the mamba plugin for 2.0 compatibility at #1439.

This is fantastic contribution in any case and would be happy to accept that and review it whenever its ready.

The mamba docs aren't great here, so I've been asking for some clarifications at mamba-org/mamba#3567.

Like pixi, they really move too quickly for good documentation of the internals.

The overall goal here is not to switch to one environment manager over the other, but to incorporate a sort of software bill of materials (SBOM) into ASV. This SBOM can then be satisfied by any of the environment managers (even system ones) and since ASV in this scenario will be able to determine the required / changed requirements better support using existing environments.

@HaoZeke
Copy link
Member Author

HaoZeke commented Oct 31, 2024

After discussions with @rgommers, it seems like one pragmatic approach is to simply focus on offloading to the stable CLI and generating lockfiles of say, uv for pip or pixi for the conda-ecosystem.

@pauloxnet
Copy link

I would love to see uv support in ASV. Thanks for pushing this forward.

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

No branches or pull requests

3 participants