Skip to content

Commit

Permalink
[Refactor] Rename some variables to make it clear
Browse files Browse the repository at this point in the history
Closes: #23151
Signed-off-by: Chi-Sheng Liu <chishengliu@chishengliu.com>
  • Loading branch information
MortalHappiness committed Sep 25, 2024
1 parent 7dff1c1 commit 2957106
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions python/ray/_private/runtime_env/packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def _zip_files(
) -> None:
"""Zip the target file or directory and write it to the output_path.
filepath: The file or directory to zip.
path_str: The file or directory to zip.
excludes (List(str)): The directories or file to be excluded.
output_path: The output path for the zip file.
include_parent_dir: If true, includes the top-level directory as a
Expand Down Expand Up @@ -572,7 +572,7 @@ def upload_package_to_gcs(pkg_uri: str, pkg_bytes: bytes) -> None:


def create_package(
directory: str,
module_path: str,
target_path: Path,
include_parent_dir: bool = False,
excludes: Optional[List[str]] = None,
Expand All @@ -585,9 +585,9 @@ def create_package(
logger = default_logger

if not target_path.exists():
logger.info(f"Creating a file package for local directory '{directory}'.")
logger.info(f"Creating a file package for local module '{module_path}'.")
_zip_files(
directory,
module_path,
excludes,
str(target_path),
include_parent_dir=include_parent_dir,
Expand All @@ -598,7 +598,7 @@ def create_package(
def upload_package_if_needed(
pkg_uri: str,
base_directory: str,
directory: str,
module_path: str,
include_parent_dir: bool = False,
excludes: Optional[List[str]] = None,
logger: Optional[logging.Logger] = default_logger,
Expand All @@ -613,7 +613,7 @@ def upload_package_if_needed(
Args:
pkg_uri: URI of the package to upload.
base_directory: Directory where package files are stored.
directory: Directory to be uploaded.
module_path: The module to be uploaded, either a single .py file or a directory.
include_parent_dir: If true, includes the top-level directory as a
directory inside the zip file.
excludes: List specifying files to exclude.
Expand Down Expand Up @@ -643,7 +643,7 @@ def upload_package_if_needed(
f"{time.time_ns()}_{os.getpid()}_{package_file.name}"
)
create_package(
directory,
module_path,
package_file,
include_parent_dir=include_parent_dir,
excludes=excludes,
Expand Down

0 comments on commit 2957106

Please sign in to comment.