-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from aws/derebolt
Add tox and githooks
- Loading branch information
Showing
12 changed files
with
203 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[run] | ||
parallel = True | ||
branch = True | ||
source = | ||
aqx | ||
|
||
[paths] | ||
source = | ||
src/aqx | ||
.tox/*/lib/python*/site-packages/aqx | ||
|
||
[report] | ||
show_missing = True | ||
|
||
[html] | ||
directory = build/coverage | ||
|
||
[xml] | ||
output = build/coverage/coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: local | ||
hooks: | ||
- id: tox | ||
name: tox | ||
stages: [push] | ||
language: system | ||
entry: tox | ||
types: [python] | ||
pass_filenames: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line. | ||
SPHINXOPTS = | ||
SPHINXBUILD = python -msphinx | ||
SPHINXPROJ = aqx-ir | ||
SOURCEDIR = . | ||
BUILDDIR = ../build/documentation | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,30 @@ | ||
"""Sphinx configuration.""" | ||
from __future__ import print_function | ||
|
||
import datetime | ||
import os | ||
import shutil | ||
|
||
|
||
def run_apidoc(app): | ||
"""Generate doc stubs using sphinx-apidoc.""" | ||
module_dir = os.path.join(app.srcdir, "../src/aqx") | ||
output_dir = os.path.join(app.srcdir, "_apidoc") | ||
excludes = [] | ||
|
||
# Ensure that any stale apidoc files are cleaned up first. | ||
if os.path.exists(output_dir): | ||
shutil.rmtree(output_dir) | ||
|
||
cmd = [ | ||
"--separate", | ||
"--module-first", | ||
"--doc-project=API Reference", | ||
"--implicit-namespaces", | ||
"-o", | ||
output_dir, | ||
module_dir, | ||
] | ||
cmd.extend(excludes) | ||
|
||
try: | ||
from sphinx.ext import apidoc # Sphinx >= 1.7 | ||
|
||
apidoc.main(cmd) | ||
except ImportError: | ||
from sphinx import apidoc # Sphinx < 1.7 | ||
|
||
cmd.insert(0, apidoc.__file__) | ||
apidoc.main(cmd) | ||
|
||
|
||
def setup(app): | ||
"""Register our sphinx-apidoc hook.""" | ||
app.connect("builder-inited", run_apidoc) | ||
|
||
import pkg_resources | ||
|
||
# Sphinx configuration below. | ||
project = "aqx-ir" | ||
version = "0.1.0" | ||
version = pkg_resources.require(project)[0].version | ||
release = version | ||
copyright = "{}, Amazon.com".format(datetime.datetime.now().year) | ||
|
||
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon", "sphinx.ext.todo"] | ||
extensions = [ | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.napoleon", | ||
"sphinx.ext.todo", | ||
"sphinx.ext.coverage", | ||
] | ||
|
||
source_suffix = ".rst" | ||
master_doc = "index" | ||
|
||
autoclass_content = "class" | ||
autoclass_content = "both" | ||
autodoc_member_order = "bysource" | ||
default_role = "py:obj" | ||
|
||
html_theme = "haiku" | ||
html_theme = "sphinx_rtd_theme" | ||
htmlhelp_basename = "{}doc".format(project) | ||
|
||
napoleon_use_rtype = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[tool.black] | ||
line-length = 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.