]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix issue with pip installing oslo.config-1.2.0
authorMark McLoughlin <markmc@redhat.com>
Tue, 2 Jul 2013 11:25:58 +0000 (12:25 +0100)
committerMark McLoughlin <markmc@redhat.com>
Thu, 11 Jul 2013 19:17:04 +0000 (20:17 +0100)
Fixes bug #1194807

Firstly, we update the oslo.config dep to 1.2.0a3 because of the issue
with namespace packages (bug #1194742).

But the main issue here is that if you currently do:

  $> pip install -r quantum/requirements.txt

then you end up with the oslo.config 1.1.1 code installed. This is
because oslo.config>=1.1.0 gets pulled in as a transitive dep and pip
gets confused. You can reproduce with e.g.

  $> pip install \
       http://.../oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3 \
       python-keystoneclient
  $> pip freeze | grep oslo.config
  oslo.config-1.2.0a3
  $> python -c 'from oslo.config.cfg import DeprecatedOpt'
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
  ImportError: cannot import name DeprecatedOpt

This is because of a bug with pip where it sees oslo.config-1.2.0a3 and
oslo.config as two unrelated things. It should strip the version part of
the egg= fragment before using it as a package name, but it doesn't.

However, we can simply use the -f/--find-links pip option in our
requirements.txt to add the tarball URL to the list of URLs considered
and also add the oslo.config>=1.2.0a3 dependency:

  $> pip install \
       -f http://.../oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3 \
       'oslo.config>=1.2.0a3' \
       python-keystoneclient
  $> pip freeze | grep oslo.config
  oslo.config-1.2.0a3
  $> python -c 'from oslo.config.cfg import DeprecatedOpt'

This is actually exactly the semantics we want and we go to great
lengths in pbr to get these semantics while using a single tarball URL.
The only downside to this --find-links strategy is that we gain an extra
line in our requirements.txt ... but it does work around the pip bug.

Change-Id: I6f3eb5fd2c75615d9a1cae172aed859b36b27d4c

requirements.txt

index 0d91e31fa23ce2baf7d60e07d3f9400d9a80d365..417c2a5ac55549f8a890516d42bb95ddf3b94ef6 100644 (file)
@@ -18,10 +18,12 @@ sqlalchemy>=0.7.8,<=0.7.99
 WebOb>=1.2
 python-keystoneclient>=0.2.0
 alembic>=0.4.1
-http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a2.tar.gz#egg=oslo.config-1.2.0a2
 six
 stevedore>=0.9
 
+-f http://tarballs.openstack.org/oslo.config/oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3
+oslo.config>=1.2.0a3
+
 # Cisco plugin dependencies
 python-novaclient
 # End Cisco dependencies