@@ -106,7 +106,12 @@ def python_notebooks_testing_pipeline() -> None:
106
106
s .copy ([NOTEBOOK_TEMPLATE_PATH ], excludes = excludes )
107
107
108
108
109
- def py_samples (* , root : PathOrStr = None , skip_readmes : bool = False ) -> None :
109
+ def py_samples (
110
+ * ,
111
+ root : PathOrStr = None ,
112
+ skip_readmes : bool = False ,
113
+ files_to_exclude : List [str ] = [],
114
+ ) -> None :
110
115
"""
111
116
Find all samples projects and render templates.
112
117
Samples projects always have a 'requirements.txt' file and may also have
@@ -115,6 +120,7 @@ def py_samples(*, root: PathOrStr = None, skip_readmes: bool = False) -> None:
115
120
Args:
116
121
root (Union[Path, str]): The samples directory root.
117
122
skip_readmes (bool): If true, do not generate readmes.
123
+ files_to_exclude(List[str]): defaults to empty, but if present, adds files to excludes list
118
124
"""
119
125
in_client_library = Path ("samples" ).exists () and Path ("setup.py" ).exists ()
120
126
if root is None :
@@ -123,7 +129,7 @@ def py_samples(*, root: PathOrStr = None, skip_readmes: bool = False) -> None:
123
129
else :
124
130
root = "."
125
131
126
- excludes = []
132
+ excludes = files_to_exclude
127
133
128
134
# todo(kolea2): temporary exclusion until samples are ready to be migrated to new format
129
135
excludes .append ("README.md" )
@@ -142,8 +148,7 @@ def py_samples(*, root: PathOrStr = None, skip_readmes: bool = False) -> None:
142
148
sample_project_dir = req .parent
143
149
log .info (f"Generating templates for samples project '{ sample_project_dir } '" )
144
150
145
- excludes = ["**/*tmpl*" ] # .tmpl. files are partial templates
146
-
151
+ excludes .append ("**/*tmpl*" ) # .tmpl. files are partial templates
147
152
sample_readme_metadata : Dict [str , Any ] = {}
148
153
if not skip_readmes :
149
154
sample_readme_metadata = _get_sample_readme_metadata (sample_project_dir )
0 commit comments