-
Notifications
You must be signed in to change notification settings - Fork 1.7k
chore: update librarian to v0.14.1-0.20260522151051-433d9e6211ad #17235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -509,24 +509,50 @@ def prerelease_deps(session, protobuf_implementation): | |||||||||||||||
| "proto-plus", | ||||||||||||||||
| ] | ||||||||||||||||
|
|
||||||||||||||||
| for dep in prerel_deps: | ||||||||||||||||
| session.install("--pre", "--no-deps", "--ignore-installed", dep) | ||||||||||||||||
| # TODO(https://github.com/grpc/grpc/issues/38965): Add `grpcio-status`` | ||||||||||||||||
| # to the dictionary below once this bug is fixed. | ||||||||||||||||
| # TODO(https://github.com/googleapis/google-cloud-python/issues/13643): Add | ||||||||||||||||
| # `googleapis-common-protos` and `grpc-google-iam-v1` to the dictionary below | ||||||||||||||||
| # once this bug is fixed. | ||||||||||||||||
| package_namespaces = { | ||||||||||||||||
| "google-api-core": "google.api_core", | ||||||||||||||||
| "google-auth": "google.auth", | ||||||||||||||||
| "grpcio": "grpc", | ||||||||||||||||
| "protobuf": "google.protobuf", | ||||||||||||||||
| "proto-plus": "proto", | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| version_namespace = package_namespaces.get(dep) | ||||||||||||||||
|
|
||||||||||||||||
| deps_dir = CURRENT_DIRECTORY.parent | ||||||||||||||||
| while deps_dir.name != "packages" and deps_dir.parent != deps_dir: | ||||||||||||||||
| deps_dir = deps_dir.parent | ||||||||||||||||
|
|
||||||||||||||||
| # Extract the base package name, safely ignoring version bounds and spaces | ||||||||||||||||
| # (e.g., "grpcio>=1.75.1" becomes "grpcio") | ||||||||||||||||
| parsed_deps = { | ||||||||||||||||
| dep: re.match(r"^([a-zA-Z0-9_-]+)", dep).group(1) for dep in prerel_deps | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+518
to
+520
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The re module is used here but does not appear to be imported in this file. This will cause a NameError at runtime. Additionally, re.match(...).group(1) will raise an AttributeError if no match is found. Consider handling the case where no match is found, although the current list of dependencies is safe.
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| # Dynamically sort local packages vs PyPI dependencies | ||||||||||||||||
| local_paths = [] | ||||||||||||||||
| pypi_deps = [] | ||||||||||||||||
|
|
||||||||||||||||
| for dep, pkg_name in parsed_deps.items(): | ||||||||||||||||
| if (deps_dir / pkg_name).exists(): | ||||||||||||||||
| local_paths.append(str(deps_dir / pkg_name)) | ||||||||||||||||
| else: | ||||||||||||||||
| pypi_deps.append(dep) | ||||||||||||||||
|
|
||||||||||||||||
| # Batch pip installations to avoid sequential overhead | ||||||||||||||||
| if local_paths: | ||||||||||||||||
| session.install(*local_paths, "--no-deps", "--ignore-installed") | ||||||||||||||||
| if pypi_deps: | ||||||||||||||||
| session.install(*pypi_deps, "--pre", "--no-deps", "--ignore-installed") | ||||||||||||||||
|
|
||||||||||||||||
| # TODO(https://github.com/grpc/grpc/issues/38965): Add `grpcio-status`` | ||||||||||||||||
| # to the dictionary below once this bug is fixed. | ||||||||||||||||
| # TODO(https://github.com/googleapis/google-cloud-python/issues/13643): Add | ||||||||||||||||
| # `googleapis-common-protos` and `grpc-google-iam-v1` to the dictionary below | ||||||||||||||||
| # once this bug is fixed. | ||||||||||||||||
| package_namespaces = { | ||||||||||||||||
| "google-api-core": "google.api_core", | ||||||||||||||||
| "google-auth": "google.auth", | ||||||||||||||||
| "grpcio": "grpc", | ||||||||||||||||
| "protobuf": "google.protobuf", | ||||||||||||||||
| "proto-plus": "proto", | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| # Reuse the parsed names for logging and version verification | ||||||||||||||||
| for dep, pkg_name in parsed_deps.items(): | ||||||||||||||||
| print(f"Installed {dep}") | ||||||||||||||||
| version_namespace = package_namespaces.get(pkg_name) | ||||||||||||||||
|
|
||||||||||||||||
| if version_namespace: | ||||||||||||||||
| session.run( | ||||||||||||||||
| "python", | ||||||||||||||||
|
|
@@ -596,16 +622,24 @@ def core_deps_from_source(session, protobuf_implementation): | |||||||||||||||
| # Note: If a dependency is added to the `core_dependencies_from_source` list, | ||||||||||||||||
| # the `prerel_deps` list in the `prerelease_deps` nox session should also be updated. | ||||||||||||||||
| core_dependencies_from_source = [ | ||||||||||||||||
| "googleapis-common-protos @ git+https://github.com/googleapis/google-cloud-python#egg=googleapis-common-protos&subdirectory=packages/googleapis-common-protos", | ||||||||||||||||
| "google-api-core @ git+https://github.com/googleapis/google-cloud-python#egg=google-api-core&subdirectory=packages/google-api-core", | ||||||||||||||||
| "google-auth @ git+https://github.com/googleapis/google-cloud-python#egg=google-auth&subdirectory=packages/google-auth", | ||||||||||||||||
| "grpc-google-iam-v1 @ git+https://github.com/googleapis/google-cloud-python#egg=grpc-google-iam-v1&subdirectory=packages/grpc-google-iam-v1", | ||||||||||||||||
| "proto-plus @ git+https://github.com/googleapis/google-cloud-python#egg=proto-plus&subdirectory=packages/proto-plus", | ||||||||||||||||
| "googleapis-common-protos", | ||||||||||||||||
| "google-api-core", | ||||||||||||||||
| "google-auth", | ||||||||||||||||
| "grpc-google-iam-v1", | ||||||||||||||||
| "proto-plus", | ||||||||||||||||
| ] | ||||||||||||||||
|
|
||||||||||||||||
| for dep in core_dependencies_from_source: | ||||||||||||||||
| session.install(dep, "--no-deps", "--ignore-installed") | ||||||||||||||||
| print(f"Installed {dep}") | ||||||||||||||||
| deps_dir = CURRENT_DIRECTORY.parent | ||||||||||||||||
| while deps_dir.name != "packages" and deps_dir.parent != deps_dir: | ||||||||||||||||
| deps_dir = deps_dir.parent | ||||||||||||||||
|
|
||||||||||||||||
| # Batch the pip installation to avoid sequential overhead | ||||||||||||||||
| dep_paths = [str(deps_dir / dep) for dep in core_dependencies_from_source] | ||||||||||||||||
|
|
||||||||||||||||
| session.install(*dep_paths, "--no-deps", "--ignore-installed") | ||||||||||||||||
| print( | ||||||||||||||||
| f"Installed {', '.join(core_dependencies_from_source)} locally from {deps_dir}" | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| session.run( | ||||||||||||||||
| "py.test", | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimum supported Python version is being bumped to 3.10. Please ensure that the project metadata in setup.py (or pyproject.toml) and the Trove classifiers are also updated to reflect this change. Additionally, when dropping support for specific Python versions, prefer a minor version bump over a patch version bump; this maintains the ability to provide patches for the previous minor version for users still requiring the older environment. If this change appears in documentation examples, ensure the current stable Python version is used rather than the minimum supported version.
References