File size: 1,122 Bytes
065fee7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import synthtool as s
from synthtool import gcp

common = gcp.CommonTemplates()

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(
    microgenerator=True,
    cov_level=99,
    unit_test_external_dependencies=["click"],
    unit_test_python_versions=["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"],
)
s.move(templated_files, excludes=[
    "docs/multiprocessing.rst",
    "README.rst",
    ".github/workflows/unittest.yml" #remove this exclusion when removing 3.6 from unit test
])

# Change black paths
s.replace(
    "noxfile.py",
    """LINT_PATHS =.*""",
    """LINT_PATHS = ["docs", "google_auth_oauthlib", "tests", "noxfile.py", "setup.py"]""",
)

# Change flake8 paths
s.replace(
    "noxfile.py",
    'session.run\("flake8", "google", "tests"\)',
    'session.run("flake8", *LINT_PATHS)',
)

s.replace(
    "noxfile.py",
    '"--cov=google",',
    '"--cov=google_auth_oauthlib",',
)

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