[Distutils] distutils question

Craig misterbike at hotmail.com
Sun Oct 17 07:48:23 CEST 2004


Hi - I'm trying to use distutils to set up a package that has lots of config files that are co-located with the package itself. The problem I'm having is how to install these files in the same place as my python package. The following ugly hack is what I came up with, but I can't believe there isn't a better way. If it matters, the platforms I'm using are windows and linux.
Thanks,
Craig

MANIFEST.in:
graft Rooms
graft Devices


setup.py:

from distutils.core import setup
import glob
import os.path

from distutils.dist import Distribution
i = Distribution().get_command_obj('install')
i.finalize_options()
path = i.install_purelib

setup(name="Photronica",
   author="Craig D",
   author_email="craig.durland at hp.com",
   package_dir = {"Photronica": ""},
   packages=["Photronica","Photronica.DAS"],
   data_files = [
      (os.path.join(path,"Photronica","Devices"), glob.glob("Devices/*")),
      (os.path.join(path,"Photronica","Rooms"),   glob.glob("Rooms/*")),
   ]
)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/distutils-sig/attachments/20041016/7f64d461/attachment.htm


More information about the Distutils-SIG mailing list