Yelp / venv-update

Synchronize your virtualenv quickly and exactly.
http://venv-update.rtfd.org
MIT License
176 stars 34 forks source link

Replace conflict detection with `pip check`? #210

Open asottile opened 6 years ago

asottile commented 6 years ago

pip check (added in pip 9) almost eliminates the need for the conflict detection code in venv-update.

pip-check

$ pip check
conflicting-package 1 has requirement many-versions-package<2, but you have many-versions-package 3.

pip-faster

$ pip-faster install -r requirements.txt --find-links file://$PWD
...
Error: version conflict: many-versions-package 3 (venv/lib/python3.6/site-packages) <-> many-versions-package<2 (from conflicting-package->-r requirements.txt (line 2))

pip-faster has slightly more information because it is performing the installation.

pip 10 (during install)

I currently don't see a way to turn the warning into an error, maybe this would be an easy upstream patch?

$ pip install -r requirements.txt --find-links file://$PWD
Looking in links: file:///tmp
Collecting dependant-package (from -r requirements.txt (line 1))
Collecting conflicting-package (from -r requirements.txt (line 2))
Collecting many-versions-package<4,>=2 (from dependant-package->-r requirements.txt (line 1))
Collecting implicit-dependency (from dependant-package->-r requirements.txt (line 1))
Collecting pure-python-package>=0.2.1 (from dependant-package->-r requirements.txt (line 1))
conflicting-package 1 has requirement many-versions-package<2, but you'll have many-versions-package 3 which is incompatible.
Installing collected packages: many-versions-package, implicit-dependency, pure-python-package, dependant-package, conflicting-package
Successfully installed conflicting-package-1 dependant-package-1 implicit-dependency-1 many-versions-package-3 pure-python-package-0.2.1