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 for uv.sources #151

Open
bravhek opened this issue Jan 8, 2025 · 4 comments
Open

Support for uv.sources #151

bravhek opened this issue Jan 8, 2025 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bravhek
Copy link

bravhek commented Jan 8, 2025

What's the problem this feature will solve?

Resolve dependencies from non pypi sources like GitHub repos.

Describe the solution you'd like

Use uv's project dependency resolution. If a dependency has been declared in [tool.uv.project] resolve from that source instead of pypi (name colition)

@bravhek bravhek added the enhancement New feature or request label Jan 8, 2025
@gaborbernat
Copy link
Member

PR welcome... but I don't plan adding this myself.

@gaborbernat gaborbernat added the help wanted Extra attention is needed label Jan 10, 2025
@paveldikov
Copy link
Contributor

I am interested in this feature and am happy to contribute but I think I could use some architectural debate/guidance.

To me it appears that root cause here is that uv.sources only kicks in when a package is being installed direct from pyproject.toml which is not what tox does. Rather it:

  1. builds project (sdist -> wheel)
  2. installs project dependencies
  3. installs built wheel without dependencies

in separate stages, as opposed to doing a singular uv pip install {toxinidir} command.
Therefore uv's handling of sources simply does not kick in.

Coalescing into a single install stage/command would probably be very involved brain-surgery and probably break the tox model. Alternatively we could parse pyproject.toml and try to emulate uv's handling of sources, but that sounds architecturally icky.

Ideally I'd be able to force-feed a pyproject.toml as a configuration item to a uv command (without actually installing it - or having to convert to uv.toml schema) and then the source specification should natively kick in?

cc @charliermarsh in case there is a more elegant way of going about this

@gaborbernat
Copy link
Member

Coalescing into a single install stage/command would probably be very involved brain-surgery and probably break the tox model. Alternatively we could parse pyproject.toml and try to emulate uv's handling of sources, but that sounds architecturally icky.

IMHO this is the path ahead.

@paveldikov
Copy link
Contributor

Assuming you meant the former, this is interesting and I didn't expect that to be your preference!

It does make things easier, but means that there will be lots of no-op stages i.e..pkg and install_package_deps will have to be overridden into no-ops because install_package does it all in one fell swoop.

TBH this isn't unique to uv as pip install . does the same isolated-build-then-install dance in modern versions of pip. Maybe that could be a more general architectural simplification in tox although it is a much bigger bite than I can chew ATM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants