including an empty directory

I'm having issues to include an empty directory to setuptools package. package_data={'data':['templates/*tmpl']} this includes all the files, but there is data/templates/Test directory that is empty and there is no way of globing it.

according to http://svn.python.org/projects/sandbox/trunk/distutils_refactor/distutils/co... and http://docs.python.org/distutils/setupscript.html#installing-additional-file..., you should use the following parameter: data_files=[('data', [])], That *should* make data directory in install dir, but it does not. Suggestions?

I don't know on setuptools side, but in distutils, I don't think there's any way to include an empty directory like this, even with a graft in the MANIFEST.in file. The commands are looking for files to include, then create the necessary directories in the distribution, to include those files Can't you add a README.txt file in that directory ? What is the use case to include an empty directory in a release ? Regards Tarek On Sat, Jan 24, 2009 at 2:40 AM, Domen Kožar <iElectric@gmail.com> wrote:
I'm having issues to include an empty directory to setuptools package.
package_data={'data':['templates/*tmpl']}
this includes all the files, but there is data/templates/Test directory that is empty and there is no way of globing it. _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/

Usage is to dispatch Paste templates http://pythonpaste.org/script/developer.html#templates. And the dir must be empty, for some reasons. So this distutils syntax does not work (interesting though, as it does create the dir in the egg, it's just not copied) On Jan 25, 12:18 am, Tarek Ziadé <ziade.ta...@gmail.com> wrote:
I don't know on setuptools side, but in distutils, I don't think there's any way to include an empty directory like this, even with a graft in the MANIFEST.in file.
The commands are looking for files to include, then create the necessary directories in the distribution, to include those files
Can't you add a README.txt file in that directory ?
What is the use case to include an empty directory in a release ?
Regards Tarek
On Sat, Jan 24, 2009 at 2:40 AM, Domen Kožar <iElect...@gmail.com> wrote:
I'm having issues to include an empty directory to setuptools package.
package_data={'data':['templates/*tmpl']}
this includes all the files, but there is data/templates/Test directory that is empty and there is no way of globing it. _______________________________________________ Distutils-SIG maillist - Distutils-...@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy |www.afpy.org Blog FR |http://programmation-python.org Blog EN |http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - Distutils-...@python.orghttp://mail.python.org/mailman/listinfo/distutils-sig

FYI, this is a know bug/limitation I never bother to look much into it as we simply add a placeholder file. On Sat, Jan 24, 2009 at 7:39 PM, Domen Kožar <iElectric@gmail.com> wrote:
Usage is to dispatch Paste templates http://pythonpaste.org/script/developer.html#templates.
And the dir must be empty, for some reasons.
So this distutils syntax does not work (interesting though, as it does create the dir in the egg, it's just not copied)
On Jan 25, 12:18 am, Tarek Ziadé <ziade.ta...@gmail.com> wrote:
I don't know on setuptools side, but in distutils, I don't think there's any way to include an empty directory like this, even with a graft in the MANIFEST.in file.
The commands are looking for files to include, then create the necessary directories in the distribution, to include those files
Can't you add a README.txt file in that directory ?
What is the use case to include an empty directory in a release ?
Regards Tarek
On Sat, Jan 24, 2009 at 2:40 AM, Domen Kožar <iElect...@gmail.com> wrote:
I'm having issues to include an empty directory to setuptools package.
package_data={'data':['templates/*tmpl']}
this includes all the files, but there is data/templates/Test directory that is empty and there is no way of globing it. _______________________________________________ Distutils-SIG maillist - Distutils-...@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | Association AfPy |www.afpy.org Blog FR |http://programmation-python.org Blog EN |http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - Distutils-...@python.orghttp://mail.python.org/mailman/listinfo/distutils-sig
Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig

On Sun, Jan 25, 2009 at 10:07 AM, Jorge Vargas <jorge.vargas@gmail.com> wrote:
FYI, this is a know bug/limitation I never bother to look much into it as we simply add a placeholder file.
Well if that's a recurrent need maybe we can add this feature. What about a new option called "include_empty_folders" (False by default) Tarek -- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/

2009/1/25 Tarek Ziadé <ziade.tarek@gmail.com>:
On Sun, Jan 25, 2009 at 10:07 AM, Jorge Vargas <jorge.vargas@gmail.com> wrote:
FYI, this is a know bug/limitation I never bother to look much into it as we simply add a placeholder file.
Well if that's a recurrent need maybe we can add this feature.
What about a new option called "include_empty_folders" (False by default)
rather : include_empty_directory
Tarek
-- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé - Directeur Technique INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 Bureaux de la Colline - 1 rue Royale - Bâtiment D - 9ème étage 92210 Saint Cloud - France Phone : 01.78.15.24.00 / Fax : 01 46 02 44 04 http://www.ingeniweb.com - une société du groupe Alter Way

that's one of the options yes, or package_include parameter to setuptools that would take a list of paths that should be included recursivly. On Jan 25, 11:52 am, Tarek Ziade <tarek.zi...@ingeniweb.com> wrote:
2009/1/25 Tarek Ziadé <ziade.ta...@gmail.com>:
On Sun, Jan 25, 2009 at 10:07 AM, Jorge Vargas <jorge.var...@gmail.com> wrote:
FYI, this is a know bug/limitation I never bother to look much into it as we simply add a placeholder file.
Well if that's a recurrent need maybe we can add this feature.
What about a new option called "include_empty_folders" (False by default)
rather : include_empty_directory
Tarek
-- Tarek Ziadé | Association AfPy |www.afpy.org Blog FR |http://programmation-python.org Blog EN |http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - Distutils-...@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé - Directeur Technique INGENIWEB (TM) - SAS 50000 Euros - RC B 438 725 632 Bureaux de la Colline - 1 rue Royale - Bâtiment D - 9ème étage 92210 Saint Cloud - France Phone : 01.78.15.24.00 / Fax : 01 46 02 44 04http://www.ingeniweb.com- une société du groupe Alter Way _______________________________________________ Distutils-SIG maillist - Distutils-...@python.orghttp://mail.python.org/mailman/listinfo/distutils-sig

On Sun, Jan 25, 2009 at 1:06 PM, Domen Kožar <iElectric@gmail.com> wrote:
that's one of the options yes, or package_include parameter to setuptools that would take a list of paths that should be included recursivly.
Beware that I am talking about Distutils code here rather than Setuptools' one, while this won't probably change anything (the feature would then be usable from Setuptools transparently), it's important to make the distinction because this feature will only be available in python 2.7 Also, maybe there's something manageable at Setuptools level already for this, Phillip ? Tarek -- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/

On Jan 25, 2009, at 3:05 AM, Tarek Ziadé wrote:
Well if that's a recurrent need maybe we can add this feature.
What about a new option called "include_empty_folders" (False by default)
In a related story, I recently found a problem with the packaging of nevow. We had earlier added "twisted.plugins" to "packages", not because nevow includes a package named "twisted.plugins", but because that's the only way we could figure out how to make sure that distutils and/or setuptools would create the empty "twisted/plugins" directory on installation which nevow requires: http://divmod.org/trac/changeset/16896 However, this leads to this warning message at import time: "/usr/lib/python2.5/site-packages/zope/__init__.py:19: UserWarning: Module twisted was already imported from /usr/lib/python2.5/site- packages/twisted/__init__.pyc, but /home/buildslave/slave-gutsy-tahoe/ gutsy/build/support/lib/python2.5/site-packages/Nevow-0.9.32- py2.5.egg is being added to sys.path" http://bugs.python.org/setuptools/issue36 So I've just submitted a patch to nevow to use data_files instead of packages to indicate that this directory should be created, and to do that we have to include a file in the directory so that distutils doesn't prune it out for being an empty directory: http://divmod.org/trac/ticket/2830 One thing that I don't understand about all this is why setuptools's "include_package_data=True" didn't cause the directory to be installed. I'm not sure if calling that "twisted/plugins" directory a "data file" or an "included package data" makes more sense, but the former currently works. Regards, Zooko --- Tahoe, the Least-Authority Filesystem -- http://allmydata.org store your data: $10/month -- http://allmydata.com/?tracking=zsig

nice post zooko, thanks. On Jan 25, 4:54 pm, zooko <zo...@zooko.com> wrote:
On Jan 25, 2009, at 3:05 AM, Tarek Ziadé wrote:
Well if that's a recurrent need maybe we can add this feature.
What about a new option called "include_empty_folders" (False by default)
In a related story, I recently found a problem with the packaging of nevow. We had earlier added "twisted.plugins" to "packages", not because nevow includes a package named "twisted.plugins", but because that's the only way we could figure out how to make sure that distutils and/or setuptools would create the empty "twisted/plugins" directory on installation which nevow requires:
http://divmod.org/trac/changeset/16896
However, this leads to this warning message at import time:
"/usr/lib/python2.5/site-packages/zope/__init__.py:19: UserWarning: Module twisted was already imported from /usr/lib/python2.5/site- packages/twisted/__init__.pyc, but /home/buildslave/slave-gutsy-tahoe/ gutsy/build/support/lib/python2.5/site-packages/Nevow-0.9.32- py2.5.egg is being added to sys.path"
http://bugs.python.org/setuptools/issue36
So I've just submitted a patch to nevow to use data_files instead of packages to indicate that this directory should be created, and to do that we have to include a file in the directory so that distutils doesn't prune it out for being an empty directory:
http://divmod.org/trac/ticket/2830
One thing that I don't understand about all this is why setuptools's "include_package_data=True" didn't cause the directory to be installed. I'm not sure if calling that "twisted/plugins" directory a "data file" or an "included package data" makes more sense, but the former currently works.
Regards,
Zooko --- Tahoe, the Least-Authority Filesystem --http://allmydata.org store your data: $10/month --http://allmydata.com/?tracking=zsig _______________________________________________ Distutils-SIG maillist - Distutils-...@python.orghttp://mail.python.org/mailman/listinfo/distutils-sig
participants (5)
-
Domen Kožar
-
Jorge Vargas
-
Tarek Ziade
-
Tarek Ziadé
-
zooko