mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
![]() ## Summary This adds a `--prune` flag to the `export` command to correspond with the `--prune` flag of the `tree` command. The purpose is for generating a `requirements.txt` that omits a package and all of that package's unique dependencies. This is useful for cases where the project has a dependency on a common core package, but where that package does not need to be installed in the target environment. For example, a pyspark job needs spark for development, but when installing into a cluster that already has pyspark installed, it is desirable to omit pyspark's whole dependency tree so that only the unique dependencies that your job needs get installed, and do not risk breaking the pyspark dependencies with something incompatible. Dev groups cannot always cover this case because there are other projects where this common dependency occurs as a transitive. One example is Airflow providers, which include Airflow itself as a dependency, but it is unnecessary and undesirable to include Airflow's dependency tree in the `requirements.txt` for your DAGs. Partly related to #7214, though I'm not sure it covers the ask in that one of having this functionality extend to the project's actual published metadata. ## Test Plan An integration test was added, and some manual testing. Let me know if more would be better. --------- Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com> |
||
---|---|---|
.. | ||
src | ||
build.rs | ||
Cargo.toml |