Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | """ |
| 3 | Sphinx - Python documentation toolchain |
| 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 5 | |
Georg Brandl | 6ff81bf | 2010-08-03 12:34:07 +0000 | [diff] [blame] | 6 | :copyright: 2007-2010 by Georg Brandl. |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 7 | :license: Python license. |
| 8 | """ |
| 9 | |
| 10 | import sys |
Georg Brandl | 6ff81bf | 2010-08-03 12:34:07 +0000 | [diff] [blame] | 11 | import warnings |
| 12 | |
| 13 | # Get rid of UserWarnings reported by pkg_resources. |
| 14 | warnings.filterwarnings('ignore', category=UserWarning, module='jinja2') |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 15 | |
| 16 | if __name__ == '__main__': |
Georg Brandl | 87d2ccf | 2007-08-15 17:25:27 +0000 | [diff] [blame] | 17 | |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 18 | if sys.version_info[:3] < (2, 4, 0) or sys.version_info[:3] > (3, 0, 0): |
| 19 | sys.stderr.write("""\ |
| 20 | Error: Sphinx needs to be executed with Python 2.4 or newer (not 3.x though). |
Georg Brandl | 2077131 | 2008-01-16 20:29:00 +0000 | [diff] [blame] | 21 | (If you run this from the Makefile, you can set the PYTHON variable |
| 22 | to the path of an alternative interpreter executable, e.g., |
| 23 | ``make html PYTHON=python2.5``). |
Georg Brandl | 418b1ea | 2014-03-10 19:26:57 +0100 | [diff] [blame] | 24 | """) |
Georg Brandl | 2077131 | 2008-01-16 20:29:00 +0000 | [diff] [blame] | 25 | sys.exit(1) |
Georg Brandl | 87d2ccf | 2007-08-15 17:25:27 +0000 | [diff] [blame] | 26 | |
Georg Brandl | 8ec7f65 | 2007-08-15 14:28:01 +0000 | [diff] [blame] | 27 | from sphinx import main |
| 28 | sys.exit(main(sys.argv)) |