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

Exception during installation from an empty file #47

Closed mastak closed 9 years ago

mastak commented 9 years ago

Pip just return a simple message. But when i try install requirements from empty file, pip-accel generate exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/pip_accel/cli.py", line 53, in main
    accelerator.install_from_arguments(arguments)
  File "/usr/local/lib/python3.4/site-packages/pip_accel/__init__.py", line 179, in install_from_arguments
    requirements = self.get_requirements(arguments)
  File "/usr/local/lib/python3.4/site-packages/pip_accel/__init__.py", line 197, in get_requirements
    return self.unpack_source_dists(arguments)
  File "/usr/local/lib/python3.4/site-packages/pip_accel/__init__.py", line 244, in unpack_source_dists
    requirements = self.get_pip_requirement_set(arguments, use_remote_index=False)
  File "/usr/local/lib/python3.4/site-packages/pip_accel/__init__.py", line 316, in get_pip_requirement_set
    return self.transform_pip_requirement_set(pip.requirement_set)
  File "/usr/local/lib/python3.4/site-packages/pip_accel/__init__.py", line 335, in transform_pip_requirement_set
    for requirement in requirement_set.requirements.values():
AttributeError: 'NoneType' object has no attribute 'requirements'
xolox commented 9 years ago

Hi Igor,

Thanks for pointing this out, that is indeed not very user friendly. I just published pip-accel 0.22.3 which should resolve the issue you encountered. Can you try it out and let me know whether this is better? Thanks!

mastak commented 9 years ago

Hi Peter,

Traceback disappeared, but the problem is still there.

The thing in that I am using pip-accel inside Dockerfile (instructions for docker). And pip-accel with empty file return a non-zero code:

"error":"The command [/bin/sh -c pip-accel install -r /opt/checkio_mission/python_27/requirements.txt] returned a non-zero code: 1

And all build breaks down. But pip works fine in that case.

xolox commented 9 years ago

Hi Igor,

Thanks for the follow up, I didn't realize your concern was the exit code instead of just the printing of the traceback (you didn't mention the exit code before). I agree that pip-accel should be compatible with pip in this case. I'll try to fix this today.

mastak commented 9 years ago

Yes, it was my mistake, sorry.

PS Thanks for quick reply.

xolox commented 9 years ago

Hi Igor,

The problem you reported should now be resolved: The traceback is gone and the exit code is the same as pip (0). Sorry it took so long, especially after I said I'd try to fix this the same day - life got in the way of my open source projects (it does that sometimes :-). If you can confirm whether you agree the problem is resolved that would be appreciated; you can close this issue if so. Thanks for pointing out this incompatibility with pip!

xolox commented 9 years ago

I'm going to close this issue now because the problem reported here has been fixed for a while now. Thanks for the feedback!