Query distutils for directory names
Is there a way to query distutils to give me the name of the lib and/or temp directories (i.e., on my machine, build/lib.darwin-7.5.0-PowerMacintosh-2.3 and build/temp.darwin-7.5.0-PowerMacintosh-2.3) that distutils creates during its build process? I can't find anything in the documentation. This would be useful for telling test scripts where to find the local versions of the module(s), as well as for linking to SWIG runtime libraries that I would like to have distutils compile. I wrote some usable python code that manually concatenates the pieces together, put I do not trust its portability. Thanks ** Bill Spotz ** ** Sandia National Laboratories Voice: (505)845-0170 ** ** P.O. Box 5800 Fax: (505)284-5451 ** ** Albuquerque, NM 87185-0316 Email: wfspotz@sandia.gov **
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Bill, On Mon, Sep 20, 2004 at 10:33:58AM -0600, Bill Spotz wrote:
Is there a way to query distutils to give me the name of the lib and/or temp directories (i.e., on my machine, build/lib.darwin-7.5.0-PowerMacintosh-2.3 and build/temp.darwin-7.5.0-PowerMacintosh-2.3) that distutils creates during its build process? I can't find anything in the documentation. The distutils.command.build class has the following variables which might help you: self.build_purelib self.build_platlib self.build_lib self.build_temp self.build_scripts
So you could make a subclass of the build class: class mybuild (distutils.command.build, object): def run (self): super(mybuild, self).run() print "build dir for platform-neutral modules is", self.build_purelib setup(... cmdclass = {'build': mybuild}, ... ) This way, you always have the correct build dir available even when the user changes it with command line options. Regards, Bastian - -- ,''`. Bastian Kleineidam . calvin (at) debian.org : :' : `. `' GnuPG Schlüssel http://kampfwurst.net/gpgkey.txt `- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFBUrYTeBwlBDLsbz4RAoiVAKDTJveuhEuzeX0+Q+K3S3uASrkLOQCgmsrS hXo0/WTlgoZTiRobmA7iO9A= =TKSj -----END PGP SIGNATURE-----
participants (2)
-
Bastian Kleineidam
-
Bill Spotz