question about Distutils

Thomas Heller thomas.heller at ion-tof.com
Thu Sep 28 20:56:06 CEST 2000


> It only seems to be designed for modules or packages (libraries), not
> for python scripts we want to be installed in /usr/local/bin (for
> example) like complete software. Am I wrong ?
There is a 'scripts' parameter for the setup() function.

If you cannot find it in the docs, here is an example (posted
by Greg Ward to the python-dev list):

  #!/usr/bin/env python

  import os
  from distutils.core import setup
  from distutils.command.install_data import install_data

  class IDLE_install_data (install_data):
      def finalize_options (self):
          if self.install_dir is None:
              install_lib = self.get_finalized_command('install_lib')
              self.install_dir = os.path.join(install_lib.install_dir,
"idle")

  setup(name = "IDLE",
        version = "0.6",
        author = "Guido van Rossum",
        author_email = "guido at python.org",
        cmdclass = {'install_data': IDLE_install_data},
        packages = ['idle'],
        package_dir = {'idle': ''},
        scripts = ['idle'],
        data_files = ['config.txt', 'config-unix.txt', 'config-win.txt'])

Thomas





More information about the Python-list mailing list