Small cleanup of mypy warnings
This commit is contained in:
parent
f6b99fd888
commit
5c660e5652
1 changed files with 4 additions and 2 deletions
|
@ -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...")
|
||||
|
|
Loading…
Reference in a new issue