From c4c059f86be49d2652ceb53ad9c6171f2ef16500 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 09:28:37 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/pycafe-dashboards-in-CI.yml | 1 - tools/pycafe/test.py | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pycafe-dashboards-in-CI.yml b/.github/workflows/pycafe-dashboards-in-CI.yml index 9758844fb..c52e782ab 100644 --- a/.github/workflows/pycafe-dashboards-in-CI.yml +++ b/.github/workflows/pycafe-dashboards-in-CI.yml @@ -56,7 +56,6 @@ jobs: run: | python tools/pycafe/create_py_cafe_url.py - - name: Run Github Tool run: | python tools/pycafe/test.py $GH_TOKEN ${{ env.COMMIT_HASH }} ${{ env.RUN_ID }} diff --git a/tools/pycafe/test.py b/tools/pycafe/test.py index 96cfc0df4..65f241d79 100644 --- a/tools/pycafe/test.py +++ b/tools/pycafe/test.py @@ -1,7 +1,7 @@ import sys -from github import Github from urllib.parse import quote -import os + +from github import Github # Authenticate with GitHub access_token = sys.argv[1] @@ -21,19 +21,19 @@ pr_number = int(pr) pr = repo.get_pull(pr_number) -base_url = f'https://py.cafe/snippet/{type}/v1' -url = f'{base_url}#code={quote(code)}&requirements={quote(requirements)}' +base_url = f"https://py.cafe/snippet/{type}/v1" +url = f"{base_url}#code={quote(code)}&requirements={quote(requirements)}" # # Get the latest commit SHA from the PR if 1: commit_sha = pr.head.sha # Define the deployment status - state = 'success' # Options: 'error', 'failure', 'pending', 'success' - description = 'Test out this PR on a PyCafe environment' - context = 'PyCafe' + state = "success" # Options: 'error', 'failure', 'pending', 'success' + description = "Test out this PR on a PyCafe environment" + context = "PyCafe" # Create the status on the commit commit = repo.get_commit(commit_sha) commit.create_status(state=state, target_url=url, description=description, context=context) - print(f'Deployment status added to commit {commit_sha}') \ No newline at end of file + print(f"Deployment status added to commit {commit_sha}")