From 62c8ce6e18ba03eee3281fd5f769708dae56f0be Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Mon, 27 Mar 2023 12:31:39 -0500 Subject: [PATCH 1/3] feat: ability to retrieve binary path of solc version --- solc_select/solc_select.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/solc_select/solc_select.py b/solc_select/solc_select.py index 1e71ed3..6857311 100644 --- a/solc_select/solc_select.py +++ b/solc_select/solc_select.py @@ -73,6 +73,8 @@ def installed_versions() -> [str]: f.replace("solc-", "") for f in sorted(os.listdir(ARTIFACTS_DIR)) if f.startswith("solc-") ] +def artifact_path(version: str) -> Path: + return ARTIFACTS_DIR.joinpath(f"solc-{version}", f"solc-{version}") def install_artifacts(versions: [str]) -> bool: releases = get_available_versions() From f93b6f32fd5f223a7305fb0a0f9f04aa989c2a09 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Mon, 27 Mar 2023 14:38:51 -0500 Subject: [PATCH 2/3] do not install already installed versions --- solc_select/solc_select.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/solc_select/solc_select.py b/solc_select/solc_select.py index 6857311..72b48ad 100644 --- a/solc_select/solc_select.py +++ b/solc_select/solc_select.py @@ -77,6 +77,11 @@ def artifact_path(version: str) -> Path: return ARTIFACTS_DIR.joinpath(f"solc-{version}", f"solc-{version}") def install_artifacts(versions: [str]) -> bool: + already_installed = installed_versions() + for version in versions: + if version in already_installed: + versions.remove(version) + releases = get_available_versions() versions = [get_latest_release() if ver == "latest" else ver for ver in versions] @@ -147,6 +152,7 @@ def verify_checksum(version: str) -> None: def get_soliditylang_checksums(version: str) -> (str, str): + print(version) (_, list_url) = get_url(version=version) # pylint: disable=consider-using-with list_json = urllib.request.urlopen(list_url).read() From 7686175661af2bed0b186f8aab1b1811d15402a4 Mon Sep 17 00:00:00 2001 From: alpharush <0xalpharush@protonmail.com> Date: Mon, 17 Apr 2023 15:24:57 -0500 Subject: [PATCH 3/3] remove unnecessary changes --- solc_select/solc_select.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/solc_select/solc_select.py b/solc_select/solc_select.py index 72b48ad..a189d59 100644 --- a/solc_select/solc_select.py +++ b/solc_select/solc_select.py @@ -73,15 +73,12 @@ def installed_versions() -> [str]: f.replace("solc-", "") for f in sorted(os.listdir(ARTIFACTS_DIR)) if f.startswith("solc-") ] + def artifact_path(version: str) -> Path: return ARTIFACTS_DIR.joinpath(f"solc-{version}", f"solc-{version}") -def install_artifacts(versions: [str]) -> bool: - already_installed = installed_versions() - for version in versions: - if version in already_installed: - versions.remove(version) +def install_artifacts(versions: [str]) -> bool: releases = get_available_versions() versions = [get_latest_release() if ver == "latest" else ver for ver in versions] @@ -152,7 +149,6 @@ def verify_checksum(version: str) -> None: def get_soliditylang_checksums(version: str) -> (str, str): - print(version) (_, list_url) = get_url(version=version) # pylint: disable=consider-using-with list_json = urllib.request.urlopen(list_url).read()