Skip to content

Commit 753ef58

Browse files
Nick ZaccardinZac
Nick Zaccardi
authored andcommitted
Create Sphinx Documentation
1 parent aef81c1 commit 753ef58

15 files changed

+226
-3
lines changed

docs/Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.http://sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sphinx
2+
paramiko
3+
../[test]

docs/source/backends/azure.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Azure Block Blob
2+
================
3+
4+
5+
.. autoclass:: keg_storage.backends.azure.AzureStorage
6+
:members:
7+
8+
.. autoclass:: keg_storage.backends.azure.AzureReader
9+
:members:
10+
11+
.. autoclass:: keg_storage.backends.azure.AzureWriter
12+
:members:
13+
14+
.. autoclass:: keg_storage.backends.azure.AzureFile
15+
:members:

docs/source/backends/index.rst

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Backends
2+
========
3+
4+
5+
.. toctree::
6+
:maxdepth: 1
7+
:caption: Supported Backends:
8+
9+
azure
10+
s3
11+
sftp
12+
utils

docs/source/backends/s3.rst

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
S3 Backend
2+
==========
3+
4+
.. autoclass:: keg_storage.backends.s3.S3Storage
5+
:members:
6+
7+
8+
.. autoclass:: keg_storage.backends.s3.S3Reader
9+
:members:
10+
11+
.. autoclass:: keg_storage.backends.s3.S3Writer
12+
:members:
13+
14+
.. autoclass:: keg_storage.backends.s3.S3FileBase
15+
:members:

docs/source/backends/sftp.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
SFTP
2+
====
3+
4+
.. autoclass:: keg_storage.backends.sftp.SFTPRemoteFile
5+
:members:
6+
7+
.. autoclass:: keg_storage.backends.sftp.SFTPStorage
8+
:members:

docs/source/backends/utils.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Utilities
2+
=========
3+
4+
5+
.. autoclass:: keg_storage.backends.base.FileMode
6+
:members:

docs/source/conf.py

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
# import os
14+
# import sys
15+
# sys.path.insert(0, os.path.abspath('.'))
16+
17+
import keg_storage
18+
import datetime as dt
19+
20+
import configparser
21+
22+
23+
# -- Project information -----------------------------------------------------
24+
25+
project = 'Keg-Storage'
26+
copyright = u"{year} Level 12".format(year=dt.datetime.utcnow().year)
27+
28+
29+
cfg = configparser.SafeConfigParser()
30+
cfg.read('../../setup.cfg')
31+
32+
tag = cfg.get('egg_info', 'tag_build')
33+
34+
html_context = {
35+
'prerelease': bool(tag), # True if tag is not the empty string
36+
}
37+
38+
# The full version, including alpha/beta/rc tags.
39+
release = keg_storage.__version__ + tag
40+
41+
42+
# -- General configuration ---------------------------------------------------
43+
44+
# Add any Sphinx extension module names here, as strings. They can be
45+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
46+
# ones.
47+
extensions = [
48+
'sphinx.ext.intersphinx',
49+
'sphinx.ext.autodoc',
50+
'sphinx.ext.viewcode',
51+
]
52+
53+
# Add any paths that contain templates here, relative to this directory.
54+
templates_path = ['_templates']
55+
56+
# List of patterns, relative to source directory, that match files and
57+
# directories to ignore when looking for source files.
58+
# This pattern also affects html_static_path and html_extra_path.
59+
exclude_patterns = []
60+
61+
master_doc = 'index'
62+
63+
64+
# -- Options for HTML output -------------------------------------------------
65+
66+
# The theme to use for HTML and HTML Help pages. See the documentation for
67+
# a list of builtin themes.
68+
#
69+
html_theme = 'alabaster'
70+
71+
html_theme_options = {
72+
'github_user': 'level12',
73+
'github_repo': 'keg-storage',
74+
'github_banner': False,
75+
'github_button': True,
76+
'codecov_button': True,
77+
'extra_nav_links': {
78+
'Level 12': 'https://www.level12.io',
79+
'File an Issue': 'https://github.com/level12/keg-storage/issues/new',
80+
},
81+
'show_powered_by': True
82+
83+
}
84+
85+
# Add any paths that contain custom static files (such as style sheets) here,
86+
# relative to this directory. They are copied after the builtin static files,
87+
# so a file named "default.css" will overwrite the builtin "default.css".
88+
html_static_path = ['_static']

docs/source/index.rst

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Welcome to Keg-Storage
2+
======================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
:caption: Documenation:
7+
8+
backends/index

keg_storage/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from keg_storage.version import __version__ # noqa
12
from importlib.util import find_spec as _find_spec
23

34
if _find_spec('keg'):

keg_storage/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = '0.4.2' # noqa
1+
VERSION = __version__ = '0.4.2'

setup.cfg

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[egg_info]
2+
tag_build =
3+
14
[metadata]
25
description-file=README.rst
36

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@
5656
'mock',
5757
'flake8',
5858
'flask_webtest',
59-
],
59+
]
6060
}
6161
)

tox.ini

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py36,py37,flake8,nokeg
2+
envlist = py36,py37,flake8,nokeg,tox,docs
33

44
[testenv]
55
whitelist_externals = *
@@ -40,5 +40,14 @@ usedevelop = false
4040
deps = flake8
4141
commands = flake8 --max-complexity=15
4242

43+
[testenv:docs]
44+
recreate = false
45+
skip_install = false
46+
changedir = docs
47+
usedevelop = true
48+
commands =
49+
pip install -r requirements.txt
50+
make html
51+
4352
[flake8]
4453
max-line-length = 100

0 commit comments

Comments
 (0)