diff options
author | Yu-Jie Lin <livibetter@gmail.com> | 2013-08-24 22:00:01 +0800 |
---|---|---|
committer | Yu-Jie Lin <livibetter@gmail.com> | 2013-08-24 22:00:01 +0800 |
commit | 47a373c61d28835552239c20cfd225c76371e980 (patch) | |
tree | f9d4c7c9430f1f61f5204abaf8ae2ec164049dfc /setup.py | |
parent | a7122fc4c21f4705236eec0f47dbda3eeb53dbd3 (diff) | |
download | smartypants-47a373c61d28835552239c20cfd225c76371e980.tar.gz |
huge changeset for documentation
Now the documentation is generated by Sphinx. Related commands and configurations are also added. Many moved from README.rst to docstrings in the module.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -7,6 +7,18 @@ from distutils.core import Command, setup from unittest import TestLoader, TextTestRunner import sys +try: + from sphinx.setup_command import BuildDoc +except ImportError: + # No need of Sphinx for normal users + BuildDoc = None +try: + from sphinx_pypi_upload import UploadDoc +except ImportError: + # Sphinx-PyPI-upload not compatible with Python 3 + UploadDoc = None + + CLI_script = 'smartypants' module_name = 'smartypants' module_file = 'smartypants.py' @@ -14,7 +26,10 @@ module_file = 'smartypants.py' CHECK_FILES = ('.', CLI_script) # scripts to be exculded from checking -EXCLUDE_SCRIPTS = () +EXCLUDE_SCRIPTS = ( + 'conf.py', # <- docs/conf.py is a auto-generated disaster of PEP8 + 'smartypants_command.py', +) # ============================================================================ @@ -195,7 +210,7 @@ with open(module_file) as f: 'author_email'] meta = dict([m for m in meta.items() if m[0] in meta_keys]) -with open('README-PyPI.rst') as f: +with open('README.rst') as f: long_description = f.read() classifiers = [ @@ -217,6 +232,8 @@ setup_d = dict( 'pyflakes': cmd_pyflakes, 'pylint': cmd_pylint, 'test': cmd_test, + 'build_sphinx': BuildDoc, + 'upload_sphinx': UploadDoc, }, classifiers=classifiers, py_modules=[module_name], |