[Distutils] package relative files?

Fred L. Drake, Jr. fdrake at acm.org
Mon Nov 15 20:54:03 CET 2004

On Monday 15 November 2004 05:44 am, Robin Becker wrote:
 > Is there a proper way to get files to go along with packages/modules. The
 > directory options seem to imply python executable or distribution relative
 > rather than package relative.

Bob mentioned setuptools in another response; that's a good source for this 
functionality.  I'd like to add that for Python 2.4, the functionality has 
been added directly to distutils in a setuptools-compatible way.  You'll be 
able to use the "package_data" metadata with distutils directly.

If this is the only setuptools functionality you need, you can easily require 
setuptools only for older versions of Python:

import sys
from distutils.core import setup

if sys.version_info < (2, 4):
    from setuptools import setup


Fred L. Drake, Jr.  <fdrake at acm.org>

More information about the Distutils-SIG mailing list