File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -1199,7 +1199,8 @@ def _update_version_for_library(
11991199
12001200 # Find and update version.py or gapic_version.py files
12011201 search_base = Path (f"{ repo } /{ path_to_library } " )
1202- version_files = list (search_base .rglob ("**/gapic_version.py" ))
1202+ version_files = []
1203+ patterns = ["**/gapic_version.py" , "**/version.py" ]
12031204 excluded_dirs = {
12041205 ".nox" ,
12051206 ".venv" ,
@@ -1209,14 +1210,16 @@ def _update_version_for_library(
12091210 "build" ,
12101211 "dist" ,
12111212 "__pycache__" ,
1213+ "tests" ,
12121214 }
1213- version_files .extend (
1214- [
1215- p
1216- for p in search_base .rglob ("**/version.py" )
1217- if not any (part in excluded_dirs for part in p .parts )
1218- ]
1219- )
1215+ for pattern in patterns :
1216+ version_files .extend (
1217+ [
1218+ p
1219+ for p in search_base .rglob (pattern )
1220+ if not any (part in excluded_dirs for part in p .parts )
1221+ ]
1222+ )
12201223
12211224 if not version_files :
12221225 # Fallback to `pyproject.toml`` or `setup.py``. Proto-only libraries have
@@ -1238,8 +1241,8 @@ def _update_version_for_library(
12381241 _write_text_file (output_path , updated_content )
12391242
12401243 # Find and update snippet_metadata.json files
1241- snippet_metadata_files = Path (f"{ repo } /{ path_to_library } " ).rglob (
1242- "samples/ **/*snippet*.json"
1244+ snippet_metadata_files = Path (f"{ repo } /{ path_to_library } /samples " ).rglob (
1245+ "**/*snippet*.json"
12431246 )
12441247 for metadata_file in snippet_metadata_files :
12451248 output_path = f"{ output } /{ metadata_file .relative_to (repo )} "
You can’t perform that action at this time.
0 commit comments