[openstack-dev] [oslo] Oslo library versioning

Mark McLoughlin markmc at redhat.com
Mon Dec 3 11:23:13 UTC 2012


On Fri, 2012-11-30 at 13:55 -0800, Monty Taylor wrote:
> Hey Matt!
> 
> On 11/30/2012 01:24 PM, Matt Joyce wrote:

> > 2.  Second Concern - .git derives our versioning
> > 
> > First, thank god for the versioninfo file.  Without it, cinderclient
> > would be unbuildable in certain situations.
> 
> Totally. It's pretty important.
> 
> > It boils down to this logic:
> > 
> > from cinderclient/openstack/common/setup.py  ( which btw is common
> > SOLELY to cinderclient every other client does this logic in a different
> > yet standard fashion ).
> 
> I did not realize cinderclient had diveged. We should fix that. (patch
> coming)
> 
> > def get_post_version(projectname):
> >     """Return a version which is equal to the tag that's on the current
> >     revision if there is one, or tag plus number of additional revisions
> >     if the current revision has no tag."""
> > 
> >     if os.path.isdir('.git'):
> >         version = _get_git_post_version()
> >         write_versioninfo(projectname, version)
> >         return version
> >     return open(os.path.join(projectname, 'versioninfo'),
> > 'r').read().strip()
> > 
> > This basically says either grab the version from .git, or the
> > versioninfo file.  Except that generating the versioninfo file requires
> > .git.
> 
> 
> Well, there is a bug in the logic there. Currently it tries to keep the
> versioninfo file up to date at all costs, so if it finds that it has a
> git repo, it will recreate the versioninfo file.
> 
> Except that makes evil for git-buildpackage. Sorry, I just didn't catch it.
> 
> The fix for that is to always trust the versioninfo file if it exists.
> Since it gets created on tarball creation as part of our release
> process, it should never not be there - and to only fall back to git if
> the versioninfo file does not exist.
> 
> I can come up with no valid situation where a person will have a copy of
> the code with neither an upstream git repo OR a tarball generated
> versioninfo file. (although please check me if I'm wrong there)

I saw the review[1] before this thread.

AFAICT the logic you're proposing is:

  if versioninfo exists:
      version = read_versioninfo()
  else:
      version = do_some_git_magic()
      write_versioninfo(version)
  return version

So, if you clone a project, do something with setup.py, versioninfo gets
created at that time and never gets re-created again?

Cheers,
Mark.

[1] - https://review.openstack.org/17249




More information about the OpenStack-dev mailing list