Skip to content

Commit

Permalink
add extra deps and additional docs target to synth
Browse files Browse the repository at this point in the history
  • Loading branch information
crwilcox committed Dec 1, 2018
1 parent 3896ed4 commit 5764a3a
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
23 changes: 23 additions & 0 deletions bigquery_storage/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def default(session):
for local_dep in LOCAL_DEPS:
session.install("-e", local_dep)
session.install("-e", ".")
session.install("-e", "pandas")
session.install("-e", "fastavro")

# Run py.test against the unit tests.
session.run(
Expand Down Expand Up @@ -114,6 +116,8 @@ def system(session):
for local_dep in LOCAL_DEPS:
session.install("-e", local_dep)
session.install("-e", "../test_utils/")
session.install("-e", "pandas")
session.install("-e", "fastavro")
session.install("-e", ".")

# Run py.test against the system tests.
Expand All @@ -134,3 +138,22 @@ def cover(session):
session.run("coverage", "report", "--show-missing", "--fail-under=100")

session.run("coverage", "erase")


@nox.session(python='3.6')
def docs(session):
"""Build the docs."""
session.install('sphinx', 'sphinx_rtd_theme')
session.install('-e', '.[pandas,fastavro]')
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
session.run(
'sphinx-build',
'-W', # warnings as errors
'-T', # show full traceback on exception
'-N', # no colors
'-b', 'html',
'-d', os.path.join('docs', '_build', 'doctrees', ''),
os.path.join('docs', ''),
os.path.join('docs', '_build', 'html', ''),
)

29 changes: 28 additions & 1 deletion bigquery_storage/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,34 @@
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
templated_files = common.py_library(
unit_cov_level=97, cov_level=100,
system_test_dependencies=["pandas", "fastavro"],
unit_test_dependencies=["pandas", "fastavro"],
)
s.move(templated_files)

s.replace(
'noxfile.py',
"session.run\(\"coverage\", \"erase\"\)",
"\g<0>\n\n"
'''
@nox.session(python='3.6')
def docs(session):
"""Build the docs."""
session.install('sphinx', 'sphinx_rtd_theme')
session.install('-e', '.[pandas,fastavro]')
shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True)
session.run(
'sphinx-build',
'-W', # warnings as errors
'-T', # show full traceback on exception
'-N', # no colors
'-b', 'html',
'-d', os.path.join('docs', '_build', 'doctrees', ''),
os.path.join('docs', ''),
os.path.join('docs', '_build', 'html', ''),
)
''')

s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 comments on commit 5764a3a

Please sign in to comment.