Skip to content

Commit

Permalink
Another set of improvements for documentation generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-majlis committed Jul 3, 2017
1 parent 0a26371 commit 6f55710
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,8 @@ ENV/

# mypy
.mypy_cache/

# documentation
pypi-doc.html
_build/

8 changes: 8 additions & 0 deletions API.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

API
---

.. automodule:: mailgunv3

.. autoclass:: MailGunV3
:members:
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Changelog
======================

0.2
---
* Playing with documentation

0.1
---
* Initial commit
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ help:

.PHONY: help Makefile

pypi-html:
python setup.py --long-description | rst2html.py > pypi-doc.html

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
Expand Down
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ This package provides fluent API for `MailGun API`_.

|build-status| |docs| |cc-badge| |cc-issues|

.. PYPI-BEGIN
.. toctree::
:maxdepth: 2

CHANGES
API
.. PYPI-END
Installation
------------

Expand Down Expand Up @@ -104,3 +109,4 @@ External Links
:target: https://codeclimate.com/github/martin-majlis/MailGunV3
:alt: Issue Count


10 changes: 5 additions & 5 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
sys.path.insert(0, os.path.abspath('mailgunv3'))


# -- General configuration ------------------------------------------------
Expand All @@ -31,7 +31,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ['sphinx.ext.autodoc']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -57,7 +57,7 @@
# The short X.Y version.
version = '0.2'
# The full version, including alpha/beta/rc tags.
release = '0.2.2'
release = '0.2.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 4 additions & 0 deletions mailgunv3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@


class MailGunV3(object):
"""
This is the only class that should be directly initialized.
"""

def __init__(self, domain, private_key, public_key):
self.domain = domain
self.private_key = private_key
Expand Down
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import os
import re

from setuptools import setup, find_packages

#here = os.path.abspath(os.path.dirname(__file__))
# with open(os.path.join(here, 'README.txt')) as f:
# README = f.read()
# with open(os.path.join(here, 'CHANGES.txt')) as f:
# CHANGES = f.read()
def fix_doc(txt):
return re.sub(r'\.\. PYPI-BEGIN([\r\n]|.)*?PYPI-END', '', txt, re.DOTALL)

with open('README.rst') as fileR:
README = fix_doc(fileR.read())

with open('CHANGES.rst') as fileC:
CHANGES = fix_doc(fileC.read())

requires = [
'requests',
Expand All @@ -16,9 +20,9 @@

setup(
name='MailGunV3',
version='0.2.2',
version='0.2.4',
description='Python wrapper for Mailgun REST API.',
#long_description=README + '\n\n' + CHANGES,
long_description=README + '\n\n' + CHANGES,
classifiers=[
'Programming Language :: Python',
],
Expand Down

0 comments on commit 6f55710

Please sign in to comment.