Cannot install contrib plugins with pip

Bug #1428879 reported by Miguel Grinberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Miguel Grinberg

Bug Description

The plugins in the contrib directory fail to install when using pip. Example session:

# git clone https://github.com/openstack/heat.git
# cd heat/contrib/extraroute
# pip install .
Ignoring indexes: https://pypi.python.org/simple/
Unpacking /opt/heat/contrib/extraroute
  Running setup.py (path:/tmp/pip-fneqNw-build/setup.py) egg_info for package from file:///opt/heat/contrib/extraroute
    ERROR:root:Error parsing
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/pbr/core.py", line 104, in pbr
        attrs = util.cfg_to_args(path)
      File "/usr/local/lib/python2.7/dist-packages/pbr/util.py", line 238, in cfg_to_args
        pbr.hooks.setup_hook(config)
      File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/__init__.py", line 27, in setup_hook
        metadata_config.run()
      File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/base.py", line 29, in run
        self.hook()
      File "/usr/local/lib/python2.7/dist-packages/pbr/hooks/metadata.py", line 28, in hook
        self.config['name'], self.config.get('version', None))
      File "/usr/local/lib/python2.7/dist-packages/pbr/packaging.py", line 557, in get_version
        raise Exception("Versioning for this project requires either an sdist"
    Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
    error in setup command: Error parsing /tmp/pip-fneqNw-build/setup.cfg: Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

The problem is that these contrib packages do not have a version declared in setup.py. The pbr package usually is able to determine the package version from git tags when an explicit version is not given, but that mechanism does not work for sub-packages when they are installed with pip, because pip moves the files to a build directory (usually under /tmp) before starting the installation. Note in the console session above that the installation is from /tmp/pip-fneqNw-build/setup.py.

For top-level packages this move to /tmp does not cause problems for pbr because the .git directory is moved along with the rest of the files, so git can still be used to obtain the tag name.

Changed in heat:
assignee: nobody → Miguel Grinberg (miguelgrinberg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/162311

Changed in heat:
status: New → In Progress
Angus Salkeld (asalkeld)
Changed in heat:
importance: Undecided → Medium
milestone: none → kilo-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/162311
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=428e6b75a7c188a8e1f8a3d9a37b2a284e2baad3
Submitter: Jenkins
Branch: master

commit 428e6b75a7c188a8e1f8a3d9a37b2a284e2baad3
Author: Miguel Grinberg <email address hidden>
Date: Fri Mar 6 11:12:38 2015 -0800

    Add versions to all contrib plugins

    This change adds versions to the setup.cfg files of all the contrib
    plugins, so that pbr can determine the plugin version when the plugins
    are installed with pip. Because contrib plugins are not officially
    supported, a version of 0.1 is used.

    Change-Id: I7e55d7d018ecdbb878a22b236d75ecf87f7e3ed6
    Closes-Bug: #1428879

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-rc1 → 2015.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.