Skip to content

Commit e11a75a

Browse files
authored
chore: updates blacken process to ensure all samples are processed (#1367)
1 parent 2c57533 commit e11a75a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

noxfile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@
2525
MYPY_VERSION = "mypy==0.910"
2626
PYTYPE_VERSION = "pytype==2021.4.9"
2727
BLACK_VERSION = "black==22.3.0"
28-
BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py")
28+
BLACK_PATHS = (
29+
"docs",
30+
"google",
31+
"samples",
32+
"samples/tests",
33+
"tests",
34+
"noxfile.py",
35+
"setup.py",
36+
)
2937

3038
DEFAULT_PYTHON_VERSION = "3.8"
3139
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8", "3.10"]

owlbot.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@
1313
# limitations under the License.
1414

1515
"""This script is used to synthesize generated parts of this library."""
16+
from pathlib import Path
1617
import textwrap
1718

1819
import synthtool as s
1920
from synthtool import gcp
2021
from synthtool.languages import python
2122

23+
REPO_ROOT = Path(__file__).parent.absolute()
24+
2225
default_version = "v2"
2326

2427
for library in s.get_staging_dirs(default_version):
@@ -120,4 +123,6 @@
120123
),
121124
)
122125

123-
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
126+
# s.shell.run(["nox", "-s", "blacken"], hide_output=False)
127+
for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"):
128+
s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False)

0 commit comments

Comments
 (0)