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

pip-accel not updating package #56

Closed geertn closed 8 years ago

geertn commented 9 years ago

Maybe I'm making an obvious mistake, or my use case might not be suitable for pip-accel. Sorry in advance :)

I'm using pip to install/update packages in a ve. When using pip-accel my package is not updated to the latest version present on my pypi server, probably because of the --no-index option used for pip? Is there any way I can configure pip-accel to scan my pypi server to check for an updated package?

I was expecting this behaviour only when using pinned versions.

> (ve)[idgen@test3-ipw idgen]$ pip-accel -v install -U --extra-index-url https://user:pass@pypi.host.eu/simple/ datamodel
>2015-07-01 11:10:55 test3-ipw pip_accel[21722] INFO Unpacking distribution(s) ..
>2015-07-01 11:10:55 test3-ipw pip_accel[21722] INFO Executing command: pip install --download=/home/idgen/.pip-accel/sources --find-links=file:///home/idgen/.pip-accel/sources --no-index --no-clean --build-directory=/tmp/pip-accel-build-dir-F5f9LE -v -U --extra-index-url https://user:pass@pypi.host.eu/simple/ datamodel
>2015-07-01 11:10:55 test3-ipw pip.commands.install[21722] INFO Ignoring indexes: https://pypi.python.org/simple,https://user:pass@pypi.host.eu/simple/
>2015-07-01 11:10:55 test3-ipw pip.index[21722] DEBUG 0 location(s) to search for versions of datamodel:
embolalia commented 9 years ago

It seems pip-accel will install whatever is in its cache, regardless of whether there's a new version in its index, unless you specify the version you want to install. Interestingly, it also does this if you try to do something like pip-accel install --upgrade ./package-1.2.3.tar.gz, which had me quite confused.

This kinda makes sense, if I understand how it works. I'd assume it treats every requirement the same, and if the package I'm installing specifies a requirement without a version specifier, I want it to just use whatever's in the cache. It'd be nice if this behavior could be overridden to have it ignore the cache just for the package in the actual command when the --upgrade flag is given, regardless of whether a version specifier is given. I don't know how feasible that is.

Failing that, the way I've scripted around this is to run rm $(python -c 'from pip_accel.config import Config; print Config().data_directory')/sources/$PACKAGE_NAME* before the install command to manually clear it from the cache.

geertn commented 9 years ago

Thx for your comment. Way we solved it is first do a run with pip-accel and after that do a run with standard pip.

xolox commented 8 years ago

Hi @geertn and @embolalia,

Thanks for the feedback and sorry for not replying here earlier.

The behavior described in this issue is indeed how pip-accel was originally designed to work, so not exactly a bug. When the (name, version) requirements specified on the command line can be satisfied based on cached source and binary distributions on the local file system pip-accel would install those and not go looking for updates on remote package indexes.

However just because pip-accel was designed like this doesn't mean that this behavior of ignoring the -U, --upgrade option hasn't annoyed the hell out of me :-). This is why I've just released pip-accel 0.34 which changes behavior in this respect:

I believe that with this change things should work as intuitively as possible. Sorry about the confusion caused by the behavior of previous versions!