copy binaries in egg

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

copy binaries in egg

andrea crotti-2
I have custom code to create a nice installer from many Python eggs.

The problem is that in these eggs there are many binary files, as for
example png or sometimes even dlls (sigh), and they are not declared
anywhere in setup.py or Manifest.in.

The best solution would be of course to force everyone to include them
in setup.py, which would make them part of the package when running
egg_info.

This is probably not feasible because:
- they are too many and everywhere
- there is no easy way to detect from the developer if he's including
   everything, and the only way would be to see the errors on Hudson

So the only solution left is to:
1. build with bdist_egg
2. copy inside the build egg all the binaries found

any suggestions about how to do that or other ideas?

This procedure should normally be run always on the Hudson server, so I
can make sure for example that there are no artifacts and the directory
tree is always clean..
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: copy binaries in egg

andrea crotti-2
On 03/26/2012 04:21 PM, Andrea Crotti wrote:

> I have custom code to create a nice installer from many Python eggs.
>
> The problem is that in these eggs there are many binary files, as for
> example png or sometimes even dlls (sigh), and they are not declared
> anywhere in setup.py or Manifest.in.
>
> The best solution would be of course to force everyone to include them
> in setup.py, which would make them part of the package when running
> egg_info.
>
> This is probably not feasible because:
> - they are too many and everywhere
> - there is no easy way to detect from the developer if he's including
>   everything, and the only way would be to see the errors on Hudson
>
> So the only solution left is to:
> 1. build with bdist_egg
> 2. copy inside the build egg all the binaries found
>
> any suggestions about how to do that or other ideas?
>
> This procedure should normally be run always on the Hudson server, so I
> can make sure for example that there are no artifacts and the directory
> tree is always clean..

Suppose for example I need to include a simple png, apparently I have to
do this crazy dance

       include_package_data=True,
       packages=find_packages(),
       package_data={'data': ['xyz.png']},


and even if data/*png is in MANIFEST.in

Isn't there a way to let bdist_egg package also everything found through
the MANIFEST.in?
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: copy binaries in egg

PJ Eby
On Mon, Mar 26, 2012 at 11:39 AM, Andrea Crotti <[hidden email]> wrote:
Suppose for example I need to include a simple png, apparently I have to do this crazy dance

     include_package_data=True,
     packages=find_packages(),
     package_data={'data': ['xyz.png']},


and even if data/*png is in MANIFEST.in

Isn't there a way to let bdist_egg package also everything found through the MANIFEST.in?

That's what include_package_data does.  You don't need to have both 'include_package_data' and 'package_data={}', because the former is a replacement for the latter that autodetects based on either MANIFEST.in or source control.  As long as the file is inside a package and is listed either in the manifest or the source control system, it'll get included.


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

Re: copy binaries in egg

andrea crotti-2
On 03/26/2012 08:22 PM, PJ Eby wrote:
On Mon, Mar 26, 2012 at 11:39 AM, Andrea Crotti <[hidden email]> wrote:
Suppose for example I need to include a simple png, apparently I have to do this crazy dance

     include_package_data=True,
     packages=find_packages(),
     package_data={'data': ['xyz.png']},


and even if data/*png is in MANIFEST.in

Isn't there a way to let bdist_egg package also everything found through the MANIFEST.in?

That's what include_package_data does.  You don't need to have both 'include_package_data' and 'package_data={}', because the former is a replacement for the latter that autodetects based on either MANIFEST.in or source control.  As long as the file is inside a package and is listed either in the manifest or the source control system, it'll get included.


Great thanks for the answer, I missed that bit..

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