> -----Original Message----- > From: P.J. Eby [mailto:[email protected]] > ... > There isn't any easy way to work around this at the moment (although I will > implement a formal fix in later releases of setuptools). In the meantime, > you can monkeypatch thus, in the same plugin where you implement the > above function: > > from setuptools.command.egg_info import egg_info > old_tagged_version = egg_info.tagged_version > > def tagged_version(self): > if self.distribution.use_hg_version: > return safe_version(self.distribution.get_version()) > else: > return old_tagged_version(self) > > egg_info.tagged_version = tagged_version > > Whew. This was a tough one to figure out, and it's a little hacky. Probably in > 0.7 I'll just factor this into a separate entry point group for version > calculations, so that it's not as much trouble to do something like this. >
PJE: Thanks again. That's a huge help. I don't think I would have ever figured out all of those hooks by myself. One problem I found was that even with that code, the tag_build wasn't getting set in setup.cfg, so I added another line to set the egg_info.tag_build in the monkey-patched egg_info.tagged_version. After that, it seems to work exactly as prescribed. It's in hgtools 0.4, so feel free to give it a go. As you prescribed, set use_hg_version=True and setup_requires hgtools>=0.4 and you'll get versions automatically calculated based on your tags. Regards, Jason
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
