From 829f2f72ad0cd65c2634b83d1909a2a7a8d2bab7 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Mon, 18 Sep 2017 13:23:10 -0500 Subject: [PATCH] Make RTD actually work. --- .gitignore | 1 + MANIFEST.in | 10 +++++----- README.rst | 22 ++++++++++++++++++++-- doc-requirements.txt | 2 ++ {doc => docs}/Makefile | 0 {doc => docs}/api.rst | 0 {doc => docs}/changelog.rst | 0 {doc => docs}/conf.py | 16 +++++++++------- {doc => docs}/index.rst | 0 setup.py | 7 ++++++- tox.ini | 8 +++++++- version.txt | 1 - 12 files changed, 50 insertions(+), 17 deletions(-) rename {doc => docs}/Makefile (100%) rename {doc => docs}/api.rst (100%) rename {doc => docs}/changelog.rst (100%) rename {doc => docs}/conf.py (95%) rename {doc => docs}/index.rst (100%) delete mode 100644 version.txt diff --git a/.gitignore b/.gitignore index a6b140f..619f9ca 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ dist/ /.tox/ .coverage htmlcov/ +docs/_build/ diff --git a/MANIFEST.in b/MANIFEST.in index 7d4f49a..a08cb48 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -10,9 +10,9 @@ include nose2.cfg include tox.ini include .travis.yml include *.txt -include .nti_cover_package -recursive-include doc *.py -recursive-include doc *.rst -recursive-include doc Makefile -recursive-exclude doc changelog.rst +exclude .nti_cover_package +recursive-include docs *.py +recursive-include docs *.rst +recursive-include docs Makefile + recursive-include src *.zcml diff --git a/README.rst b/README.rst index 39fc714..0d69e29 100644 --- a/README.rst +++ b/README.rst @@ -2,8 +2,26 @@ nti.externalization ===================== +.. image:: https://img.shields.io/pypi/v/nti.externalization.svg + :target: https://pypi.python.org/pypi/nti.externalization/ + :alt: Latest release + +.. image:: https://img.shields.io/pypi/pyversions/nti.externalization.svg + :target: https://pypi.org/project/nti.externalization/ + :alt: Supported Python versions + .. image:: https://travis-ci.org/NextThought/nti.externalization.svg?branch=master - :target: https://travis-ci.org/NextThought/nti.externalization + :target: https://travis-ci.org/NextThought/nti.externalization .. image:: https://coveralls.io/repos/github/NextThought/nti.externalization/badge.svg?branch=master - :target: https://coveralls.io/github/NextThought/nti.externalization?branch=master + :target: https://coveralls.io/github/NextThought/nti.externalization?branch=master + +.. image:: https://readthedocs.org/projects/ntiexternalization/badge/?version=latest + :target: https://ntiexternalization.readthedocs.io/en/latest/ + :alt: Documentation Status + +A flexible, schema-driven system for converting Python objects to and +from external formats such as JSON and YAML. This works well in a +zope.component environment such as Pyramid. + +Documentation is hosted at https://ntiexternalization.readthedocs.io/ diff --git a/doc-requirements.txt b/doc-requirements.txt index d8c44ef..50ba27a 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -1,4 +1,6 @@ setuptools >= 33.1.1 +persistent +BTrees zope.interface zope.proxy repoze.sphinx.autointerface diff --git a/doc/Makefile b/docs/Makefile similarity index 100% rename from doc/Makefile rename to docs/Makefile diff --git a/doc/api.rst b/docs/api.rst similarity index 100% rename from doc/api.rst rename to docs/api.rst diff --git a/doc/changelog.rst b/docs/changelog.rst similarity index 100% rename from doc/changelog.rst rename to docs/changelog.rst diff --git a/doc/conf.py b/docs/conf.py similarity index 95% rename from doc/conf.py rename to docs/conf.py index cc0f206..746256d 100644 --- a/doc/conf.py +++ b/docs/conf.py @@ -19,7 +19,11 @@ # import os # import sys # sys.path.insert(0, os.path.abspath('.')) - +import os +import sys +import pkg_resources +sys.path.append(os.path.abspath('../src')) +rqmt = pkg_resources.require('nti.externalization')[0] # -- General configuration ------------------------------------------------ @@ -58,12 +62,10 @@ # |version| and |release|, also used in various other places throughout the # built documents. # -# The full version, including alpha/beta/rc tags. -with open('../version.txt') as f: - release = f.read().strip() - # The short X.Y version. -version = '.'.join(release.split('.')[:2]) +version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2])) +# The full version, including alpha/beta/rc tags. +release = rqmt.version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -89,7 +91,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -# html_theme = 'alabaster' +html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/doc/index.rst b/docs/index.rst similarity index 100% rename from doc/index.rst rename to docs/index.rst diff --git a/setup.py b/setup.py index 8055573..47b1187 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def _read(fname): setup( name='nti.externalization', - version=_read('version.txt').strip(), + version='1.0.0.dev0', author='Jason Madden', author_email='jason@nextthought.com', description="NTI Externalization", @@ -78,6 +78,11 @@ def _read(fname): ], extras_require={ 'test': TESTS_REQUIRE, + 'docs': [ + 'Sphinx', + 'repoze.sphinx.autointerface', + 'sphinx_rtd_theme', + ] }, entry_points=entry_points, ) diff --git a/tox.ini b/tox.ini index 82cfef4..0696ac1 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py27,py35,py36,pypy,pypy3,coverage + py27,py35,py36,pypy,pypy3,coverage,docs [testenv] commands = @@ -18,3 +18,9 @@ commands = deps = {[testenv]deps} coverage + +[testenv:docs] +commands = + sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html +deps = + .[docs] diff --git a/version.txt b/version.txt deleted file mode 100644 index 6a14782..0000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -1.0.0.dev0