Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
## Summary Allow using http(s) urls for constraints and requirements files handed to the CLI, by handling paths starting with `http://` or `https://` differently. This allows commands for such as: `uv pip install -c https://raw.githubusercontent.com/apache/airflow/constraints-2.8.1/constraints-3.8.txt requests`. closes #1332 ## Test Plan Testing install using a `constraints.txt` file hosted on github in the airflow repository: https://github.com/jannisko/uv/blob/fbdc2eba8e5e8fb4160baae495daff8fb48df13f/crates/uv/tests/pip_install.rs#L1440-L1484 ## Advice Needed - filesystem/http dispatch is implemented at a relatively low level (at `crates/uv-fs/src/lib.rs#read_to_string`). Should I change some naming here so it is obvious that the function is able to dispatch? - I kept the CLI argument for -c and -r as a PathBuf, even though now it is technically either a path or a url. We could either keep this as is for now, or implement a new enum for this case? The enum could then handle dispatch to files/http. - Using another abstraction layer like https://docs.rs/object_store/latest/object_store/ for the files/urls/[s3] could work as well, though I ran into a bug during testing which I couldn't debug
- Loading branch information