Skip to content

Commit

Permalink
Generate README.rst from docs/templates/readme.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
ask committed Apr 11, 2016
1 parent f6a54fc commit acd251e
Show file tree
Hide file tree
Showing 7 changed files with 499 additions and 75 deletions.
106 changes: 76 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,70 +1,116 @@
PROJ=kombu
PYTHON=python
SPHINX_DIR="docs/"
GIT=git
TOX=tox
NOSETESTS=nosetests
ICONV=iconv
FLAKE8=flake8
FLAKEPLUS=flakeplus

SPHINX_DIR=docs/
SPHINX_BUILDDIR="${SPHINX_DIR}/_build"
README="README.rst"
README=README.rst
README_SRC="docs/templates/readme.txt"
CONTRIBUTING_SRC="docs/contributing.rst"
SPHINX2RST="sphinx2rst"

SPHINX_HTMLDIR = "${SPHINX_BUILDDIR}/html"

html:
DOCUMENTATION=Documentation
FLAKEPLUSTARGET=2.7

all: help

help:
@echo "docs - Build documentation."
@echo "test-all - Run tests for all supported python versions."
@echo "distcheck ---------- - Check distribution for problems."
@echo " test - Run unittests using current python."
@echo " lint ------------ - Check codebase for problems."
@echo " apicheck - Check API reference coverage."
@echo " configcheck - Check configuration reference coverage."
@echo " readmecheck - Check README encoding."
@echo " flakes -------- - Check code for syntax and style errors."
@echo " flakecheck - Run flake8 on the source code."
@echo " flakepluscheck - Run flakeplus on the source code."
@echo "readme - Regenerate README.rst file."
@echo "clean-dist --------- - Clean all distribution build artifacts."
@echo " clean-git-force - Remove all uncomitted files."
@echo " clean ------------ - Non-destructive clean"
@echo " clean-pyc - Remove .pyc/__pycache__ files"
@echo " clean-docs - Remove documentation build artifacts."
@echo " clean-build - Remove setup artifacts."

clean: clean-docs clean-pyc clean-build

clean-dist: clean clean-git-force

Documentation:
(cd "$(SPHINX_DIR)"; $(MAKE) html)
mv "$(SPHINX_HTMLDIR)" Documentation
mv "$(SPHINX_HTMLDIR)" $(DOCUMENTATION)

docsclean:
docs: Documentation

clean-docs:
-rm -rf "$(SPHINX_BUILDDIR)"

htmlclean:
(cd "$(SPHINX_DIR)"; $(MAKE) clean)
lint: flakecheck apicheck configcheck readmecheck

apicheck:
(cd "$(SPHINX_DIR)"; $(MAKE) apicheck)

configcheck:
(cd "$(SPHINX_DIR)"; $(MAKE) configcheck)

flakecheck:
flake8 kombu
$(FLAKE8) "$(PROJ)"

flakediag:
-$(MAKE) flakecheck

flakepluscheck:
flakeplus --2.7 kombu
$(FLAKEPLUS) --$(FLAKEPLUSTARGET) "$(PROJ)"

flakeplusdiag:
-$(MAKE) flakepluscheck

flakes: flakediag flakeplusdiag

readmeclean:
clean-readme:
-rm -f $(README)

readmecheck:
iconv -f ascii -t ascii $(README) >/dev/null
$(ICONV) -f ascii -t ascii $(README) >/dev/null

$(README):
$(SPHINX2RST) $(README_SRC) --ascii > $@

readme: readmeclean $(README) readmecheck

test:
nosetests -xv kombu.tests

cov:
nosetests -xv kombu.tests --with-coverage --cover-html --cover-branch
readme: clean-readme $(README) readmecheck

removepyc:
clean-pyc:
-find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
-find . -type d -name "__pycache__" | xargs rm -r

gitclean:
git clean -xdn
removepyc: clean-pyc

gitcleanforce:
git clean -xdf
clean-build:
rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/

clean-git:
$(GIT) clean -xdn

clean-git-force:
$(GIT) clean -xdf

test-all: clean-pyc
$(TOX)

test:
$(PYTHON) setup.py test

cov:
$(NOSETESTS) -xv --with-coverage --cover-html --cover-branch

tox: removepyc
tox
build:
$(PYTHON) setup.py sdist bdist_wheel

distcheck: flakecheck apicheck readmecheck test gitclean
distcheck: lint test clean

dist: readme docsclean gitcleanforce removepyc
dist: readme clean-dist build
93 changes: 49 additions & 44 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
.. _kombu-index:

========================================
kombu - Messaging library for Python
========================================

|build-status| |coverage-status|
|build-status| |coverage| |bitdeli|

:Version: 4.0.0a1
:Web: http://kombu.me/
:Download: http://pypi.python.org/pypi/kombu/
:Source: https://github.com/celery/kombu/
:Keywords: messaging, amqp, rabbitmq, redis, mongodb, python, queue

About
=====

`Kombu` is a messaging library for Python.

Expand All @@ -29,8 +34,7 @@ Features
* High performance AMQP transport written in C - when using `librabbitmq`_

This is automatically enabled if librabbitmq is installed:

.. code-block:: console
::

$ pip install librabbitmq

Expand Down Expand Up @@ -80,7 +84,6 @@ and the `Wikipedia article about AMQP`_.
.. _`Pyro`: http://pythonhosting.org/Pyro
.. _`SoftLayer MQ`: http://www.softlayer.com/services/additional/message-queue


.. _transport-comparison:

Transport Comparison
Expand Down Expand Up @@ -135,8 +138,7 @@ Kombu is using Sphinx, and the latest documentation can be found here:

Quick overview
--------------

.. code-block:: python
::

from kombu import Connection, Exchange, Queue

Expand Down Expand Up @@ -180,8 +182,7 @@ Quick overview


Or handle channels manually:

.. code-block:: python
::

with connection.channel() as channel:
producer = Producer(channel, ...)
Expand All @@ -190,8 +191,7 @@ Or handle channels manually:

All objects can be used outside of with statements too,
just remember to close the objects after use:

.. code-block:: python
::

from kombu import Connection, Consumer, Producer

Expand All @@ -214,8 +214,7 @@ to a channel.

Binding exchanges and queues to a connection will make it use
that connections default channel.

.. code-block:: pycon
::

>>> exchange = Exchange('tasks', 'direct')

Expand All @@ -228,33 +227,6 @@ that connections default channel.
raise NotBoundError: Can't call delete on Exchange not bound to
a channel.

Installation
============

You can install `Kombu` either via the Python Package Index (PyPI)
or from source.

To install using `pip`,:

.. code-block:: console
$ pip install kombu
To install using `easy_install`,:

.. code-block:: console
$ easy_install kombu
If you have downloaded a source tarball you can install it
by doing the following,:

.. code-block:: console
$ python setup.py build
# python setup.py install # as root
Terminology
===========

Expand Down Expand Up @@ -312,6 +284,32 @@ There are some concepts you should be familiar with before starting:
routing keys `"usd.stock"` and `"eur.stock.db"` but not
`"stock.nasdaq"`.


Installation
============

You can install `Kombu` either via the Python Package Index (PyPI)
or from source.

To install using `pip`,:
::

$ pip install kombu

To install using `easy_install`,:
::

$ easy_install kombu

If you have downloaded a source tarball you can install it
by doing the following,:
::

$ python setup.py build
# python setup.py install # as root



Getting Help
============

Expand Down Expand Up @@ -342,9 +340,16 @@ License
This software is licensed under the `New BSD License`. See the `LICENSE`
file in the top distribution directory for the full license text.

.. image:: https://d2weczhvl823v0.cloudfront.net/celery/kombu/trend.png

.. |build-status| image:: https://secure.travis-ci.org/celery/kombu.png?branch=master
:alt: Build status
:target: https://travis-ci.org/celery/kombu

.. |coverage| image:: https://codecov.io/github/celery/kombu/coverage.svg?branch=master
:target: https://codecov.io/github/celery/kombu?branch=master

.. |bitdeli| image:: https://d2weczhvl823v0.cloudfront.net/celery/kombu/trend.png
:alt: Bitdeli badge
:target: https://bitdeli.com/free
--

.. |build-status| image:: https://travis-ci.org/celery/kombu.svg?branch=master
:target: https://travis-ci.org/celery/kombu
27 changes: 27 additions & 0 deletions docs/includes/installation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Installation
============

You can install `Kombu` either via the Python Package Index (PyPI)
or from source.

To install using `pip`,:

.. code-block:: console

$ pip install kombu

To install using `easy_install`,:

.. code-block:: console

$ easy_install kombu

If you have downloaded a source tarball you can install it
by doing the following,:

.. code-block:: console

$ python setup.py build
# python setup.py install # as root


Loading

0 comments on commit acd251e

Please sign in to comment.