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

is_wheel fails when source_directory is None #63

Closed FedericoRessi closed 8 years ago

FedericoRessi commented 8 years ago

I am trying to accelerate devstack execution using pip_accell. After forcing devstack to use pip_accell I had below error as soon as devstack tries to install/update setuptools package.

The failing command line is this:

sudo -H pip-accel install -v -c upper-constraints.txt -U setuptools

I have attached the whole error log and upper-constraints.txt file.

Produced error is this:

2015-12-28 09:52:23 control pip_accel.cli[19019] ERROR Caught unhandled exception!
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip_accel/cli.py", line 57, in main
    accelerator.install_from_arguments(arguments)
  File "/usr/local/lib/python2.7/dist-packages/pip_accel/__init__.py", line 234, in install_from_arguments
    have_wheels = any(req.is_wheel for req in requirements)
  File "/usr/local/lib/python2.7/dist-packages/pip_accel/__init__.py", line 234, in <genexpr>
    have_wheels = any(req.is_wheel for req in requirements)
  File "/usr/local/lib/python2.7/dist-packages/cached_property.py", line 26, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python2.7/dist-packages/pip_accel/req.py", line 167, in is_wheel
    probably_sdist = os.path.isfile(os.path.join(self.source_directory, 'setup.py'))
  File "/usr/lib/python2.7/posixpath.py", line 77, in join
    elif path == '' or path.endswith('/'):
AttributeError: 'NoneType' object has no attribute 'endswith'
xolox commented 8 years ago

Hi Federico,

Thanks for the detailed bug report! I can reproduce the issue: Without the constraints file everything works as expected but when the constraints file is given on the command line pip's internal behavior changes in a way that I didn't anticipate. I'll investigate how I can fix this.

FedericoRessi commented 8 years ago

@xolox Indeed the problem is using requirements file and devstack uses it every-where to assure having the right set of dependencies installed. I looks like attribute source_dir of one InstallationRequirement instance is None. I don't know if this is a type of value that has to be expected or if this because of another problem happening before when parsing requirements test file. Thank you in advance. I you need help please let me know.

xolox commented 8 years ago

I just published pip-accel 0.37.1 which should resolve the issue you reported. Can you try it out and confirm whether the issue is resolved for you?

FedericoRessi commented 8 years ago

I am going to test it and let you know. Thanks

FedericoRessi commented 8 years ago

It works!

xolox commented 8 years ago

Thanks for the confirmation and good to hear that it works now!