paylogic / pip-accel

pip-accel: Accelerator for pip, the Python package manager
https://pypi.python.org/pypi/pip-accel
MIT License
308 stars 35 forks source link

Ignore already installed requirements #52

Closed rsaftoiu closed 9 years ago

rsaftoiu commented 9 years ago

I have several custom packages that I install before running pip-accel to install the rest of my requirements, however I like to keep those custom ones in the requirements file, as pip just skips them over since they're already present (and it's a problem if they're not).

I just upgraded to the latest pip-accel 0.26.2 and pip 6.0.8 and pip-accel is now failing when installing my requirements.txt because it can't find these already installed packaged. Is there an option to make this work?

This works using pip 1.4.1 and pip-accel 0.22.2.

Thanks!

xolox commented 9 years ago

Hi @rsaftoiu! Thanks for the feedback and sorry I broke backwards compatibility for your use case.

During the pip 6.x upgrade pip-accel switched to using pip install --download which as you pointed out (unintentionally) broke backwards compatibility with previous versions of pip-accel. The reason for this is that when pip is given the --download option it internally enables --ignore-installed.

There is no documented way to avoid this behavior, however I just released pip-accel 0.26.3 which uses an undocumented way (via monkey patching) to restore backwards compatibility with the behavior of older versions of pip-accel. I'm not yet sure if I will regret this later on, but I take backwards compatibility fairly serious, which is why I decided to resort to using monkey patching to restore this behavior.

Please try out pip-accel 0.26.3 and let me know whether it resolves the issue you reported.

rsaftoiu commented 9 years ago

Hi @xolox, thanks for the quick turnaround! Ignoring installed seems to be working now, however it looks like if I try to install an older version of something already installed, that doesn't work, not sure if it's related to your latest change:

(master)[fedora@devel shopventoryapp]$ pip freeze | grep requests
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
requests==2.6.0
(master)[fedora@devel shopventoryapp]$ pip-accel install requests==2.2.1
2015-04-08 19:33:28 devel pip_accel[26545] INFO Unpacking distribution(s) ..
2015-04-08 19:33:28 devel pip_accel[26545] INFO Executing command: pip install --download=/home/fedora/.pip-accel/sources --find-links=file:///home/fedora/.pip-accel/sources --no-index --no-clean --build-directory=/tmp/pip-accel-build-dir-YH2BRy requests==2.2.1
2015-04-08 19:33:28 devel pip.commands.install[26545] INFO Ignoring indexes: https://pypi.python.org/simple
2015-04-08 19:33:28 devel pip.req.req_set[26545] INFO Collecting requests==2.2.1
2015-04-08 19:33:28 devel pip.download[26545] INFO File was already downloaded /home/fedora/.pip-accel/sources/requests-2.2.1-py2.py3-none-any.whl
2015-04-08 19:33:28 devel pip.commands.install[26545] INFO Successfully downloaded requests
2015-04-08 19:33:28 devel pip_accel[26545] INFO Finished unpacking 1 distribution in 0.07 seconds.
2015-04-08 19:33:28 devel pip_accel[26545] INFO Installing from wheel distributions ..
2015-04-08 19:33:28 devel pip_accel[26545] INFO Requirement already satisfied: requests==2.2.1.
2015-04-08 19:33:28 devel pip_accel[26545] INFO Finished installing 0 requirements in 0.02 seconds (1 already installed).
(master)[fedora@devel shopventoryapp]$ pip freeze | grep requests
You are using pip version 6.0.8, however version 6.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
requests==2.6.0
xolox commented 9 years ago

Hi again @rsaftoiu and thanks for the clear bug report. I believe both of the issues you reported are now fixed. I updated the test suite to include a package downgrade so I can't accidentally break support for this later on without noticing. I'm not yet sure how to effectively test the first issue you reported (it's a bit more complex to replicate in a standalone test environment) but I'll see if I can come up with a useful test for that as well.

Can you try out the latest version (pip-accel 0.28.2) and let me know whether the second problem you reported is fixed?

xolox commented 9 years ago

I'm confident that both of the problems you reported here are now resolved so I'm going to close this issue. If you believe either of the problems you reported is not fixed in pip-accel 0.28.2 and newer versions feel free to reopen this issue or open a new one. Thanks for the feedback!

rsaftoiu commented 9 years ago

@xolox Apologies for my delay on this - we actually moved away from pip-accel as we're using docker now and caching the requirements in our base image. Much appreciated, it was great to use pip-accel!