472,808 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,808 software developers and data experts.

distutils help

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
1 2575
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Isaac Jones | last post by:
Hello Python Community. I bring greetings from the Haskell community (http://www.haskell.org) ;) There has been a lot of discussion of late about creating a grand-unified build & distribution...
0
by: Jorge Godoy | last post by:
Hi! For the following setup.py, I get this error: byte-compiling /var/tmp/bhsys-buildroot/usr/lib/python2.3/site-packages/bhsys/Impressao.py to Impressao.pyc byte-compiling...
15
by: Colin J. Williams | last post by:
The distutils download page has: -------------------------------------------------------- Current stable release The current stable release is Distutils 1.0.2; you can download it as: *...
0
by: Christopher De Vries | last post by:
The predominant operating system in my workplace is Solaris, with a bit of Linux and MacOS X thrown in. As such people expect to install new software with the sequence: ../configure make make...
1
by: Terry Hancock | last post by:
Some time ago, I got the idea that I wanted to build image resources from vector graphic originals, instead of marshalling hundreds of tiny little icon images by hand. I wrote "BuildImage" to do...
0
by: Maarten Sneep | last post by:
I'm trying to build PyBison on Mac OS X, and I'm running into some problems with the distutils. Just for starters: PyBison requires Pyrex. This is not a problem, and Pyrex seems to work without...
7
by: vedrandekovic | last post by:
Hello again, Is there any patch for python "distutils", for this ImportError: cannot import name log Regards, Vedran
3
by: Rick Muller | last post by:
I need some distutils help. I currently run a python library (PyQuante) that, until recently, had all of its modules in a single directory, called "PyQuante". The setup command in my setup.py...
0
by: newbie73 | last post by:
OS: Vista Python 2.5.2.2 (ActiveState Software Installation) Running latest Cygwin release The error generated is pasted below - please help. - Luis ***************************************
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.