Automatic Distutils generator

Discussion in 'Python' started by macm, Nov 25, 2010.

  1. macm

    macm Guest

    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
     
    macm, Nov 25, 2010
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    792
    Guest
    Jun 29, 2004
  2. Rusty Jones

    Automatic Web Page Generator

    Rusty Jones, Jul 15, 2003, in forum: HTML
    Replies:
    3
    Views:
    625
    Rob McAninch
    Jul 15, 2003
  3. timw.google
    Replies:
    1
    Views:
    563
    Serge Orlov
    May 11, 2006
  4. Luis Alberto Zarrabeitia Gomez

    distutils, No module named numpy.distutils.fcompiler.conv_template

    Luis Alberto Zarrabeitia Gomez, Mar 30, 2009, in forum: Python
    Replies:
    0
    Views:
    1,359
    Luis Alberto Zarrabeitia Gomez
    Mar 30, 2009
  5. XLiIV
    Replies:
    1
    Views:
    131
    Stefan Behnel
    Feb 25, 2012
Loading...

Share This Page