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

0.28.2 raises ValueError on some package install #55

Closed riklaunim closed 9 years ago

riklaunim commented 9 years ago

During requirements installation at some point I get:

Traceback (most recent call last):
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/cli.py", line 55, in main
accelerator.install_from_arguments(arguments)
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/__init__.py", line 234, in install_from_arguments
return self.install_requirements(requirements, **kw)
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/__init__.py", line 520, in install_requirements
self.bdists.install_binary_dist(binary_distribution, **kw)
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/bdist.py", line 328, in install_binary_dist
for member, from_handle in members:
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/bdist.py", line 74, in get_binary_dist
if cache_file and requirement.last_modified > os.path.getmtime(cache_file):
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/cached_property.py", line 26, in __get__
value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/tmp/test-virtualenv3.3/lib/python3.3/site-packages/pip_accel/req.py", line 127, in last_modified
return max(mtimes) if mtimes else time.time()
ValueError: max() arg is an empty sequence

It works on 0.27 and other previous releases. Locally on Py 3.4 I couldn't reproduce it, so it also may be specific to Py 3.3.

xolox commented 9 years ago

Hi Piotr!

Thanks for the feedback and sorry for taking a while to respond.

I don't officially support Python 3.3 in any of my projects (I decided to focus on Python 2.6, Python 2.7 and Python >= 3.4 to keep compatibility manageable) however the issue you pointed out seems to be inherent in any Python 3.x version: The semantics of map() changed from returning a list to returning an iterator. The code in the last line of the traceback you quoted tests the iterator for its truth value which doesn't make any sense - this is a bug in pip-accel, I should have never written that code the way I did. I'm honestly not sure how I didn't notice that before. This is now fixed in pip-accel 0.29.3.

I'm closing this issue now because I'm confident this issue is now resolved, but if pip-accel 0.29.3 doesn't fix the issue for you feel free to reopen this issue or report a new one. Thanks again for the feedback!