Skip to content

Commit e10673d

Browse files
authored
chore(librarian): resolve issue where version file would not be updated in proto-only library (#14675)
This is a fast-follow fix to #14674 to address an incorrect assumption that `Path().rglob` would be empty if no matches were found. We need to explicitly convert the result to a list and check the length of the results.
1 parent 5244589 commit e10673d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.generator/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,8 +1092,8 @@ def _update_version_for_library(
10921092
"""
10931093

10941094
# Find and update gapic_version.py files
1095-
version_files = Path(f"{repo}/{path_to_library}").rglob("**/gapic_version.py")
1096-
if not version_files:
1095+
version_files = list(Path(f"{repo}/{path_to_library}").rglob("**/gapic_version.py"))
1096+
if len(version_files) == 0:
10971097
# Fallback to `pyproject.toml`` or `setup.py``. Proto-only libraries have
10981098
# version information in `setup.py` or `pyproject.toml` instead of `gapic_version.py`.
10991099
pyproject_toml = Path(f"{repo}/{path_to_library}/pyproject.toml")

0 commit comments

Comments
 (0)