By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,771 Members | 1,741 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,771 IT Pros & Developers. It's quick & easy.

distutils help

P: n/a
Hello,

I thought this would be easy but I guess I didn't get the distutil
feeling. I am trying to write a setup for install my package but I don't
understand how to do that.

organisation:

setup.py
/bin/
gdcm.py
_gdcm.so
libvtkgdcmPython.so
/gdcmPython/
gdcm.pth
How do you specify setup you want to install library ? Do you use
'data_files' ? Same thing for gdcm.pth is this a 'data_files' also ?

Thanks
Mathieu

Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
What is the purpose of DISTUTILS_DEBUG, if I set it to one, I cannot get
anything to run ?

For instance:

"""
from distutils.core import setup

import glob

thefiles = []
for afile in glob.glob('datadir/*'):
if afile.endswith('.not'): continue
thefiles.append(afile)

print "Packaging up", thefiles

setup(name='justdata', data_files = [ [ 'foodir', thefiles ] ] )
"""

Here's an example of how this works:

[alex@lancelot tryp]$ ls datadir
aa.yes bb.not cc.yes
[alex@lancelot tryp]$ python setup.py bdist
Then try it with

export DISTUTILS_DEBUG=1

I get:

Packaging up ['bin/libgdcmijpeg8.so', 'bin/libgdcmijpeg12.so',
'bin/libgdcmljpeg.so', 'bin/libgdcm.so', 'bin/libvtkgdcm.so',
'bin/_gdcm.so', 'bin/libvtkgdcmPython.so']
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'bdist' command:
{}
running bdist
Distribution.get_command_obj(): creating 'bdist' command object
Distribution.get_command_obj(): creating 'build' command object
Distribution.get_command_obj(): creating 'bdist_dumb' command object
bdist.run: format=gztar, command=bdist_dumb, rest=[]
running bdist_dumb
running build
Distribution.get_command_obj(): creating 'install' command object
installing to build/bdist.linux-i686/dumb
running install
pre-finalize_{unix,other}:
prefix: None
exec_prefix: None
home: None
install_base: None
install_platbase: None
root: build/bdist.linux-i686/dumb
install_purelib: None
install_platlib: None
install_lib: None
install_headers: None
install_scripts: None
install_data: None
compile: None
Traceback (most recent call last):
File "setup.py", line 12, in ?
setup(name='justdata', data_files = [ [ 'foodir', thefiles ] ] )
File "/usr/lib/python2.2/distutils/core.py", line 138, in setup
dist.run_commands()
File "/usr/lib/python2.2/distutils/dist.py", line 902, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.2/distutils/dist.py", line 922, in run_command
cmd_obj.run()
File "/usr/lib/python2.2/distutils/command/bdist.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.2/distutils/dist.py", line 922, in run_command
cmd_obj.run()
File "/usr/lib/python2.2/distutils/command/bdist_dumb.py", line 81,
in run
self.run_command('install')
File "/usr/lib/python2.2/distutils/cmd.py", line 330, in run_command
self.distribution.run_command(command)
File "/usr/lib/python2.2/distutils/dist.py", line 921, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.2/distutils/cmd.py", line 112, in ensure_finalized
self.finalize_options()
File "/usr/lib/python2.2/distutils/command/install.py", line 252, in
finalize_options
self.dump_dirs("pre-finalize_{unix,other}")
File "/usr/lib/python2.2/distutils/command/install.py", line 350, in
dump_dirs
val = getattr(self, opt_name)
File "/usr/lib/python2.2/distutils/cmd.py", line 107, in __getattr__
raise AttributeError, attr
AttributeError: no_compile
Could someone please fix the documentation saying that one should not
use it.

Thanks
Mathieu

Mathieu Malaterre wrote:
Hello,

I thought this would be easy but I guess I didn't get the distutil
feeling. I am trying to write a setup for install my package but I don't
understand how to do that.

organisation:

setup.py
/bin/
gdcm.py
_gdcm.so
libvtkgdcmPython.so
/gdcmPython/
gdcm.pth
How do you specify setup you want to install library ? Do you use
'data_files' ? Same thing for gdcm.pth is this a 'data_files' also ?

Thanks
Mathieu


Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.