Hi all, it seems that distutils doesn't recognize '.zip' files as being part of packages, so if I have the following structure, twill/__init__.py twill/pyparsing.zip twill/mechanize.zip twill/shell.py twill/commands.py then packages = ['twill',] doesn't install the .zip files. Quixote has a simple solution that uses the cmdclass option to respecify things for (in their case) *.ptl files, and it works fine for .zip files. I'm pretty sure .zip files should be considered as valid as .py files, by default. Any thoughts? cheers, --titus
At 03:34 PM 5/21/2005 -0700, Titus Brown wrote:
Hi all,
it seems that distutils doesn't recognize '.zip' files as being part of packages, so if I have the following structure,
twill/__init__.py twill/pyparsing.zip twill/mechanize.zip twill/shell.py twill/commands.py
then packages = ['twill',] doesn't install the .zip files.
With Python >=2.4, or with the setuptools package, you can add something like this to your setup options: setup( ... package_data = {'': ['*.zip']} ) And .zip files will be then installed. See: http://docs.python.org/dist/node11.html for documentation on the package_data option. (By the way, the behavior you describe is not a "bug"; it's distutils' current documented behavior.)
-> >it seems that distutils doesn't recognize '.zip' files as being part of -> >packages, so if I have the following structure, -> > -> > twill/__init__.py -> > twill/pyparsing.zip -> > twill/mechanize.zip -> > twill/shell.py -> > twill/commands.py -> > -> >then packages = ['twill',] doesn't install the .zip files. -> -> With Python >=2.4, or with the setuptools package, you can add something -> like this to your setup options: -> -> setup( -> ... -> package_data = {'': ['*.zip']} -> ) -> -> And .zip files will be then installed. See: -> -> http://docs.python.org/dist/node11.html -> -> for documentation on the package_data option. Ahh, fantastic, thanks. I read up to section 2.4 but wasn't sure what to look for, so gave up & just read Quixote's code. -> (By the way, the behavior you describe is not a "bug"; it's distutils' -> current documented behavior.) It's hard to know how to respond to that... "MS Windows may occasionally crash." ;) --titus
participants (2)
-
Phillip J. Eby
-
Titus Brown