pycontribs / pyrax

The Python SDK for the Rackspace Cloud
developer.rackspace.com
Apache License 2.0
237 stars 208 forks source link

pbr 1.0 breaks pyrax #561

Closed therealmarv closed 9 years ago

therealmarv commented 9 years ago

Yesterday (March 18) pbr 1.0 was released. When doing a normal pip install pyrax with latest pip 6.1.1 it installs 1.0 which is conflicting with pyrax underlying libraries like 'oslo.i18n', 'python-keystoneclient', 'oslo.serialization', 'oslo.utils'.

Full error log we got on our system with a new virtualenv today:

Traceback (most recent call last):
  File "app_context_rqworker.py", line 25, in <module>
    app = create_app(run_as_server=False)
  File "/home/pybossa/pybossa/pybossa/core.py", line 39, in create_app
    setup_uploader(app)
  File "/home/pybossa/pybossa/pybossa/core.py", line 109, in setup_uploader
    uploader.init_app(app)
  File "/home/pybossa/pybossa/pybossa/uploader/rackspace.py", line 49, in init_app
    region=app.config['RACKSPACE_REGION'])
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pyrax/__init__.py", line 438, in _wrapped
    return fnc(*args, **kwargs)
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pyrax/__init__.py", line 504, in set_credentials
    connect_to_services(region=region)
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pyrax/__init__.py", line 626, in connect_to_services
    cloudservers = connect_to_cloudservers(region=region)
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pyrax/__init__.py", line 662, in connect_to_cloudservers
    _cs_auth_plugin.discover_auth_systems()
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/novaclient/auth_plugin.py", line 40, in discover_auth_systems
    auth_plugin = ep.load()
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2344, in load
    self.require(*args, **kwargs)
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2361, in require
    items = working_set.resolve(reqs, env, installer)
  File "/home/pybossa/pybossa/env/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 838, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (pbr 1.0.0 (/home/pybossa/pybossa/env/lib/python2.7/site-packages), Requirement.parse('pbr!=0.7,<1.0,>=0.6'), set(['oslo.i18n', 'python-keystoneclient', 'oslo.serialization', 'oslo.utils']))

We had to pin pbr to a version like 0.11 which is below <1.0 to keep pyrax running.

sivel commented 9 years ago

This is not pyrax itself, but several of its dependencies. The following outlines the version requirements and the packages that specify the version:

ContextualVersionConflict: (pbr 1.0.0 (/home/pybossa/pybossa/env/lib/python2.7/site-packages), Requirement.parse('pbr!=0.7,<1.0,>=0.6'), set(['oslo.i18n', 'python-keystoneclient', 'oslo.serialization', 'oslo.utils']))
therealmarv commented 9 years ago

no but it is a serious problem for pyrax. I already tried to make a PR for a two line change in openstack/python-novaclient but they want me to sign a contributor agreement and get used to gerrit which is a littlebit much for a two lines change IMHO. Either you pin a version range in your library or somebody else may contribute that changes to python-novaclient or the oslo libraries. It's a shame that a simple 1.0 change can break so much stuff.

petersanchez commented 9 years ago

We have the same issue. Only now it's pbr 1.0.1. Things were fine for weeks. Deployed tonight, have this issue popping up.

Does pinning pbr to 0.11 actually provide a usable work-around here?

therealmarv commented 9 years ago

@petersanchez yes pinning the pbr version to the last version 0.11.0 before 1.0 is exactly what we have done at PyBossa to keep pyrax working. Look here in our setup.py https://github.com/PyBossa/pybossa/commit/73179e71cd1ba62fa902ed5272cc2b961403f907

sivel commented 9 years ago

I've submitted a bug report upstream to python-novaclient at https://bugs.launchpad.net/python-novaclient/+bug/1457100

EdLeafe commented 9 years ago

FWIW, there were several upstream issues with pbr 1.0, too: http://lists.openstack.org/pipermail/openstack-dev/2015-May/064362.html

dandye commented 9 years ago

I was confounded by the OpenStack git repo until I found the GitHub mirror. Sharing my code snip for checkout and install of the 0.11.0 version:

$ git clone git@github.com:openstack-dev/pbr.git
$ cd pbr
$ git checkout tags/0.11.0
$ python2.7 setup.py install
humantorch commented 9 years ago

Thanks @dandye, the code snippet you shared sorted the problem for me perfectly!

sivel commented 9 years ago

An easy solution via pip is to just pip install -I pbr==0.11.0 Additionally, based on testing, something like the following works too: pip install -U oslo.utils as oslo.utils will cause pbr 0.11.0 to be installed.

I'm still following up with the python-novaclient project to see about getting this fixed. The error is actually triggered when you have a novaclient extension installed, causing pbr to trigger a dependency check.

sivel commented 9 years ago

A commit[1] has just been merged into python-novaclient that addresses the issue. A release has not been cut yet. I will follow up once a new release of python-novaclient has been released with this fix.

[1] https://bugs.launchpad.net/python-novaclient/+bug/1457100/comments/9

sivel commented 9 years ago

As of about 30 minutes ago, python-novaclient 2.26.0 was released that includes the fix for this issue. As such I am closing this issue.