Why can't I include these data files in a Python distribution using distutils?
Posted
by froadie
on Stack Overflow
See other posts from Stack Overflow
or by froadie
Published on 2010-06-03T13:39:43Z
Indexed on
2010/06/03
14:54 UTC
Read the original article
Hit count: 308
I'm writing a setup.py file for a Python project so that I can distribute it. The aim is to eventually create a .egg file, but I'm trying to get it to work first with distutils and a regular .zip.
This is an eclipse pydev project and my file structure is something like this:
ProjectName
src
somePackage
module1.py
module2.py
...
config
propsFile1.ini
propsFile2.ini
propsFile3.ini
setup.py
Here's my setup.py code so far:
from distutils.core import setup
setup(name='ProjectName',
version='1.0',
packages=['somePackage'],
data_files = [('config', ['..\config\propsFile1.ini',
'..\config\propsFile2.ini',
'..\config\propsFile3.ini'])]
)
When I run this (with sdist as a command line parameter), a .zip file gets generated with all the python files - but the config files are not included. I thought that this code:
data_files = [('config', ['..\config\propsFile1.ini',
'..\config\propsFile2.ini',
'..\config\propsFile3.ini'])]
indicates that those 3 specified config files should be copied to a "config" directory in the zip distribution. Why is this code not accomplishing anything? What am I doing wrong?
(I have also tried playing around with the paths of the config files... But nothing seems to help. Would Python throw an error or warning if the path was incorrect / file was not found?)
© Stack Overflow or respective owner