Skip to content

Add support for URL dependencies (at least for wheels) #152

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

Closed
charliermarsh opened this issue Oct 20, 2023 · 13 comments
Closed

Add support for URL dependencies (at least for wheels) #152

charliermarsh opened this issue Oct 20, 2023 · 13 comments
Assignees
Labels
enhancement New feature or improvement to existing functionality wish Not on the immediate roadmap

Comments

@charliermarsh
Copy link
Member

charliermarsh commented Oct 20, 2023

  • VCS:
    • Start with just git+
    • The URL must point to a source distribution
    • If the URL ends with a hash, we can use that as the cache key
    • If the URL ends with anything else, we need to resolve it to a commit, then use that as the cache key (and we need to do this lookup every time)
  • URL dependencies can be a source distribution or a wheel
    • For URL dependencies, we should cache based on the HTTP semantics
    • Empirically, it seems that the URL must end in .whl to be considered a wheel; otherwise, it’s considered a source distribution
    • We could even start by not caching anything here
@charliermarsh charliermarsh self-assigned this Oct 23, 2023
@charliermarsh charliermarsh added this to the Initial release milestone Oct 24, 2023
@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Oct 24, 2023
@charliermarsh
Copy link
Member Author

I need to look at how some other tools handle this (e.g., Bun, pip, Poetry).

@charliermarsh
Copy link
Member Author

@charliermarsh
Copy link
Member Author

pypa/pip#10075

@charliermarsh
Copy link
Member Author

pypa/pip#11164

@charliermarsh
Copy link
Member Author

Lots of good discussion in here: pypa/pip#10564 (comment)

@charliermarsh
Copy link
Member Author

Gonna propose something here...

@konstin
Copy link
Member

konstin commented Oct 26, 2023

Unlike pip, we should remember the url contents we installed (e.g. through an etag or another http caching mechanism), check the url every time and reinstall if they changed. For locked requirements.txt, we would need hashes.

@charliermarsh
Copy link
Member Author

Yeah we need a clear mechanism for this. But the pip issues also have a lot of discussion around what happens when you change from a URL dependency to a version dependency, etc.

@charliermarsh charliermarsh added the wish Not on the immediate roadmap label Oct 26, 2023
@charliermarsh
Copy link
Member Author

Probably the biggest remaining "feature" (with the rest of the milestone being largely focused on testing, performance, and polish).

@charliermarsh
Copy link
Member Author

Another challenge here is that we need to fetch and build the distribution in order to know the version.

@charliermarsh
Copy link
Member Author

We could consider attempting to parse the version from the URL, but it won't always be sufficient (and it could even be wrong).

@charliermarsh
Copy link
Member Author

A few other considerations:

  • If there's a URL dependency that satisfies a version, and another package depends on that version in a non-URL capacity, we probably need to allow that. For example, if a user points to a pytorch wheel via URL, and some other package depends on pytorch == 1.0.0, that should be allowed as long as the version at the URL matches the requested version.
  • If there are two conflicting URL dependencies, we need to reject those, even if they resolve to the same version.

@charliermarsh
Copy link
Member Author

Initial version is closed by #251.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality wish Not on the immediate roadmap
Projects
None yet
Development

No branches or pull requests

2 participants