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

Support uv pip compile on uv manager #30909

Open
rarkins opened this issue Aug 20, 2024 Discussed in #30899 · 7 comments · May be fixed by #33952
Open

Support uv pip compile on uv manager #30909

rarkins opened this issue Aug 20, 2024 Discussed in #30899 · 7 comments · May be fixed by #33952
Labels
manager:pep621 Python pyproject.toml files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Aug 20, 2024

Discussed in #30899

Originally posted by mkniewallner August 20, 2024

Tell us more.

Support for uv manager was added in #30756, which closed #27841, but the PR only added a partial implementation, as uv supports 2 different ways of locking dependencies:

  • universal one with uv.lock output, which the PR implemented
  • pip-tools-like one with requirements.txt output, through uv pip compile, which was the initial discussion of the issue

Having a dedicated issue for the 2nd item would make it easier to track support for it as well.

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Aug 20, 2024
@zanieb
Copy link

zanieb commented Aug 20, 2024

(and the pip-tools like interface also includes a --universal resolution flag to perform universal resolutions in the legacy format)

@jonathan-s

This comment was marked as resolved.

@zanieb

This comment was marked as resolved.

@jonathan-s jonathan-s removed their assignment Sep 19, 2024
@gotcha

This comment was marked as resolved.

@ollie-bell
Copy link

ollie-bell commented Dec 22, 2024

There is possibly a 3rd uv use case which hasn't been implemented in #30756 but also isn't solved via the uv pip compile --universal route... that is using uv export after uv lock to still generate a requirements.txt based lock file.

For example if you want to use "native" uv.lock-based development with the ability to specify dependencies and dependency groups in pyproject.toml etc., but you also aren't planning on using uv for e.g. application deployment so you still wish to use uv export to generate a universal requirements.txt.

I imagine this would be an optional extra (to run uv export with some user arguments) at the end of the workflow implemented in #30756?

@rarkins rarkins added the manager:pep621 Python pyproject.toml files label Jan 9, 2025
@jiaweikho
Copy link

Hi @rarkins,

I’ve been following this discussion and before diving deeper into this, I had a few questions regarding the design of this feature.

From what I’ve observed, none of the package managers currently supported by Renovate have manager-specific configuration options tailored in this way. It seems like introducing custom configuration options for uv would be a departure from the existing patterns.

Would introducing such options be acceptable, or do you envision a more generalized approach that fits within Renovate's existing design philosophy? If there’s an example of manager-specific configuration I might have missed, could you point me to it? That would help guide the implementation and align it with Renovate's overall architecture.

Unless I'm misunderstanding this feature request, I think we might need a configuration option like:

{
  "lockFileMaintenance":{
    "lockfile": "uv.lock" // or "requirements.txt" or ["uv.lock", "requirements.txt"]
  }
}

This would abstract away the exact mechanism/options used to generate the lockfile. This seems more idiomatic with other configuration options.

@jiaweikho
Copy link

I've only just realised that we could do something similar to pip-compile by adding ["(^|/)requirements\\.txt$"] to uv's fileMatch configuration triggering uv compile. This would need to be opt-in and this will require disabling pip-compile, pip-requirements and pip-setup to avoid conflicts. Since there is no uv-specific configuration and this might go into the pep621 config, are there other pep621 managers that could conflict too?

@rarkins rarkins added type:feature Feature (new functionality) and removed type:feature Feature (new functionality) labels Jan 19, 2025
@maxbrunet maxbrunet linked a pull request Jan 30, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:pep621 Python pyproject.toml files priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants