summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorYu-Jie Lin <livibetter@gmail.com>2013-08-24 22:00:01 +0800
committerYu-Jie Lin <livibetter@gmail.com>2013-08-24 22:00:01 +0800
commit47a373c61d28835552239c20cfd225c76371e980 (patch)
treef9d4c7c9430f1f61f5204abaf8ae2ec164049dfc /setup.py
parenta7122fc4c21f4705236eec0f47dbda3eeb53dbd3 (diff)
downloadsmartypants-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-xsetup.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index dde9ce9..756252f 100755
--- a/setup.py
+++ b/setup.py
@@ -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],