From 6b45cfcb7b5b36721ec26e18d0389eaba70aadd0 Mon Sep 17 00:00:00 2001 From: Elias Tazartes <66871571+Eikix@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:32:35 +0100 Subject: [PATCH] Fix/plt panda (#1022) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Time spent on this PR: ## Pull request type Please check the type of change your PR introduces: - [x] Bugfix - [ ] Feature - [ ] Code style update (formatting, renaming) - [ ] Refactoring (no functional changes, no api changes) - [ ] Build related changes - [ ] Documentation content changes - [ ] Other (please describe): ## What is the current behavior? Resolves # ## What is the new behavior? - - - - - - This change is [Reviewable](https://reviewable.io/reviews/kkrt-labs/kakarot/1022) --- scripts/artifacts.py | 33 +-------------------------------- scripts/utils/kakarot.py | 10 ---------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/scripts/artifacts.py b/scripts/artifacts.py index 4fd9a10dd..ddf70924e 100644 --- a/scripts/artifacts.py +++ b/scripts/artifacts.py @@ -18,6 +18,7 @@ def pull_and_plot_ef_tests(name: Union[str, Path] = Path("logs")): + # Pull latest main artifacts response = requests.get( "https://api.github.com/repos/kkrt-labs/kakarot/actions/workflows/ci.yml/runs?branch=cw/run-all&per_page=100" @@ -97,35 +98,3 @@ def get_artifacts( z.extractall(Path(name) / artifact["head_branch"]) return artifacts - - -def fetch_deployments(path: str = "deployments"): - response = requests.get( - "https://api.github.com/repos/kkrt-labs/kakarot/actions/artifacts" - ) - artifacts = ( - pd.DataFrame( - [ - {**artifact["workflow_run"], **artifact} - for artifact in response.json()["artifacts"] - ] - ) - .loc[lambda df: df["head_branch"] == "main"] - .loc[lambda df: df["name"] == "deployments"] - .sort_values(["updated_at"], ascending=False) - .archive_download_url - ) - - if artifacts.empty: - raise ValueError("No deployment artifacts found for base branch main") - - github_token = os.getenv("GITHUB_TOKEN") - if not github_token: - raise ValueError("github token not found in environment variables") - - response = requests.get( - artifacts.tolist()[0], - headers={"Authorization": f"Bearer {github_token}"}, - ) - z = zipfile.ZipFile(io.BytesIO(response.content)) - z.extractall(path) diff --git a/scripts/utils/kakarot.py b/scripts/utils/kakarot.py index 48d70b16b..ffb427775 100644 --- a/scripts/utils/kakarot.py +++ b/scripts/utils/kakarot.py @@ -26,7 +26,6 @@ from web3.exceptions import LogTopicError, MismatchedABI, NoABIFunctionsFound from web3.types import LogReceipt -from scripts.artifacts import fetch_deployments from scripts.constants import EVM_ADDRESS, EVM_PRIVATE_KEY, NETWORK, RPC_CLIENT from scripts.utils.starknet import call as _call_starknet from scripts.utils.starknet import fund_address as _fund_starknet_address @@ -42,15 +41,6 @@ logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) -if not NETWORK["devnet"]: - try: - fetch_deployments() - except Exception as e: - if not get_deployments(): - logger.warn( - f"Using network {NETWORK['name']}, couldn't fetch deployment, error:\n{e}" - ) - class EvmTransactionError(Exception): pass