-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
What's the problem this feature will solve?
Currently if you want to exactly match a set of requirements in an existing environment the only way to guarantee it is to delete the environment, create an empty environment, install into that empty environment. Pip sync would fast track this by running one command against the existing environment.
Describe the solution you'd like
sync would offer and act similar to the existing commands, wheel, download, and install. Additionally sync would do:
- Resolve requirements
- Uninstall existing packages which aren't in the result of the resolution
- Upgrade, downgrade, and install packages which are in the resolution
The idea is to match existing commands as close as possible, and initially not providing any additional flags that are sync specific.
Alternative Solutions
Do nothing, leave this up to third party packages like pip-tools.
Additional context
While this would not provide project management it give users an important imperative tool to do their own project management. pip-sync and uv pip sync are widely use and show user demand.
I am not currently working on this, but if there are no design objections I do plan to eventually work on it, probably after installing from lock files lands in pip, as being able to sync against a lock file would by a very useful feature.
Code of Conduct
- I agree to follow the PSF Code of Conduct.