Currently I am use an import in my setup script to build a file I need during 
the install. Specifically:

#!/usr/bin/env python
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup

import manpage # simply importing manpage creates the ec.1 as a side effect

setup(
    name='ec',
    version='1.0',
    ...,
    data_files=[('man/man1', ['ec.1'])],
    ...
)

However, I require that docutils be installed in advance otherwise the import 
will fail. To resolve this, I would like to use setup_requires='docutils>0.7'.  
For this to be effective, I will have to arrange things so that the import 
occurs during the evaluation of setup(). Is that possible?

I have created an ugly hack that works by calling setup() twice ...

setup(
    name='ec',
    version='1.0',
    ...,
    setup_requires='docutils >= 0.7',
    ...)
import manpage # simply importing manpage creates the ec.1 as a side effect 
setup(
    name='ec',
    version='1.0',
    ...,
    data_files=[('man/man1', ['ec.1'])],
    ...)

But I cannot help but believe there must be a better way.
Is there some way add a hook to setup to get it to do the import for me after 
setup_requires has been processed?
If not, is there some way to install docutils if needed before I call setup()?

-Ken
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to