From 0813b53fd3de9a986a94e26aafd5c927ba4b9301 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Thu, 9 Jan 2025 13:25:44 +0200 Subject: [PATCH] hotfix: rename ihp-sg13g2, replace `-` with `_` Multiple dashes in a release name break `ls-remote` in every previous version of Volare. --- pyproject.toml | 2 +- volare/build/{ihp-sg13g2.py => ihp_sg13g2.py} | 22 ++++++++++--------- volare/families.py | 6 ++--- 3 files changed, 16 insertions(+), 14 deletions(-) rename volare/build/{ihp-sg13g2.py => ihp_sg13g2.py} (85%) diff --git a/pyproject.toml b/pyproject.toml index be060da..ad83594 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "volare" -version = "0.20.3" +version = "0.20.4" description = "An PDK builder/version manager for PDKs in the open_pdks format" authors = ["Efabless Corporation and Contributors "] readme = "Readme.md" diff --git a/volare/build/ihp-sg13g2.py b/volare/build/ihp_sg13g2.py similarity index 85% rename from volare/build/ihp-sg13g2.py rename to volare/build/ihp_sg13g2.py index 1ab312f..10fa324 100644 --- a/volare/build/ihp-sg13g2.py +++ b/volare/build/ihp_sg13g2.py @@ -48,10 +48,10 @@ def get_ihp( version, ) repo = ihp_future.result() - current_task = progress.add_task( - "Updating submodules…", total=100 + current_task = progress.add_task("Updating submodules…", total=100) + repo.init_submodule( + callback=lambda x: progress.update(current_task, completed=x) ) - repo.init_submodule(callback=lambda x: progress.update(current_task, completed=x)) repo_path = repo.path console.log(f"Done fetching {ihp_repo.name}.") else: @@ -68,22 +68,24 @@ def get_ihp( def build_ihp(build_directory, ihp_path): # """Build""" try: - shutil.rmtree(os.path.join(build_directory, "ihp-sg13g2")) + shutil.rmtree(os.path.join(build_directory, "ihp_sg13g2")) except FileNotFoundError: pass shutil.copytree( os.path.join(ihp_path, "ihp-sg13g2"), - os.path.join(build_directory, "ihp-sg13g2"), - ignore=lambda dir, files: files if ".git" in os.path.split(dir) else [".git", ".DS_Store"] + os.path.join(build_directory, "ihp_sg13g2"), + ignore=lambda dir, files: ( + files if ".git" in os.path.split(dir) else [".git", ".DS_Store"] + ), ) def install_ihp(build_directory, pdk_root, version): console = Console() with console.status("Adding build to list of installed versions…"): - ihp_sg13g2_family = Family.by_name["ihp-sg13g2"] + ihp_sg13g2_family = Family.by_name["ihp_sg13g2"] - version_directory = Version(version, "ihp-sg13g2").get_dir(pdk_root) + version_directory = Version(version, "ihp_sg13g2").get_dir(pdk_root) if ( os.path.exists(version_directory) and len(os.listdir(version_directory)) != 0 @@ -92,7 +94,7 @@ def install_ihp(build_directory, pdk_root, version): it = 0 while os.path.exists(backup_path) and len(os.listdir(backup_path)) != 0: it += 1 - backup_path = Version(f"{version}.bk{it}", "ihp-sg13g2").get_dir( + backup_path = Version(f"{version}.bk{it}", "ihp_sg13g2").get_dir( pdk_root ) console.log( @@ -130,7 +132,7 @@ def build( using_repos = {} build_directory = os.path.join( - get_volare_dir(pdk_root, "ihp-sg13g2"), "build", version + get_volare_dir(pdk_root, "ihp_sg13g2"), "build", version ) timestamp = datetime.now().strftime("build_ihp-sg13g2-%Y-%m-%d-%H-%M-%S") log_dir = os.path.join(build_directory, "logs", timestamp) diff --git a/volare/families.py b/volare/families.py index c23fa8a..003a40f 100644 --- a/volare/families.py +++ b/volare/families.py @@ -106,9 +106,9 @@ def resolve_libraries( ], repo=opdks_repo, ) -Family.by_name["ihp-sg13g2"] = Family( - name="ihp-sg13g2", - variants=["ihp-sg13g2"], +Family.by_name["ihp_sg13g2"] = Family( + name="ihp_sg13g2", + variants=["ihp_sg13g2"], all_libraries=[ "sg13g2_io", "sg13g2_pr",