From f1fe10b367eafa2f1387c3649d57216b2bc4add8 Mon Sep 17 00:00:00 2001 From: 8ball030 <8baller@station.codes> Date: Fri, 21 Feb 2025 11:07:49 +0000 Subject: [PATCH 1/2] feat:ensured-old-packages-removed --- auto_dev/commands/deps.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/auto_dev/commands/deps.py b/auto_dev/commands/deps.py index 569af06e..60f87ca2 100644 --- a/auto_dev/commands/deps.py +++ b/auto_dev/commands/deps.py @@ -27,6 +27,7 @@ """ +from contextlib import chdir import os import sys import shutil @@ -117,11 +118,11 @@ def from_key_to_path(key: str) -> Path: return Path(*path_list) -def remove_old_package(repo: Path, proposed_dependency_updates: dict[str, str]) -> None: +def remove_old_package(package_path: Path, proposed_dependency_updates: dict[str, str]) -> None: """We remove the old package directories.""" for package_name in proposed_dependency_updates: path = from_key_to_path(package_name) - path = repo / path + breakpoint() if path.exists(): shutil.rmtree(path, ignore_errors=True) @@ -156,7 +157,7 @@ def main( logger.info("Updating the packages json... 📝") update_package_json(repo=child_repo, proposed_dependency_updates=proposed) logger.info("Removing the old packages directories... 🗑") - remove_old_package(repo=child_repo, proposed_dependency_updates=proposed) + remove_old_package(package_path=child_repo, proposed_dependency_updates=proposed) # we now copy the new packages over. logger.info("Copying the new packages over... 📝") for package_name in proposed: @@ -744,7 +745,7 @@ def bump( if not auto_approve: click.confirm("Do you want to update all the packages?\n", abort=True) update_package_json(repo=packages_dir, proposed_dependency_updates=diffs) - remove_old_package(repo=packages_dir, proposed_dependency_updates=diffs) + remove_old_package(package_path=packages_dir, proposed_dependency_updates=diffs) changes.append(dependency.name) else: click.echo("No packages.json file found. Skipping autonomy packages verification.") @@ -831,3 +832,4 @@ def verify(auto_approve: bool = False): if __name__ == "__main__": cli() # pylint: disable=no-value-for-parameter + From f9d161e857e4e8a9248707988ea6b317601a55a8 Mon Sep 17 00:00:00 2001 From: 8ball030 <8baller@station.codes> Date: Fri, 21 Feb 2025 12:03:16 +0000 Subject: [PATCH 2/2] fixed-publish-tests --- auto_dev/commands/deps.py | 4 +--- auto_dev/commands/test.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/auto_dev/commands/deps.py b/auto_dev/commands/deps.py index 60f87ca2..38a351df 100644 --- a/auto_dev/commands/deps.py +++ b/auto_dev/commands/deps.py @@ -27,7 +27,6 @@ """ -from contextlib import chdir import os import sys import shutil @@ -120,9 +119,9 @@ def from_key_to_path(key: str) -> Path: def remove_old_package(package_path: Path, proposed_dependency_updates: dict[str, str]) -> None: """We remove the old package directories.""" + del package_path for package_name in proposed_dependency_updates: path = from_key_to_path(package_name) - breakpoint() if path.exists(): shutil.rmtree(path, ignore_errors=True) @@ -832,4 +831,3 @@ def verify(auto_approve: bool = False): if __name__ == "__main__": cli() # pylint: disable=no-value-for-parameter - diff --git a/auto_dev/commands/test.py b/auto_dev/commands/test.py index 81cac598..4e961b7d 100644 --- a/auto_dev/commands/test.py +++ b/auto_dev/commands/test.py @@ -110,7 +110,7 @@ def test(ctx, path, watch, coverage_report) -> None: raise OperationError(msg) try: - packages = get_packages() if not path else [path] + packages = get_packages() if not path else path.rglob("test_*.py") except FileNotFoundError as error: msg = f"Unable to get packages are you in the right directory? {error}" raise click.ClickException(msg) from error