From 5c660e5652feca2e014ca6dfd07196e9d26a472e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 8 Feb 2024 23:09:11 +0100 Subject: [PATCH] Small cleanup of mypy warnings --- update_app_levels/update_app_levels.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update_app_levels/update_app_levels.py b/update_app_levels/update_app_levels.py index 3164739..c99b152 100755 --- a/update_app_levels/update_app_levels.py +++ b/update_app_levels/update_app_levels.py @@ -187,9 +187,11 @@ def main(): with tempfile.TemporaryDirectory(prefix="update_app_levels_") as tmpdir: logging.info("Cloning the repository...") apps_repo = Repo.clone_from(f"git@github.com:{APPS_REPO}", to_path=tmpdir) + assert apps_repo.working_tree_dir is not None + apps_toml_path = Path(apps_repo.working_tree_dir) / "apps.toml" # Load the app catalog and filter out the non-working ones - catalog = toml.load((Path(apps_repo.working_tree_dir) / "apps.toml").open("r", encoding="utf-8")) + catalog = toml.load(apps_toml_path.open("r", encoding="utf-8")) new_branch = apps_repo.create_head("update_app_levels", apps_repo.refs.master) apps_repo.head.reference = new_branch @@ -205,7 +207,7 @@ def main(): # Save the new catalog updated_catalog = toml.dumps(catalog) updated_catalog = updated_catalog.replace(",]", " ]") - (Path(apps_repo.working_tree_dir) / "apps.toml").open("w", encoding="utf-8").write(updated_catalog) + apps_toml_path.open("w", encoding="utf-8").write(updated_catalog) if args.commit: logging.info("Committing and pushing the new catalog...")