diff --git a/requirements/dev.txt b/requirements/dev.txt index 4989ba5..fe832d4 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -24,3 +24,5 @@ isort==4.2.15 lazy-object-proxy==1.3.1 pylint==1.7.4 wrapt==1.10.11 +pydocstyle==2.1.1 +snowballstemmer==1.2.1 diff --git a/src/__init__.py b/src/__init__.py index e69de29..cbe7d74 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -0,0 +1 @@ +"""Source code for pgtq.""" diff --git a/src/pgtq.py b/src/pgtq.py index a5a1fb9..4f6b18f 100644 --- a/src/pgtq.py +++ b/src/pgtq.py @@ -1,4 +1,4 @@ -"""A task queue""" +"""A task queue.""" import select import psycopg2.extras import handler diff --git a/src/worker.py b/src/worker.py index 9dde3a6..b75f2d8 100644 --- a/src/worker.py +++ b/src/worker.py @@ -31,11 +31,11 @@ def poll_loop(queue): def main_loop(queue): """Continually fetch and handle tasks from the given queue. - Starts by polling for tasks in a tight loop. If no tasks arrive - for MAX_POLLING_IDLE_TIME, go to sleep until notified by the - database that another task is ready. + Starts by polling for tasks in a tight loop. If no tasks arrive + for MAX_POLLING_IDLE_TIME, go to sleep until notified by the + database that another task is ready. - This function does not return. + This function does not return. """ while True: try: diff --git a/tox.ini b/tox.ini index 7b2fd56..7151ec7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,flake8,pylint +envlist = py35,flake8,pylint,pydocstyle skipsdist = True [coverage:run] @@ -17,6 +17,12 @@ deps = -rrequirements/common.txt -rrequirements/dev.txt commands=flake8 src tests +[testenv:pydocstyle] +basepython=python +deps = -rrequirements/common.txt + -rrequirements/dev.txt +commands=pydocstyle src tests + [testenv:pylint] basepython=python deps = -rrequirements/common.txt