Error getting version in ec2-api repo

Bug #1848364 reported by Alfredo Moralejo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ec2-api
Fix Released
Undecided
Unassigned

Bug Description

When running python setup.py --version on master branch (Commit 64a3772) I get following error:

]$ python setup.py --version
ERROR:root:Error parsing
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pbr/core.py", line 96, in pbr
    attrs = util.cfg_to_args(path, dist.script_args)
  File "/usr/lib/python2.7/site-packages/pbr/util.py", line 259, in cfg_to_args
    pbr.hooks.setup_hook(config)
  File "/usr/lib/python2.7/site-packages/pbr/hooks/__init__.py", line 25, in setup_hook
    metadata_config.run()
  File "/usr/lib/python2.7/site-packages/pbr/hooks/base.py", line 27, in run
    self.hook()
  File "/usr/lib/python2.7/site-packages/pbr/hooks/metadata.py", line 26, in hook
    self.config['name'], self.config.get('version', None))
  File "/usr/lib/python2.7/site-packages/pbr/packaging.py", line 818, in get_version
    version = _get_version_from_git(pre_version)
  File "/usr/lib/python2.7/site-packages/pbr/packaging.py", line 758, in _get_version_from_git
    result = _get_version_from_git_target(git_dir, target_version)
  File "/usr/lib/python2.7/site-packages/pbr/packaging.py", line 720, in _get_version_from_git_target
    dict(new=new_version, target=target_version))
ValueError: git history requires a target version of pbr.version.SemanticVersion(9.0.1), but target version is pbr.version.SemanticVersion(9.0.0)
error in setup command: Error parsing /tmp/ec2-api/setup.cfg: ValueError: git history requires a target version of pbr.version.SemanticVersion(9.0.1), but target version is pbr.version.SemanticVersion(9.0.0)

Root cause is conflict between pbr discovered version (9.0.1.dev6) and the one set in setup.cfg (9.0.0). It's also happening in stable/train.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ec2-api (master)

Reviewed: https://review.opendev.org/688991
Committed: https://git.openstack.org/cgit/openstack/ec2-api/commit/?id=6e56a244f713cbf8531c6ed79322cf63ab029ea9
Submitter: Zuul
Branch: master

commit 6e56a244f713cbf8531c6ed79322cf63ab029ea9
Author: Alfredo Moralejo <email address hidden>
Date: Wed Oct 16 19:41:43 2019 +0200

    Remove version attribute from setup.cfg

    This project uses pbr so it uses git tags and Sem-Ver pseudo header in
    commit messages. Having versin setup.cfg can lead to conflicts and
    errors when trying to get the package version using setup.py --version.

    Note that pbr provides the Sem-Ver "magic" works to bump releases
    without adding a tag [1].

    [1] https://docs.openstack.org/pbr/latest/user/features.html#version

    Change-Id: I83f5c66d80601bd241b2e7e5ed0682c96000c32f
    Closes-Bug: #1848364

Changed in ec2-api:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ec2-api (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/689176

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ec2-api (stable/train)

Reviewed: https://review.opendev.org/689176
Committed: https://git.openstack.org/cgit/openstack/ec2-api/commit/?id=fb16aa422b45e1c1c836f7429dad452ff69ee3cd
Submitter: Zuul
Branch: stable/train

commit fb16aa422b45e1c1c836f7429dad452ff69ee3cd
Author: Alfredo Moralejo <email address hidden>
Date: Wed Oct 16 19:41:43 2019 +0200

    Remove version attribute from setup.cfg

    This project uses pbr so it uses git tags and Sem-Ver pseudo header in
    commit messages. Having versin setup.cfg can lead to conflicts and
    errors when trying to get the package version using setup.py --version.

    Note that pbr provides the Sem-Ver "magic" works to bump releases
    without adding a tag [1].

    [1] https://docs.openstack.org/pbr/latest/user/features.html#version

    Change-Id: I83f5c66d80601bd241b2e7e5ed0682c96000c32f
    Closes-Bug: #1848364
    (cherry picked from commit 6e56a244f713cbf8531c6ed79322cf63ab029ea9)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ec2-api 9.0.1

This issue was fixed in the openstack/ec2-api 9.0.1 release.

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.