Skip to content

Commit da0e6d0

Browse files
chore(python): remove noxfile.py from templates (#1383)
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <[email protected]>
1 parent be90054 commit da0e6d0

File tree

2 files changed

+3
-93
lines changed

2 files changed

+3
-93
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:5581906b957284864632cde4e9c51d1cc66b0094990b27e689132fe5cd036046
17-
# created: 2025-03-05
16+
digest: sha256:25de45b58e52021d3a24a6273964371a97a4efeefe6ad3845a64e697c63b6447
17+
# created: 2025-04-14T14:34:43.260858345Z

owlbot.py

Lines changed: 1 addition & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
if count < 1:
327327
raise Exception(".coveragerc replacement failed.")
328328

329-
s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"])
329+
s.move([library], excludes=["**/gapic_version.py", "noxfile.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"])
330330
s.remove_staging_dirs()
331331

332332
# ----------------------------------------------------------------------------
@@ -345,96 +345,6 @@
345345
)
346346
s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml", "README.rst", "docs/index.rst"])
347347

348-
# ----------------------------------------------------------------------------
349-
# Add mypy nox session.
350-
# ----------------------------------------------------------------------------
351-
s.replace(
352-
"noxfile.py",
353-
r"LINT_PATHS = \[.*?\]",
354-
'\g<0>\n\nMYPY_VERSION = "mypy==1.10.0"',
355-
)
356-
s.replace(
357-
"noxfile.py", r'"blacken",', '\g<0>\n "mypy",',
358-
)
359-
s.replace(
360-
"noxfile.py",
361-
r"nox\.options\.error_on_missing_interpreters = True",
362-
textwrap.dedent(
363-
''' \g<0>
364-
365-
366-
@nox.session(python=DEFAULT_PYTHON_VERSION)
367-
def mypy(session):
368-
"""Run type checks with mypy."""
369-
session.install("-e", ".[all]")
370-
session.install(MYPY_VERSION)
371-
372-
# Version 2.1.1 of google-api-core version is the first type-checked release.
373-
# Version 2.2.0 of google-cloud-core version is the first type-checked release.
374-
session.install(
375-
"google-api-core[grpc]>=2.1.1",
376-
"google-cloud-core>=2.2.0",
377-
)
378-
379-
# Just install the type info directly, since "mypy --install-types" might
380-
# require an additional pass.
381-
# Exclude types-protobuf==4.24.0.20240106
382-
# See https://github.com/python/typeshed/issues/11254
383-
session.install("types-protobuf!=4.24.0.20240106", "types-setuptools")
384-
385-
# TODO: Only check the hand-written layer, the generated code does not pass
386-
# mypy checks yet.
387-
# https://github.com/googleapis/gapic-generator-python/issues/1092
388-
session.run("mypy", "-p", "google.cloud")'''
389-
),
390-
)
391-
392-
393-
# ----------------------------------------------------------------------------
394-
# Add mypy_samples nox session.
395-
# ----------------------------------------------------------------------------
396-
s.replace(
397-
"noxfile.py",
398-
r' "mypy",',
399-
'\g<0>\n # https://github.com/googleapis/python-pubsub/pull/552#issuecomment-1016256936'
400-
'\n # "mypy_samples", # TODO: uncomment when the check passes',
401-
)
402-
s.replace(
403-
"noxfile.py",
404-
r'session\.run\("mypy", "-p", "google.cloud"\)',
405-
textwrap.dedent(
406-
''' \g<0>
407-
408-
409-
@nox.session(python=DEFAULT_PYTHON_VERSION)
410-
def mypy_samples(session):
411-
"""Run type checks with mypy."""
412-
413-
session.install("-e", ".[all]")
414-
415-
session.install("pytest")
416-
session.install(MYPY_VERSION)
417-
418-
# Just install the type info directly, since "mypy --install-types" might
419-
# require an additional pass.
420-
session.install("types-mock", "types-protobuf", "types-setuptools")
421-
422-
session.run(
423-
"mypy",
424-
"--config-file",
425-
str(CURRENT_DIRECTORY / "samples" / "snippets" / "mypy.ini"),
426-
"--no-incremental", # Required by warn-unused-configs from mypy.ini to work
427-
"samples/",
428-
)'''
429-
),
430-
)
431-
432-
433-
# Only consider the hand-written layer when assessing the test coverage.
434-
s.replace(
435-
"noxfile.py", "--cov=google", "--cov=google/cloud",
436-
)
437-
438348
s.replace(".github/blunderbuss.yml", "googleapis/api-pubsub", "mukund-ananthu")
439349

440350
python.py_samples(skip_readmes=True)

0 commit comments

Comments
 (0)