setup.py#package_data - howto include entire folder when installing
i've created MANIFEST.in and setup.py and when i call "python setup.py sdist" archive is created normally and archive contains all files. when i call "python setup.py install" data files are not installed and i have no idea why. i've been searching for a solution but every combination i've tried failed. i usually have only html templates so something like: package_data = {'mypkg': ['templates/*.html',]} works as expected but now i have a folder with different types of files and nested folder structure. my question is: - how can i define in setup.py to include folder (let's call it "data") and everything in data so that when "python setup.py install" is called that folder is copied with python code? something like "package_data={'mypkg': ['data/*']},"? Aljosa Mohorovic
On Wed, Feb 10, 2010 at 10:15 PM, Aljoša Mohorović <aljosa.mohorovic@gmail.com> wrote:
i've created MANIFEST.in and setup.py and when i call "python setup.py sdist" archive is created normally and archive contains all files. when i call "python setup.py install" data files are not installed and i have no idea why. i've been searching for a solution but every combination i've tried failed.
i usually have only html templates so something like: package_data = {'mypkg': ['templates/*.html',]} works as expected but now i have a folder with different types of files and nested folder structure.
my question is: - how can i define in setup.py to include folder (let's call it "data") and everything in data so that when "python setup.py install" is called that folder is copied with python code?
something like "package_data={'mypkg': ['data/*']},"?
How is your project organized precisely ? Depending on the layout you might need to use the "package_dir" option, Tarek
Aljosa Mohorovic _______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Tarek Ziadé | http://ziade.org
2010/2/11 Tarek Ziadé <ziade.tarek@gmail.com>:
How is your project organized precisely ? Depending on the layout you might need to use the "package_dir" option,
ROOT | - > mypkg/ | - > data/ | - > MANIFEST.in | - > setup.py $ cat MANIFEST.in recursive-include data *.css *.js *.jpg *.gif *.png *.html $ cat setup.py #!/usr/bin/env python from setuptools import setup, find_packages setup( name='test-pkg', packages = find_packages(), include_package_data = True, package_data = { '': ['data'], }, )
participants (2)
-
Aljoša Mohorović
-
Tarek Ziadé