-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Tarek Ziadé skrev: > On Fri, Mar 26, 2010 at 9:31 AM, Martin Raspaud <martin.rasp...@smhi.se> > wrote: > Hi, > > I am writing a recipe for buildout, and as such I would like to get the full > name of a develop egg programatically as it would appear if I installed it. > For example if the setup.py defines the name to "myproject", I would like to > get > myproject-0.3.0-py2.5-linux-x86_64.egg > > How to I get this ? > > I look a little bit in the setuptools source code, but it's not easy to find. > >> It's provided by the egg_name() function in the Distribution class >> (the one in pkg_resources, not the one in setuptools.dist) > >>>>> from pkg_resources import Distribution, get_build_platform >>>>> from distutils.sysconfig import get_python_version >>>>> dist = Distribution(None, None, 'myproject', '0.3.0', >>>>> get_python_version(), get_build_platform()) >>>>> dist.egg_name() + '.egg' >> 'myproject-0.3.0-py2.6-macosx-10.3-fat.egg'
Nice, thanks ! and how do I get 'myproject' and '0.3.0' from a setup.py file ? (I'm working with develop eggs) Regards, Martin -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJLrKouAAoJEBdvyODiyJI4nfMIAKKuq8AGSJ6j9lzbijD9jOMC GZXPdtktgNW+/HATQDARZayv8dClu3P33CvOfMrlhW1SpfqvuxMp8G7CWdJhHqG0 purmxH21jldLi2i2EMDN09cC6ehIC71+kaqKUi9wBjjlMIhM0vxsrdcGDNLJpciP chrVJnyhP42q+KHLffFwmnzdpII4Pkj0vBzOBG2KLaxLHI1ctjLDHcXZkpRyuBkR +DwtZm3kVaM6IZv9v6d+T4vN3opeg4JbUgwmaQSdlKEhztmlXFH4Qf8TK6YyUdtI 8Y3r1l/IcJwG2az5pFcpvCATEqPsLQQ8Fg4/vfa5EnqMQAaq+xjejOuHIq5LWHE= =kgUf -----END PGP SIGNATURE-----
<<attachment: martin_raspaud.vcf>>
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig