Automatic Distutils generator

M

macm

Hi Folks


I am trying run Distutils setup inside a script.

The Docs dont tell me much and I cant find any examples.

This script will generate shared libraries recursive to all files in a
dir.


-----------------------------
import os
import sys
from distutils.core import setup as d
from distutils.extension import Extension
from Cython.Distutils import build_ext

fileList = []
rootdir = sys.argv[1]
fileType = '.pyx'

for root, subFolders, files in os.walk(rootdir):
for file in files:
if file[-4:] == fileType:
fileList.append(os.path.join(root,file))

# But Here I want automatic Distutils generator
# I want replace manual entry like this:
# python setup.py build_ext --inplace

d.setup(name = str(file) + '_Cython',
ext_modules=[
Extension(file[:-4], [file])
],
cmdclass = {'build_ext': build_ext})
d.run_setup()



print 'Files convert: \n'
print fileList

----------------------------

Who can help me fix it?


Best Regards

Mario
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top