get name of built egg

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

get name of built egg

andrea crotti-2
Given the setuptools magic done by
python setup.py bdist_egg

is there a way to find out what will be the name of the final egg file?
It would be really useful to know for me and I can't find any option
to tell bdist_egg to let me know where it will write..
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: get name of built egg

PJ Eby-2

On Mar 16, 2012 10:42 AM, "Andrea Crotti" <[hidden email]> wrote:
>
> Given the setuptools magic done by
> python setup.py bdist_egg
>
> is there a way to find out what will be the name of the final egg file?
> It would be really useful to know for me and I can't find any option
> to tell bdist_egg to let me know where it will write..

If you just want the file accessible by a script or some larger build process that's invoking the setup script, the easiest way to do it is to specify an empty output directory for the distribution to be built in, instead of 'dist/'.  Then, there will only be one file in that directory after running bdist_egg: the egg file.

(If you meant some other scenario, then you'll need to explain in more detail what you want.)


_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: get name of built egg

andrea crotti-2
On 03/16/2012 05:37 PM, PJ Eby wrote:

On Mar 16, 2012 10:42 AM, "Andrea Crotti" <[hidden email]> wrote:
>
> Given the setuptools magic done by
> python setup.py bdist_egg
>
> is there a way to find out what will be the name of the final egg file?
> It would be really useful to know for me and I can't find any option
> to tell bdist_egg to let me know where it will write..

If you just want the file accessible by a script or some larger build process that's invoking the setup script, the easiest way to do it is to specify an empty output directory for the distribution to be built in, instead of 'dist/'.  Then, there will only be one file in that directory after running bdist_egg: the egg file.

(If you meant some other scenario, then you'll need to explain in more detail what you want.)


That would be the scenario yes, but it's quite a lame solution imho :/
I mean setuptools generates the name of this file somehow while building the egg file,
is that impossible to retrieve it before or after actually creating it?

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: get name of built egg

PJ Eby-2
Well, you can use "setup.py --name --version" to get the name and version.  You can run "setup.py egg_info" pointed to some target directory to inspect the PKG-INFO.  There are quite a few ways to get the information.  I don't yet understand what criteria you have that make one of these ways any better than another.  If you need the name of the file it's generating so you can access that file, then I'm not sure why you care *in advance* of it actually generating the file.  ;-)

On Sat, Mar 17, 2012 at 6:57 PM, Andrea Crotti <[hidden email]> wrote:
On 03/16/2012 05:37 PM, PJ Eby wrote:

On Mar 16, 2012 10:42 AM, "Andrea Crotti" <[hidden email]> wrote:
>
> Given the setuptools magic done by
> python setup.py bdist_egg
>
> is there a way to find out what will be the name of the final egg file?
> It would be really useful to know for me and I can't find any option
> to tell bdist_egg to let me know where it will write..

If you just want the file accessible by a script or some larger build process that's invoking the setup script, the easiest way to do it is to specify an empty output directory for the distribution to be built in, instead of 'dist/'.  Then, there will only be one file in that directory after running bdist_egg: the egg file.

(If you meant some other scenario, then you'll need to explain in more detail what you want.)


That would be the scenario yes, but it's quite a lame solution imho :/
I mean setuptools generates the name of this file somehow while building the egg file,
is that impossible to retrieve it before or after actually creating it?


_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig