diff --git a/translate/noxfile.py b/translate/noxfile.py index 6ee03ef540e0..968fb5a09bf1 100644 --- a/translate/noxfile.py +++ b/translate/noxfile.py @@ -23,6 +23,12 @@ LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) +BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] + +if os.path.exists("samples"): + BLACK_PATHS.append("samples") + + @nox.session(python="3.7") def lint(session): """Run linters. @@ -31,13 +37,7 @@ def lint(session): serious code quality issues. """ session.install("flake8", "black", *LOCAL_DEPS) - session.run( - "black", - "--check", - "google", - "tests", - "docs", - ) + session.run("black", "--check", *BLACK_PATHS) session.run("flake8", "google", "tests") @@ -46,18 +46,13 @@ def blacken(session): """Run black. Format code to uniform standard. - + This currently uses Python 3.6 due to the automated Kokoro run of synthtool. That run uses an image that doesn't have 3.6 installed. Before updating this check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install("black") - session.run( - "black", - "google", - "tests", - "docs", - ) + session.run("black", *BLACK_PATHS) @nox.session(python="3.7") @@ -83,7 +78,7 @@ def default(session): "--cov-append", "--cov-config=.coveragerc", "--cov-report=", - "--cov-fail-under=100", + "--cov-fail-under=0", os.path.join("tests", "unit"), *session.posargs, ) @@ -140,21 +135,24 @@ def cover(session): session.run("coverage", "erase") + @nox.session(python="3.7") def docs(session): """Build the docs for this library.""" - session.install('-e', '.') - session.install('sphinx', 'alabaster', 'recommonmark') + session.install("-e", ".") + session.install("sphinx", "alabaster", "recommonmark") - shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) + 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', ''), + "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", ""), ) diff --git a/translate/synth.metadata b/translate/synth.metadata index 186e2c2df5cd..6b2b6d3835e5 100644 --- a/translate/synth.metadata +++ b/translate/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-06-10T16:41:47.015823Z", + "updateTime": "2019-06-11T12:35:02.295672Z", "sources": [ { "generator": { @@ -12,8 +12,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a12347ec47a7f3d18e35f2effc4295c0b0983213", - "internalRef": "252108410" + "sha": "744feb9660b3194fcde37dea50038bde204f3573", + "internalRef": "252553801" } }, {