[Distutils] Packaging of files, which aren't in the package root folder

Lukas Hetzenecker LuHe at gmx.at
Sun Dec 20 20:44:16 CET 2009


I found a simpler way to do this - Is there any drawback if I try to solve 
this problem using this way:

dist = setup(name='series60-remote',
             [...]
             scripts=['series60-remote']
             )

# HACK! Copy extra files
if dist.have_run.get('install'):
   install = dist.get_command_obj('install')

   # Copy textfiles in site-package directory
   for file in textfiles:
      install.copy_file(file, os.path.join(install.install_lib, app_dir))

   # Copy .sis files on Unix-like systems to /usr/share/series60-remote, on 
Windows systems
   # to PREFIX/site-packages/series60_remote/mobile
   if os.name == 'posix':
      dest = os.path.join(install.install_data, 'share', 
install.config_vars['dist_name'])
   else:
      dest = os.path.join(install.install_lib, app_dir, 'mobile')

   install.mkpath(dest)
   for file in sisfiles:
      install.copy_file(file, dest)


I attached the whole setup.py script too

Thank you for your helpful suggestions,
Lukas

> No, at least not using public API.
> 
> What you can do is to override the install command (the one which
> knows the computed install prefix), and use it from there. But you
> still cannot control this from the setup.py, that is your command is
> called by distutils, and you don't control it.
> 
> David
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setup.py
Type: text/x-python
Size: 3280 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20091220/d56c8ac9/attachment-0001.py>


More information about the Distutils-SIG mailing list