Skip to content

Commit

Permalink
Add autodoc skeletons for documentation. (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeeturtle authored and achimnol committed Aug 15, 2017
1 parent c63f72e commit 89f824e
Show file tree
Hide file tree
Showing 15 changed files with 172 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ venv
coverage.xml
docs/_build
.tox
.mypy_cache
5 changes: 5 additions & 0 deletions aiodocker/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async def list(self, **params) -> Dict:
async def get(self, name: str) -> Dict:
"""
Return low-level information about an image
Args:
name: name of the image
"""
Expand All @@ -44,6 +45,7 @@ async def pull(self, from_image: str, *, repo: Optional[str]=None,
tag: Optional[str]=None, stream: bool=False) -> Dict:
"""
Similar to `docker pull`, pull an image locally
Args:
fromImage: name of the image to pull
repo: repository name given to an image when it is imported
Expand Down Expand Up @@ -102,6 +104,7 @@ async def tag(self, name: str, repo: str, *,
tag: Optional[str]=None) -> bool:
"""
Tag the given image so that it becomes part of a repository.
Args:
repo: the repository to tag in
tag: the name for the new tag
Expand All @@ -124,11 +127,13 @@ async def delete(self, name: str, *, force: bool=False,
"""
Remove an image along with any untagged parent
images that were referenced by that image
Args:
name: name/id of the image to delete
force: remove the image even if it is being used
by stopped containers or has other tags
noprune: don't delete untagged parent images
Returns:
List of deleted images
"""
Expand Down
14 changes: 14 additions & 0 deletions docs/client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=======
Client
=======

------------
Reference
------------

Docker
========

.. autoclass:: aiodocker.docker.Docker
:members:
:undoc-members:
9 changes: 8 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# sys.path.insert(0, os.path.abspath('.'))

import os
import sys
import codecs
import re

Expand All @@ -39,6 +40,9 @@
except IndexError:
raise RuntimeError('Unable to determine version.')

_root_path = os.path.abspath(os.path.join(_docs_path, '..'))
sys.path.insert(0, _root_path)


# -- General configuration ------------------------------------------------

Expand All @@ -52,7 +56,10 @@
extensions = ['sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'alabaster',
'sphinxcontrib.asyncio']
'sphinxcontrib.asyncio',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
'sphinx_autodoc_typehints']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down
23 changes: 19 additions & 4 deletions docs/containers.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
============
Containers
============

===============
Containers
===============

Create a container
========================
Expand Down Expand Up @@ -34,3 +33,19 @@ Create a container
loop.run_until_complete(create_container())
loop.close()
------------
Reference
------------

DockerContainers
==================
.. autoclass:: aiodocker.docker.DockerContainers
:members:
:undoc-members:

DockerContainer
==================
.. autoclass:: aiodocker.docker.DockerContainer
:members:
:undoc-members:

14 changes: 14 additions & 0 deletions docs/events.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=======
Events
=======

-----------
Reference
-----------

DockerEvents
=============

.. autoclass:: aiodocker.docker.DockerEvents
:members:
:undoc-members:
14 changes: 14 additions & 0 deletions docs/exceptions.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
===========
Exceptions
===========

----------
Reference
----------

DockerError
============

.. autoclass:: aiodocker.exceptions.DockerError
:members:
:undoc-members:
14 changes: 14 additions & 0 deletions docs/images.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
=======
Images
=======

----------
Reference
----------

DockerImages
=============

.. autoclass:: aiodocker.images.DockerImages
:members:
:undoc-members:
8 changes: 8 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,16 @@ It's *Apache 2* licensed and freely available.
:hidden:
:maxdepth: 2

client
containers
images
services
swarm
volumes
tasks
log
events
exceptions

Indices and tables
==================
Expand Down
14 changes: 14 additions & 0 deletions docs/log.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
====
Log
====

----------
Reference
----------

DockerLog
==========

.. autoclass:: aiodocker.docker.DockerLog
:members:
:undoc-members:
10 changes: 10 additions & 0 deletions docs/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ Create a service
loop.run_until_complete(create_service())
loop.close()
------------
Reference
------------

DockerServices
===============

.. autoclass:: aiodocker.services.DockerServices
:members:
:undoc-members:
14 changes: 14 additions & 0 deletions docs/swarm.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
======
Swarm
======

----------
Reference
----------

DockerSwarm
=============

.. autoclass:: aiodocker.swarm.DockerSwarm
:members:
:undoc-members:
14 changes: 14 additions & 0 deletions docs/tasks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
======
Tasks
======

----------
Reference
----------

DockerTasks
============

.. autoclass:: aiodocker.tasks.DockerTasks
:members:
:undoc-members:
22 changes: 22 additions & 0 deletions docs/volumes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
========
Volumes
========

----------
Reference
----------

DockerVolumes
==============

.. autoclass:: aiodocker.docker.DockerVolumes
:members:
:undoc-members:

DockerVolume
==============

.. autoclass:: aiodocker.docker.DockerVolume
:members:
:undoc-members:

1 change: 1 addition & 0 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx==1.6.3
sphinxcontrib-asyncio==0.2.0
alabaster==0.7.10
sphinx-autodoc-typehints==1.2.1

0 comments on commit 89f824e

Please sign in to comment.