
Hi, I just finished my first egg, but have a question: How can I distribute example scripts for my package ??? Greetings, Uwe -- Dr. rer. nat. Uwe Schmitt F&E Mathematik mineway GmbH Science Park 2 D-66123 Saarbrücken Telefon: +49 (0)681 8390 5334 Telefax: +49 (0)681 830 4376 uschmitt@mineway.de www.mineway.de Geschäftsführung: Dr.-Ing. Mathias Bauer Amtsgericht Saarbrücken HRB 12339

Hi Uwe, Do you mean console scripts or just example files? If you set the 'include_package_data' argument to True, all of the data files that are under version control will be included in your egg. If you want to have more control over what goes in your egg and where they get put, you can use the 'data_files' argument, which is a list of tuples. The first item in the tuple is the relative path inside the egg where you want your data to be placed. The second item is a string, or a list of strings, which are paths relative to the root of your source tree for the files that you want to be placed in the destination you specified in the first item of the tuple. Here is a simple example: If your source tree looks like this: setup.py README.txt examples/ example1.py data1.dat mypkg/ __init__.py mypkg.py And your 'data_files' argument was this: data_files = [('', 'README.txt'), ('mypkg/examples', 'examples/*.*')] Your egg structure should look like this: mypkg-1.0.0-py2.5.egg/ mypkg/ examples/ example1.py data1.dat __init__.py mypkg.py README.txt You can also use a glob for the second item in the tuple. -- Chris Galvan Uwe Schmitt wrote:
Hi,
I just finished my first egg, but have a question: How can I distribute example scripts for my package ???
Greetings, Uwe

Oops, somehow the formatting I did on the egg structure got messed up. Here is what it's REALLY supposed to look like :) mypkg-1.0.0-py2.5.egg/ mypkg/ examples/ example1.py data1.dat __init__.py mypkg.py README.txt -- Chris Galvan Chris Galvan wrote:
Hi Uwe,
Do you mean console scripts or just example files? If you set the 'include_package_data' argument to True, all of the data files that are under version control will be included in your egg. If you want to have more control over what goes in your egg and where they get put, you can use the 'data_files' argument, which is a list of tuples. The first item in the tuple is the relative path inside the egg where you want your data to be placed. The second item is a string, or a list of strings, which are paths relative to the root of your source tree for the files that you want to be placed in the destination you specified in the first item of the tuple. Here is a simple example:
If your source tree looks like this:
setup.py README.txt examples/ example1.py data1.dat mypkg/ __init__.py mypkg.py
And your 'data_files' argument was this:
data_files = [('', 'README.txt'), ('mypkg/examples', 'examples/*.*')]
Your egg structure should look like this:
mypkg-1.0.0-py2.5.egg/ mypkg/ examples/ example1.py data1.dat __init__.py mypkg.py README.txt
You can also use a glob for the second item in the tuple.
-- Chris Galvan
Uwe Schmitt wrote:
Hi,
I just finished my first egg, but have a question: How can I distribute example scripts for my package ???
Greetings, Uwe
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig

At 03:37 PM 8/12/2008 +0200, Uwe Schmitt wrote:
Hi,
I just finished my first egg, but have a question: How can I distribute example scripts for my package ???
In your source distribution, with your documentation. Eggs are a deployment format for code and data, not a distribution format for source, docs, and examples.
participants (3)
-
Chris Galvan
-
Phillip J. Eby
-
Uwe Schmitt