Clean up version numbering and readme/description/docs sharing

This commit is contained in:
medmunds
2013-03-05 15:33:01 -08:00
parent 51d45353ee
commit 9211c74144
4 changed files with 19 additions and 32 deletions

View File

@@ -7,27 +7,14 @@
(see long_description_from_readme in setup.py)
You can use docutils 1.0 markup, but *not* any Sphinx additions.
.. These substitution definitions apply in the readme (github) only;
they're altered by setup.py for the long_description,
and defined differently for the docs includes
.. |release| replace:: (source)
.. |version| replace:: |release|
.. |buildstatus| image:: https://secure.travis-ci.org/brack3t/Djrill.png?branch=master
:target: https://travis-ci.org/brack3t/Djrill
.. default-role:: literal
.. _shared-intro:
.. This shared-intro section is also included in docs/index.rst
Djrill: Mandrill Transactional Email for Django
===============================================
Release |release|
.. _shared-intro:
.. This shared-intro section is also included in docs/index.rst
Djrill integrates the `Mandrill <http://mandrill.com>`_ transactional
email service into Django.
@@ -41,11 +28,16 @@ package. It includes:
* An optional Django admin interface
Djrill is released under the BSD license. It is tested against Django 1.3, 1.4, and 1.5
(including Python 3 support with Django 1.5). |buildstatus|
(including Python 3 support with Django 1.5).
.. END shared-intro
Resources:
.. image:: https://secure.travis-ci.org/brack3t/Djrill.png?branch=master
:target: https://travis-ci.org/brack3t/Djrill
:alt: build status on Travis-CI
**Resources**
* Full documentation: https://djrill.readthedocs.org/en/latest/
* Package on PyPI: https://pypi.python.org/pypi/djrill

View File

@@ -1,3 +1,3 @@
VERSION = (0, 3, 9)
VERSION = (0, 4, 0, 'dev1') # Remove the 'dev1' component in release branches
__version__ = '.'.join([str(x) for x in VERSION])
__minor_version__ = '.'.join([str(x) for x in VERSION[:2]]) # Sphinx's X.Y "version"

View File

@@ -3,20 +3,17 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Djrill: Mandrill Transactional Email for Django
===============================================
Version |release|
.. Incorporate the shared-intro section from the root README:
.. include:: ../README.rst
:start-after: _shared-intro:
:end-before: END shared-intro
.. Eliminate the README's Travis build status indicator.
(Is there some way we could link to Travis status for the
specific |VERSION| of the app being documented here???)
.. |buildstatus| replace:: \
.. _toc:
Documentation
-------------

View File

@@ -9,12 +9,10 @@ with open("djrill/_version.py") as f:
def long_description_from_readme(rst):
# Patch up some rest substitution variables (references only - not definitions):
rst = re.sub(r'(?<!\.\. )\|release\|', __version__, rst)
rst = re.sub(r'(?<!\.\. )\|version\|', __minor_version__, rst)
rst = re.sub(r'(?<!\.\. )\|buildstatus\|', "", rst) # hide latest-code Travis status indicator
rst = re.sub(r'(djrill\.readthedocs\.org/\w+)/latest',
r'\1/' + __version__, rst) # freeze docs link to this version
# In release branches, freeze some external links to refer to this X.Y version:
if not "dev" in __version__:
rst = re.sub(r'branch=master', 'branch=v' + __minor_version__, rst) # Travis build status
rst = re.sub(r'/latest', '/v' + __minor_version__, rst) # ReadTheDocs
return rst
with open('LICENSE') as f: