[Distutils] copy binaries in egg

4 views
Skip to first unread message

Andrea Crotti

unread,
Mar 26, 2012, 11:21:22 AM3/26/12
to distut...@python.org
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 - Distut...@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Andrea Crotti

unread,
Mar 26, 2012, 11:39:02 AM3/26/12
to distut...@python.org
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?

PJ Eby

unread,
Mar 26, 2012, 3:22:40 PM3/26/12
to Andrea Crotti, distut...@python.org
On Mon, Mar 26, 2012 at 11:39 AM, Andrea Crotti <andrea....@gmail.com> 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.

Reply all
Reply to author
Forward
0 new messages