Example #1
0
versions = ["v1beta2", "v1beta3"]

for version in versions:
    library = gapic.py_library(
        service="documentai",
        version=version,
        bazel_target=
        f"//google/cloud/documentai/{version}:documentai-{version}-py",
    )

    excludes = ["README.rst", "nox.py", "docs/index.rst", "setup.py"]
    s.move(library, excludes=excludes)

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(
    cov_level=100,
    microgenerator=True,
    samples=False,  # set to true if there are samples
)
s.move(
    templated_files,
    excludes=[".coveragerc"],  # microgenerator has a good .coveragerc file
)

python.py_samples(skip_readmes=True)

s.shell.run(["nox", "-s", "blacken"], hide_output=False)
Example #2
0
# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(
    samples=True,
    microgenerator=True,
)
s.move(templated_files,
       excludes=[".coveragerc"])  # microgenerator has a good .coveragerc file

# ----------------------------------------------------------------------------
# Samples templates
# ----------------------------------------------------------------------------

python.py_samples()

# Temporarily disable warnings due to
# https://github.com/googleapis/gapic-generator-python/issues/525
s.replace("noxfile.py", '[\"\']-W[\"\']', '# "-W"')

# ----------------------------------------------------------------------------
# Samples templates
# ----------------------------------------------------------------------------

python.py_samples()

# Temporarily disable warnings due to
# https://github.com/googleapis/gapic-generator-python/issues/525
s.replace("noxfile.py", '[\"\']-W[\"\']', '# "-W"')
Example #3
0
        include_protos=True)
    s.move(library / f"google/cloud/securitycenter_{version}")
    s.move(library / f"tests/unit/gapic/{version}")
    s.move(library / f"docs/gapic/{version}")

# Use the highest version library to generate import alias.
s.move(library / "google/cloud/securitycenter.py")

# Fix bad line wrapping in docstring
s.replace(
    "google/**/security_marks_pb2.py",
    """“organizations/\{organization_id\}/assets/\{asset_
\s+id\}/securityMarks” “organizations/\{organization_id\}/sources/\{s
\s+ource_id\}/findings/\{finding_id\}/securityMarks”\.""",
    """``organizations/{organization_id}/assets/{asset_id}/securityMarks``
          ``organizations/{organization_id}/sources/{source_id}/findings/{finding_id}/securityMarks``."""
)

# ----------------------------------------------------------------------------
# Add templated files
# ----------------------------------------------------------------------------
templated_files = common.py_library(cov_level=88, samples=True)
s.move(templated_files)

python.py_samples(root="samples", skip_readmes=True)

# TODO(busunkim): Use latest sphinx after microgenerator transition
s.replace("noxfile.py", """['"]sphinx['"]""", '"sphinx<3.0.0"')

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