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

Using uv.lock file to define package requirements? #7698

Open
TARHiS opened this issue Sep 26, 2024 · 2 comments
Open

Using uv.lock file to define package requirements? #7698

TARHiS opened this issue Sep 26, 2024 · 2 comments
Labels
enhancement New feature or request projects Related to project management capabilities

Comments

@TARHiS
Copy link

TARHiS commented Sep 26, 2024

When building package with uv build, is it possible to use uv.lock file as a requirements of a package instead of using pyproject.toml dependencies? Use case for this is to create application package that is used to deploy web servers by using private PyPI as a distribution channel.

@zanieb
Copy link
Member

zanieb commented Sep 26, 2024

This would be cool 👍

@zanieb zanieb added enhancement New feature or request projects Related to project management capabilities labels Sep 26, 2024
@tfsingh
Copy link
Contributor

tfsingh commented Sep 28, 2024

I've been doing a good amount of digging on this issue and wanted to check if I'm thinking about this correctly.

My current understanding is that uv itself does not handle dependencies specified in pyproject.toml files during the build process (pyproject.toml files are only scraped for package names/roots during uv build, afaict).

Instead, uv defers to setup_tools as the build backend via the execution of an intermediary Python script. My understanding is that from here, setup_tools uses the given path, scrapes the dependencies from the corresponding pyproject.toml, and builds the package.

I'll be candid in that my understanding of Python packaging (while improving) is limited, but if the above is true then I think this issue might require either:

  1. Injecting some custom logic into setup tools via extensions (looks promising but requires more diligence, haven't verified this would work)
  2. Custom uv build backend :)

Let me know if I'm thinking about this correctly and if so, I'll do some more digging into the first potential solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request projects Related to project management capabilities
Projects
None yet
Development

No branches or pull requests

3 participants