[Tutor] concerning distutils: how to include additional files?

Christian Meesters cmeesters at ucdavis.edu
Tue Sep 7 05:40:44 CEST 2004


Hi

I'd like to place a question concerning the distutils module. Or 
better: How is it possible to include files into a package which aren't 
Python modules (e.g. a README file)? If I understand the documentation 
correctly the following should work:

#in a setup.py

from distutils.core import setup
setup(name="packagename", version="0.1a", author="me",
       author_email="my at e.mail", url="do_not_want_to_post_now",
       description="blah_blah",
       packages= ["packagedirectory","packagedirectory.src"],
       data_files=[("packagedirectory",["README"])]
       )

Calling with "$ python setup.py sdist --formats=gztar,zip", I see the 
following warnings:

warning: sdist: manifest template 'MANIFEST.in' does not exist (using 
default file list)
warning: sdist: standard file not found: should have one of README, 
README.txt

And "README" is indeed not in the package, but the rest (all Python 
modules) is included.

I tried various things to state the "packagedirectoy" - every time 
without success. What am I doing wrong? Or better: What do I have to 
correct, to include "README" or other files? (Somebody an example?)

The paths have the following structure:

/root with setup.py
/root/packagedirectory with packagename.py and README
/root/packagedirectory/src with other modules

'root' being the root directory of the package not my root directory.

For the record: I'm using OS X 10.3.4 and python 2.3.3 (tried with the 
SGI at my work place where Python 2.3.4 is installed, too. So, I don't 
think an update will help).

Perhaps my question is somewhat naïve, but it's my first time with 
distutils ...

Thanks a lot in advance,
Christian


More information about the Tutor mailing list