diff options
author | georg.brandl <devnull@localhost> | 2008-03-25 11:01:28 +0000 |
---|---|---|
committer | georg.brandl <devnull@localhost> | 2008-03-25 11:01:28 +0000 |
commit | 9fa0421f13a4f560ff3a7daaa9253a6e9d82e285 (patch) | |
tree | b48e5a78d7421931b0662a5c622c1f64fb741dc1 /setup.py | |
parent | 0edf8a559054269d3a3b679928f9202ec3f35369 (diff) | |
download | sphinx-9fa0421f13a4f560ff3a7daaa9253a6e9d82e285.tar.gz |
* setup: On Python 2.4, don't egg-depend on docutils if a docutils is
already installed -- else it will be overwritten.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- import ez_setup ez_setup.use_setuptools() -import sphinx +import sys from setuptools import setup, Feature +import sphinx + long_desc = ''' Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of @@ -32,6 +34,25 @@ are already present, work fine and can be seen "in action" in the Python docs: and inclusion of appropriately formatted docstrings. ''' +requires = ['Pygments>=0.8', 'docutils>=0.4'] + +if sys.version_info < (2, 4): + print 'ERROR: Sphinx requires at least Python 2.4 to run.' + sys.exit(1) + +if sys.version_info < (2, 5): + # Python 2.4's distutils doesn't automatically install an egg-info, + # so an existing docutils install won't be detected -- in that case, + # remove the dependency from setup.py + try: + import docutils + if int(docutils.__version__[2]) < 4: + raise ValueError('docutils not recent enough') + except: + pass + else: + del requires[-1] + setup( name='Sphinx', version=sphinx.__version__, @@ -66,5 +87,5 @@ setup( 'sphinx-quickstart = sphinx.quickstart:main' ] }, - install_requires=['Pygments>=0.8', 'docutils>=0.4'] + install_requires=requires, ) |