[Distutils] setuptools --tag-revision poposed feature

Manlio Perillo manlio_perillo at libero.it
Sun May 2 15:35:30 CEST 2010


Hi.

Currently setuptools only support a ``tag-svn-revision`` option.
However I use Mercurial, and I would like to tag hg revisions.


Looking at setuptool sources, it should not hard to add a new
``tag-revision`` option, used, as an example:

  --tag-revision=hg

In egg_info command class, then, the tags method could do something like:

    def tags(self):
        version = ''
        if self.tag_build:
            version+=self.tag_build
        if self.tag_revision:
            for ep in iter_entry_points(
                'setuptools.tag_revision', self.tag_revision):
                version += '-r%s' % ep.load()()

                # Only use first entry point
                break
        elif os.path.exists('PKG-INFO'):
            version += '-r%s' % get_pkg_info_revision()
        if self.tag_date:
            import time; version += time.strftime("-%Y%m%d")
        return version


The current ``--tag-svn-revision`` will become an alias for
``--tag-revision=svn``, and support will be directly available in
setuptools.



I don't know if setuptools is still under development (this topic seems
quite confused, for me), but can I write a patch, hoping that it will be
accepted?
Where should I send the patch?



Thanks  Manlio


More information about the Distutils-SIG mailing list