List Info

Thread: public data in egg




public data in egg
user name
2006-02-14 18:56:54
When I generate an egg with "setup.py bdist_egg"
the public directory
is not included,

I have tried modifying setup.py to look like this :

package_data={'ddpp': ['i18n/*/LC_MESSAGES/*.mo',
                       'public/*']},

this works fine for files in public but not subdirectories.
I did try
a function that used os.walk to construct a list of
filenames to
include but it didn't work and wasn't pretty :-/

how are you handling the public data with pylonshq for
example ?
have I missed something ?

Tom
public data in egg
user name
2006-02-14 19:02:47
On Feb 14, 2006, at 10:56 AM, Thomas Sidwick wrote:

> this works fine for files in public but not
subdirectories. I did try
> a function that used os.walk to construct a list of
filenames to
> include but it didn't work and wasn't pretty :-/
>
> how are you handling the public data with pylonshq for
example ?
> have I missed something ?

Yes, its pretty subtle though. setuptools will include
pretty much  
any file in your project in the egg that's either a Python
module/ 
package, is included in a MANIFEST file, or is checked into
a version  
control system like subversion or CVS. In the case of
Pylonshq, its  
because the project is in a subversion repository, and all
the public  
files are also checked in, thus its all included.

We did have a finddata function that'd walk a directory and
include  
all the contents, which we can put back into Pylons for
times when  
you want to include a directory thats not going to be
version  
controlled.

HTH,
Ben
public data in egg
user name
2006-02-14 18:59:47
Thomas Sidwick wrote:
> When I generate an egg with "setup.py
bdist_egg" the public directory
> is not included,
> 
> I have tried modifying setup.py to look like this :
> 
> package_data={'ddpp': ['i18n/*/LC_MESSAGES/*.mo',
>                        'public/*']},
> 
> this works fine for files in public but not
subdirectories. I did try
> a function that used os.walk to construct a list of
filenames to
> include but it didn't work and wasn't pretty :-/
> 
> how are you handling the public data with pylonshq for
example ?
> have I missed something ?

There should be an argument
"include_package_data=True", which will get 
setuptools to include the appropriate data.  package_data
itself can be 
hard to work with.

-- 
Ian Bicking  /  ianbcolorstudy.com  /  http://blog.ianbicking.org

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )