@@ -1238,42 +1238,40 @@ def _create_base64_encoded_tarball(
12381238 return base64 .b64encode (tarball_bytes ).decode ("utf-8" )
12391239
12401240
1241- def _validate_extra_packages_or_raise (
1241+ def _validate_packages_or_raise (
12421242 * ,
1243- extra_packages : Sequence [str ],
1243+ packages : Sequence [str ],
12441244 build_options : Optional [Dict [str , Sequence [str ]]] = None ,
12451245) -> Sequence [str ]:
1246- """Tries to validates the extra packages."""
1247- extra_packages = extra_packages or []
1246+ """Tries to validates the packages."""
1247+ packages = packages or []
12481248 if build_options and _INSTALLATION_SUBDIR in build_options :
12491249 _validate_installation_scripts_or_raise (
12501250 script_paths = build_options [_INSTALLATION_SUBDIR ],
1251- extra_packages = extra_packages ,
1251+ packages = packages ,
12521252 )
1253- for extra_package in extra_packages :
1254- if not os .path .exists (extra_package ):
1255- raise FileNotFoundError (
1256- f"Extra package specified but not found: { extra_package = } "
1257- )
1258- return extra_packages
1253+ for package in packages :
1254+ if not os .path .exists (package ):
1255+ raise FileNotFoundError (f"Package specified but not found: { package = } " )
1256+ return packages
12591257
12601258
12611259def _validate_installation_scripts_or_raise (
12621260 * ,
12631261 script_paths : Sequence [str ],
1264- extra_packages : Sequence [str ],
1262+ packages : Sequence [str ],
12651263) -> None :
12661264 """Validates the installation scripts' path explicitly provided by the user.
12671265
12681266 Args:
12691267 script_paths (Sequence[str]):
12701268 Required. The paths to the installation scripts.
1271- extra_packages (Sequence[str]):
1272- Required. The extra packages to be updated .
1269+ packages (Sequence[str]):
1270+ Required. The user-provided packages.
12731271
12741272 Raises:
12751273 ValueError: If a user-defined script is not under the expected
1276- subdirectory, or not in `extra_packages `, or if an extra package is
1274+ subdirectory, or not in `packages `, or if a package is
12771275 in the installation scripts subdirectory, but is not specified as an
12781276 installation script.
12791277 """
@@ -1283,37 +1281,35 @@ def _validate_installation_scripts_or_raise(
12831281 f"User-defined installation script '{ script_path } ' is not in "
12841282 f"the expected '{ _INSTALLATION_SUBDIR } ' subdirectory. "
12851283 f"Ensure it is placed in '{ _INSTALLATION_SUBDIR } ' within your "
1286- f"` extra_packages` ."
1284+ f"' extra_packages' or 'source_packages' ."
12871285 )
12881286 raise ValueError (
12891287 f"Required installation script '{ script_path } ' "
12901288 f"is not under '{ _INSTALLATION_SUBDIR } '"
12911289 )
12921290
1293- if script_path not in extra_packages :
1291+ if script_path not in packages :
12941292 logger .warning (
12951293 f"User-defined installation script '{ script_path } ' is not in "
1296- f"extra_packages. Ensure it is added to `extra_packages`."
1294+ f"'extra_packages' or 'source_packages'. Ensure it is added to "
1295+ f"'extra_packages' or 'source_packages'."
12971296 )
12981297 raise ValueError (
12991298 f"User-defined installation script '{ script_path } ' "
1300- f"does not exist in ` extra_packages` "
1299+ f"does not exist in ' extra_packages' or 'source_packages'. "
13011300 )
13021301
1303- for extra_package in extra_packages :
1304- if (
1305- extra_package .startswith (_INSTALLATION_SUBDIR )
1306- and extra_package not in script_paths
1307- ):
1302+ for package in packages :
1303+ if package .startswith (_INSTALLATION_SUBDIR ) and package not in script_paths :
13081304 logger .warning (
1309- f"Extra package ' { extra_package } ' is in the installation "
1305+ f"Package ' { package } ' is in the installation "
13101306 "scripts subdirectory, but is not specified as an installation "
13111307 "script in `build_options`. "
13121308 "Ensure it is added to installation_scripts for "
13131309 "automatic execution."
13141310 )
13151311 raise ValueError (
1316- f"Extra package ' { extra_package } ' is in the installation "
1312+ f"Package ' { package } ' is in the installation "
13171313 "scripts subdirectory, but is not specified as an installation "
13181314 "script in `build_options`."
13191315 )
0 commit comments