distutils lib path

Pearu Peterson pearu at cens.ioc.ee
Tue Dec 25 05:32:47 EST 2001


On Mon, 24 Dec 2001, Daniel Wexler wrote:

> Is there a way to get the name of the platform-specific
> subdirectory name of the build/lib*** directory in my
> setup.py file?
> 
> For example, when I compile under Linux using Python 2.1,
> the directory name I want is:
> 
>     build/lib.linux-i686-2.1
> 
> While, under Windows, the directory name I want is:
> 
>     build/lib.win32-2.1


I have used the following in my programs:

import sys,os
from distutils import util

p = os.path.join('build','lib.%s-%s'%(util.get_platform(),sys.version[0:3]))

...

> Also, is there a way to have distutils perform some arbitrary
> commands after building each extension module?  Or perhaps
> to callback to a python function that I can define (which then
> can do arbitrary things)?  In my case I want to move or create
> links to the resulting .lib or .so files that are built by distutils.

On Windows, can you really create symbolic or hard links?
May be you are looking for --build-platlib option of the distutils build
command? See
    setup.py build --help

Regards,
	Pearu




More information about the Python-list mailing list