
Hey, I'm wondering how I would go about including an entire directory in the .egg setup.py creates. We are using Dojo, and it automatically builds a directory containing the "stuff" it needs... But just including that directory in package_data doesn't work (as it expects to copy a file, not a directory). Including a glob such as 'js/**/ **' also fails, because directories are listed as part of the '**/ **', and it can't copy those. Any ideas? Thanks, David

At 03:44 PM 2/15/2008 -0500, David Wolever wrote:
Hey, I'm wondering how I would go about including an entire directory in the .egg setup.py creates. We are using Dojo, and it automatically builds a directory containing the "stuff" it needs... But just including that directory in package_data doesn't work (as it expects to copy a file, not a directory). Including a glob such as 'js/**/ **' also fails, because directories are listed as part of the '**/ **', and it can't copy those.
Use 'include_package_data=True', and put the files under revision control. If that doesn't work, you're not using revision control, or just don't want to put them in revision control, you'll have to list the directory in a MANIFEST.in file: see the distutils docs ("Distributing Python Modules") from python.org for the specific format.

If that doesn't work, you're not using revision control, or just don't want to put them in revision control, you'll have to list the directory in a MANIFEST.in file: see the distutils docs ("Distributing Python Modules") from python.org for the specific format. Alright, I'll check out this MANIFEST.in file -- it seems silly to
On 15-Feb-08, at 5:17 PM, Phillip J. Eby wrote: put auto-generated files under version control. Thanks for the help, David

On 15-Feb-08, at 5:17 PM, Phillip J. Eby wrote:
If that doesn't work, you're not using revision control, or just don't want to put them in revision control, you'll have to list the directory in a MANIFEST.in file: see the distutils docs ("Distributing Python Modules") from python.org for the specific format. Alright, I've put in my MANIFEST.in file: recursive-include path/to/dojo/*
But when I run ``python setup.py install`` the files don't appear in the egg that is installed to .../site-packages/ The SOURCES.txt file DOES have the correct list of files, though, and when I use ``setup.py sdist`` the correct files are included there too. Is there some subtle difference between an "install" and an "sdist" that I'm missing?

At 06:26 PM 2/15/2008 -0500, David Wolever wrote:
On 15-Feb-08, at 5:17 PM, Phillip J. Eby wrote:
If that doesn't work, you're not using revision control, or just don't want to put them in revision control, you'll have to list the directory in a MANIFEST.in file: see the distutils docs ("Distributing Python Modules") from python.org for the specific format. Alright, I've put in my MANIFEST.in file: recursive-include path/to/dojo/*
But when I run ``python setup.py install`` the files don't appear in the egg that is installed to .../site-packages/
The SOURCES.txt file DOES have the correct list of files, though, and when I use ``setup.py sdist`` the correct files are included there too.
Did you set 'include_package_data=True' in your setup? Without that, setuptools doesn't know you want those files to be installed, vs. just shipping with your source distribution.
Is there some subtle difference between an "install" and an "sdist" that I'm missing?
Yes: source distributions can include lots of stuff you don't intend to install, such as readme files, tests, documentation, samples, etc. Eggs only contain the bits marked as needing to be installed with the actual library.
participants (2)
-
David Wolever
-
Phillip J. Eby