Skip to content

Commit 5eab435

Browse files
committed
chore: propagate import_profile nox session across all packages and goldens
1 parent da118aa commit 5eab435

290 files changed

Lines changed: 2778 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/bigframes/noxfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,3 +1092,19 @@ def mypy(session):
10921092
"--explicit-package-bases",
10931093
'--exclude="^third_party"',
10941094
)
1095+
1096+
1097+
@nox.session(python="3.15")
1098+
def import_profile(session):
1099+
"""Ensure import times remain below defined thresholds."""
1100+
session.install(".")
1101+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
1102+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")
1103+
1104+
1105+
@nox.session(python="3.15")
1106+
def import_profile(session):
1107+
"""Ensure import times remain below defined thresholds."""
1108+
session.install(".")
1109+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
1110+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")

packages/bigquery-magics/noxfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,3 +546,19 @@ def mypy(session):
546546
# TODO(https://github.com/googleapis/google-cloud-python/issues/16014):
547547
# Add mypy tests
548548
session.skip("mypy tests are not yet supported")
549+
550+
551+
@nox.session(python="3.15")
552+
def import_profile(session):
553+
"""Ensure import times remain below defined thresholds."""
554+
session.install(".")
555+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
556+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")
557+
558+
559+
@nox.session(python="3.15")
560+
def import_profile(session):
561+
"""Ensure import times remain below defined thresholds."""
562+
session.install(".")
563+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
564+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")

packages/db-dtypes/noxfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,3 +547,19 @@ def mypy(session):
547547
"--ignore-missing-imports",
548548
*session.posargs,
549549
)
550+
551+
552+
@nox.session(python="3.15")
553+
def import_profile(session):
554+
"""Ensure import times remain below defined thresholds."""
555+
session.install(".")
556+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
557+
session.run("python", profiler_script, "--module", "db_dtypes", "--iterations", "10")
558+
559+
560+
@nox.session(python="3.15")
561+
def import_profile(session):
562+
"""Ensure import times remain below defined thresholds."""
563+
session.install(".")
564+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
565+
session.run("python", profiler_script, "--module", "db_dtypes", "--iterations", "10")

packages/django-google-spanner/noxfile.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,3 +491,19 @@ def format(session: nox.sessions.Session) -> None:
491491
"--line-length=88", # Standard Black line length
492492
*LINT_PATHS,
493493
)
494+
495+
496+
@nox.session(python="3.15")
497+
def import_profile(session):
498+
"""Ensure import times remain below defined thresholds."""
499+
session.install(".")
500+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
501+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")
502+
503+
504+
@nox.session(python="3.15")
505+
def import_profile(session):
506+
"""Ensure import times remain below defined thresholds."""
507+
session.install(".")
508+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
509+
session.run("python", profiler_script, "--module", "unknown_module", "--iterations", "10")

packages/gapic-generator/noxfile.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,4 +847,19 @@ def core_deps_from_source(session, protobuf_implementation):
847847
"""Run all tests with core dependencies installed from source."""
848848
# TODO(https://github.com/googleapis/google-cloud-python/issues/16185):
849849
# Implement logic to install core packages directly from the mono-repo directories.
850-
session.skip("core_deps_from_source session is not yet implemented for gapic-generator-python.")
850+
session.skip("core_deps_from_source session is not yet implemented for gapic-generator-python.")
851+
852+
@nox.session(python="3.15")
853+
def import_profile(session):
854+
"""Ensure import times remain below defined thresholds."""
855+
session.install(".")
856+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
857+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")
858+
859+
860+
@nox.session(python="3.15")
861+
def import_profile(session):
862+
"""Ensure import times remain below defined thresholds."""
863+
session.install(".")
864+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
865+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

packages/gapic-generator/tests/integration/goldens/asset/noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"lint_setup_py",
9494
"blacken",
9595
"docs",
96+
"import_profile",
9697
]
9798

9899
# Error if a python version is missing
@@ -633,3 +634,11 @@ def core_deps_from_source(session, protobuf_implementation):
633634
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
634635
},
635636
)
637+
638+
639+
@nox.session(python="3.15")
640+
def import_profile(session):
641+
"""Ensure import times remain below defined thresholds."""
642+
session.install(".")
643+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
644+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

packages/gapic-generator/tests/integration/goldens/credentials/noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"lint_setup_py",
9494
"blacken",
9595
"docs",
96+
"import_profile",
9697
]
9798

9899
# Error if a python version is missing
@@ -633,3 +634,11 @@ def core_deps_from_source(session, protobuf_implementation):
633634
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
634635
},
635636
)
637+
638+
639+
@nox.session(python="3.15")
640+
def import_profile(session):
641+
"""Ensure import times remain below defined thresholds."""
642+
session.install(".")
643+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
644+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

packages/gapic-generator/tests/integration/goldens/eventarc/noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"lint_setup_py",
9494
"blacken",
9595
"docs",
96+
"import_profile",
9697
]
9798

9899
# Error if a python version is missing
@@ -633,3 +634,11 @@ def core_deps_from_source(session, protobuf_implementation):
633634
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
634635
},
635636
)
637+
638+
639+
@nox.session(python="3.15")
640+
def import_profile(session):
641+
"""Ensure import times remain below defined thresholds."""
642+
session.install(".")
643+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
644+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

packages/gapic-generator/tests/integration/goldens/logging/noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"lint_setup_py",
9494
"blacken",
9595
"docs",
96+
"import_profile",
9697
]
9798

9899
# Error if a python version is missing
@@ -633,3 +634,11 @@ def core_deps_from_source(session, protobuf_implementation):
633634
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
634635
},
635636
)
637+
638+
639+
@nox.session(python="3.15")
640+
def import_profile(session):
641+
"""Ensure import times remain below defined thresholds."""
642+
session.install(".")
643+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
644+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

packages/gapic-generator/tests/integration/goldens/logging_internal/noxfile.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"lint_setup_py",
9494
"blacken",
9595
"docs",
96+
"import_profile",
9697
]
9798

9899
# Error if a python version is missing
@@ -633,3 +634,11 @@ def core_deps_from_source(session, protobuf_implementation):
633634
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
634635
},
635636
)
637+
638+
639+
@nox.session(python="3.15")
640+
def import_profile(session):
641+
"""Ensure import times remain below defined thresholds."""
642+
session.install(".")
643+
profiler_script = os.path.join(CURRENT_DIRECTORY.parent.parent, "scripts", "import_profiler", "profiler.py")
644+
session.run("python", profiler_script, "--module", "google", "--iterations", "10")

0 commit comments

Comments
 (0)