views:

24

answers:

1

Hi there!

I'm writing a tool to automatically generate .egg files from python projects. The tool basically discovers some properties to guess the setup options (such as version number etc).

Now I would like to call the setup() function, with the context bdist_egg.

I do as such :

if __name__ == '__main__'
    project_dir = _get_dir(sys.argv)
    os.chdir(project_dir)
    config = _guess_configuration(project_dir) # returns a dict

    sys.argv = ['', 'bdist_egg']
    setup(**config)

And then I can call my script

python make_egg.py /path/to/project

What I would like is to skip the sys.argv = ['', 'bdist_egg'] part. Is there a way to have the setup command passed to the setup function?

Thanks

A: 

setup(script_args=['bdist_egg'], **config)

pjeby
Perfect! Thanks!
Olivier H