astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.05k stars 597 forks source link

Paths to using published versions of vendored, forked crates? #5588

Open musicinmybrain opened 1 month ago

musicinmybrain commented 1 month ago

While finishing up a uv package for Fedora Linux, I’ve documented several cases where third-party crates have been copied into uv.

(Please correct me if any of the above is not quite right.)

Fedora policy requires me to ask if there is a path toward eventually using a system copy of any or all of these libraries, i.e., if the necessary changes may eventually be worked around or upstreamed in the original crates.io packages.

musicinmybrain commented 1 month ago

I also found that crates/uv-python/python/packaging is vendored from https://pypi.org/project/packaging, but the fact that uv does not necessarily depend on a Python interpreter or environment provides much of the explanation for why this is necessary, and the commit message for 7964bfbb2bed50a5c7b0650a7b6799a66503a33a seems to provide most of the remaining rationale.

A similar rationale seems to apply for crates/uv-virtualenv/src/activator/, bundled and slightly forked from files in https://pypi.org/project/virtualenv and specificially https://github.com/pypa/virtualenv/tree/main/src/virtualenv/activation.

musicinmybrain commented 1 month ago

Regarding forked crates that are not directly vendored, but referenced by git dependencies:

konstin commented 1 month ago

crates/pep440-rs is forked from version 0.6.0 of https://crates.io/crates/pep440_rs which is maintained in https://github.com/konstin/pep440-rs crates/pep508-rs is forked from version 0.6.0 of https://crates.io/crates/pep508_rs which is maintained in https://github.com/konstin/pep508_rs crates/uv-virtualenv/ as a whole is derived from https://github.com/konstin/gourgeist 0.0.4, which was published as https://crates.io/crates/gourgeist. I am inclined not to treat this as a case of bundling, because it looks like the project was subsumed into uv, and the link to uv at https://konstin.github.io/gourgeist/ seems to support this.

These have diverged significantly and the upstream versions are only passively maintained, uv requires these custom versions and can't use a system copy.