From b31b36e841d4baa61233903fa73b4bbf0ec49472 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Fri, 16 Feb 2024 14:23:49 -0300 Subject: [PATCH] Update vendored deps. --- .../action_package_handling/__init__.py | 22 ++++++++++++++++--- .../vendored_deps/package_deps/pypi_cloud.py | 3 ++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/robocorp-code/src/robocorp_code/vendored_deps/action_package_handling/__init__.py b/robocorp-code/src/robocorp_code/vendored_deps/action_package_handling/__init__.py index f70a105bcd..3e99f01980 100644 --- a/robocorp-code/src/robocorp_code/vendored_deps/action_package_handling/__init__.py +++ b/robocorp-code/src/robocorp_code/vendored_deps/action_package_handling/__init__.py @@ -202,16 +202,32 @@ def _create_package_from_conda_yaml( else: target.write_text(output, encoding="utf-8") + # Remove conda.yaml if backup: - new_path = conda_yaml.parent / (conda_yaml.name + ".bak") - print(f"Renaming {conda_yaml.name} to {new_path.name}", file=stream) + new_conda_yaml_path = conda_yaml.parent / (conda_yaml.name + ".bak") + print(f"Renaming {conda_yaml.name} to {new_conda_yaml_path.name}", file=stream) if not dry_run: - conda_yaml.rename(new_path) + conda_yaml.rename(new_conda_yaml_path) else: print(f"Removing {conda_yaml.name}", file=stream) if not dry_run: os.remove(conda_yaml) + # Remove robot.yaml + robot_yaml = conda_yaml.parent / "robot.yaml" + if robot_yaml.exists(): + if backup: + new_robot_yaml_path = robot_yaml.parent / (robot_yaml.name + ".bak") + print( + f"Renaming {robot_yaml.name} to {new_robot_yaml_path.name}", file=stream + ) + if not dry_run: + robot_yaml.rename(new_robot_yaml_path) + else: + print(f"Removing {robot_yaml.name}", file=stream) + if not dry_run: + os.remove(robot_yaml) + def update_package( cwd: Path, dry_run: bool, backup: bool = True, *, stream=None diff --git a/robocorp-code/src/robocorp_code/vendored_deps/package_deps/pypi_cloud.py b/robocorp-code/src/robocorp_code/vendored_deps/package_deps/pypi_cloud.py index 2fd96c906a..00d1d2eb59 100644 --- a/robocorp-code/src/robocorp_code/vendored_deps/package_deps/pypi_cloud.py +++ b/robocorp-code/src/robocorp_code/vendored_deps/package_deps/pypi_cloud.py @@ -4,7 +4,8 @@ import weakref from typing import Dict, Iterator, List, Optional, Sequence, Union -from ._deps_protocols import PyPiInfoTypedDict, ReleaseData, Versions, VersionStr +from ._deps_protocols import (PyPiInfoTypedDict, ReleaseData, Versions, + VersionStr) log = logging.getLogger(__name__)