From 3c00f0fbfb07241fc4672024322062e7ef2803c9 Mon Sep 17 00:00:00 2001 From: Freddy Boulton Date: Fri, 11 Aug 2023 09:32:01 -0400 Subject: [PATCH] Install client in PR Build (#5178) * Modify ci * Add quotes * Modify comment * Fix comment * reverse order --- .github/workflows/build-pr.yml | 4 +++- .github/workflows/deploy-pr-to-spaces.yml | 7 ++++++- scripts/copy_demos.py | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 6662e5f59e..930e3f1302 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -44,7 +44,9 @@ jobs: name: gradio-${{ env.GRADIO_VERSION }}-py3-none-any.whl path: dist/gradio-${{ env.GRADIO_VERSION }}-py3-none-any.whl - name: Set up Demos - run: python scripts/copy_demos.py https://gradio-builds.s3.amazonaws.com/${{ github.sha }}/gradio-${{ env.GRADIO_VERSION }}-py3-none-any.whl + run: | + python scripts/copy_demos.py https://gradio-builds.s3.amazonaws.com/${{ github.sha }}/gradio-${{ env.GRADIO_VERSION }}-py3-none-any.whl \ + "gradio-client @ git+https://github.com/gradio-app/gradio@${{ github.sha }}#subdirectory=client/python" - name: Upload all_demos uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/deploy-pr-to-spaces.yml b/.github/workflows/deploy-pr-to-spaces.yml index 5a9d5903fc..1bd56a6212 100644 --- a/.github/workflows/deploy-pr-to-spaces.yml +++ b/.github/workflows/deploy-pr-to-spaces.yml @@ -58,11 +58,16 @@ jobs: All the demos for this PR have been deployed at ${{ env.SPACE_URL }} --- - You can install the changes in this PR by running: + ### Install Gradio from this PR: ```bash pip install https://gradio-builds.s3.amazonaws.com/${{ env.gh_sha }}/gradio-${{ env.gradio_version }}-py3-none-any.whl ``` + --- + ### Install Gradio Python Client from this PR + ```bash + pip install "gradio-client @ git+https://github.com/gradio-app/gradio@${{ github.sha }}#subdirectory=client/python" + ``` comment_tag: All the demos for this PR have been deployed at GITHUB_TOKEN: ${{ secrets.COMMENT_TOKEN }} pr_number: ${{ env.pr_number }} diff --git a/scripts/copy_demos.py b/scripts/copy_demos.py index 1ed67a31cf..5b037c36eb 100644 --- a/scripts/copy_demos.py +++ b/scripts/copy_demos.py @@ -55,6 +55,7 @@ if __name__ == "__main__": description="Copy all demos to all_demos and update requirements" ) parser.add_argument("gradio_version", type=str, help="Gradio") + parser.add_argument("gradio_client_version", type=str, help="Gradio Client Version") args = parser.parse_args() source_dir = pathlib.Path(pathlib.Path(__file__).parent, "..", "demo") @@ -66,6 +67,7 @@ if __name__ == "__main__": pathlib.Path(__file__).parent, "..", "demo", "all_demos", "requirements.txt" ) requirements = f""" + {args.gradio_client_version} {args.gradio_version} pypistats==1.1.0 plotly==5.10.0