summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-08-06 19:22:52 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-08-07 11:18:33 +0900
commita71985b9defc28b469787393193fdbe5904cab96 (patch)
tree58fc0100761d144197e969db71ddc0fb8a80839d
parent5fcb5d59efedd947cbfb7bb1c628ee51037fbab2 (diff)
downloadpygerrit-a71985b9defc28b469787393193fdbe5904cab96.tar.gz
Add generation of package documentation
Documentation is generated in html format into the docs folder. The idea is that with further commits we can automatically generate and package the documentation into a zip file that can be published to the package index. Change-Id: Ia5719bda59b6224fc05e2021e9054e29990ad22a
-rw-r--r--.gitignore1
-rw-r--r--Makefile31
-rw-r--r--doc_requirements.txt5
-rw-r--r--pygerrit/client.py2
4 files changed, 37 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 26b5985..79de381 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,5 +2,6 @@
.settings
build/
dist/
+docs/
pygerrit.egg-info/
pygerritenv/
diff --git a/Makefile b/Makefile
index f69e63e..549e84f 100644
--- a/Makefile
+++ b/Makefile
@@ -20,10 +20,34 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
+PWD := $(shell pwd)
+
all: test
test: clean unittests pyflakes pep8 pep257 pylint
+docs: html
+
+html: sphinx
+ bash -c "\
+ source ./pygerritenv/bin/activate && \
+ export PYTHONPATH=$(PWD) && \
+ cd docs && \
+ make html && \
+ cd $(PWD)"
+
+sphinx: docenvsetup
+ bash -c "\
+ source ./pygerritenv/bin/activate && \
+ sphinx-apidoc \
+ -V \"$(TAG)\" \
+ -R \"$(TAG)\" \
+ -H \"Pygerrit\" \
+ -A \"Sony Mobile Communications\" \
+ --full \
+ --force \
+ -o docs pygerrit"
+
pylint: testenvsetup
bash -c "\
source ./pygerritenv/bin/activate && \
@@ -55,6 +79,11 @@ testenvsetup: envsetup
source ./pygerritenv/bin/activate && \
pip install --upgrade -r test_requirements.txt"
+docenvsetup: envsetup
+ bash -c "\
+ source ./pygerritenv/bin/activate && \
+ pip install --upgrade -r doc_requirements.txt"
+
envsetup: envinit
bash -c "\
source ./pygerritenv/bin/activate && \
@@ -65,4 +94,4 @@ envinit:
clean:
@find . -type f -name "*.pyc" -exec rm -f {} \;
- @rm -rf pygerritenv pygerrit.egg-info build dist
+ @rm -rf pygerritenv pygerrit.egg-info build dist docs
diff --git a/doc_requirements.txt b/doc_requirements.txt
new file mode 100644
index 0000000..0b3125f
--- /dev/null
+++ b/doc_requirements.txt
@@ -0,0 +1,5 @@
+docutils==0.11
+Jinja2==2.7
+MarkupSafe==0.18
+Pygments==1.6
+Sphinx==1.2b1
diff --git a/pygerrit/client.py b/pygerrit/client.py
index 11cc1af..5734ad8 100644
--- a/pygerrit/client.py
+++ b/pygerrit/client.py
@@ -106,7 +106,7 @@ class GerritClient(object):
Return a `GerritEvent` instance, or None if:
- `block` is False and there is no event available in the queue, or
- `block` is True and no event is available within the time
- specified by `timeout`.
+ specified by `timeout`.
"""
try: