Skip to content

Commit b6d8eed

Browse files
authored
test: Add noxfile. (#43)
1 parent e56853e commit b6d8eed

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ tests/data/user-key.json
3434
# Generated files
3535
pylintrc
3636
pylintrc.test
37+
38+
# Virtual environment
39+
env/

noxfile.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import nox
2+
3+
4+
@nox.session(python="3.6")
5+
def cover(session):
6+
session.install("mock", "pytest", "pytest-cov", "futures", "click")
7+
session.install(".")
8+
session.run(
9+
"py.test", "--cov=google_auth_oauthlib", "--cov=tests", "--cov-report=", "tests"
10+
)
11+
session.run("coverage", "report", "--show-missing", "--fail-under=100")
12+
13+
14+
@nox.session(python="3.6")
15+
def docgen(session):
16+
session.env["SPHINX_APIDOC_OPTIONS"] = "members,inherited-members,show-inheritance"
17+
session.install("mock", "pytest", "pytest-cov", "futures", "click", "sphinx")
18+
session.install(".")
19+
session.run("rm", "-rf", "docs/reference")
20+
session.run(
21+
"sphinx-apidoc",
22+
"--output-dir",
23+
"docs/reference",
24+
"--separate",
25+
"--module-first",
26+
"google_auth_oauthlib",
27+
)
28+
29+
30+
@nox.session(python="3.6")
31+
def docs(session):
32+
session.install("sphinx", "-r", "docs/requirements-docs.txt")
33+
session.install(".")
34+
session.run("make", "-C", "docs", "html")
35+
36+
37+
@nox.session(python="3.5")
38+
def lint(session):
39+
session.install(
40+
"flake8",
41+
"flake8-import-order",
42+
"pylint",
43+
"docutils",
44+
"gcp-devrel-py-tools>=0.0.3",
45+
)
46+
session.install(".")
47+
session.run(
48+
"python", "setup.py", "check", "--metadata", "--restructuredtext", "--strict"
49+
)
50+
session.run(
51+
"flake8",
52+
"--import-order-style=google",
53+
"--application-import-names=google_auth_oauthlib,tests",
54+
"google_auth_oauthlib",
55+
"tests",
56+
)
57+
session.run(
58+
"gcp-devrel-py-tools",
59+
"run-pylint",
60+
"--config",
61+
"pylint.config.py",
62+
"--library-filesets",
63+
"google_auth_oauthlib",
64+
"--test-filesets",
65+
"tests",
66+
)
67+
68+
69+
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "pypy"])
70+
def test(session):
71+
session.install("mock", "pytest", "pytest-cov", "futures", "click")
72+
session.install(".")
73+
session.run("py.test", "--cov=google_auth_oauthlib", "--cov=tests", "tests")

0 commit comments

Comments
 (0)