Closed ryanjoneil closed 9 years ago
This pull request contained a bug report and several unrelated changes, one of which suggested an implementation that fixed the reported bug.
pip uninstall
was achieved with the following changes combined:
setup.py
scripts using setuptools (regardless of whether the setup.py
script imports distutils or setuptools).docker
treating colons awkwardly.The bug reported in this pull request is now fixed so I'm going to close this pull request. In the future if you want to contribute, please consider using separate feature branches and pull requests for unrelated issues. It makes it much easier for me to discern related vs. unrelated changes and issues.
Thanks for the feedback!
This fixes and issue we are observing where upgrades of packages do not happen cleanly. The reason is that
pip-accel uninstall
does not remove package contents.If you
pip-accel install scikit-learn==0.14.1
and thenpip uninstall scikit-learn
, there will still be an sklearn directory with Python code in it. Upgrading toscikit-learn==0.15.2
afterward will give a broken build.The reason
pip-accel
can't uninstall binary packages is that it is building them usingpython setup.py bdist
orpython setup.py bdist_dumb
. These commands do not create aninstalled-files.txt
, which is whatpip
uses to track which files belong to a package.This pull request fixes the issue by doing the following:
<TEMP DIR>
, and inside it make a structure likeusr/lib/python2.7/site-packages/
according to whatdistutils
instructs.pip install . --target <TEMP DIR>/<SITE PACKAGES DIR>/
. This is like doing a dumb binary distribution, but includes the filespip
uses for package management.<TEMP DIR>
and, move it to the dist directory, and continue as before.It also adds a
max-retries
option to thepip-accel
configuration, allowing the user to limit the number of potentially costly attempts to build a package. This is important when building a lot of versions of different packages in batch, some of which may no longer be available.