Skip to content

Commit 13bfe8c

Browse files
committed
changes
1 parent 92e905e commit 13bfe8c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

scripts/copy_demos.py

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""
2+
We pull in a select number of spaces and build them into a single FastAPI application to preview them on HF Spaces.
3+
The script that is run in CI is located at: https://github.com/gradio-app/github/blob/main/packages/copy-demos/index.ts
4+
This is the Python version of that script for local use.
5+
"""
6+
17
import argparse
28
import os
39
import pathlib

testing-guidelines/ci.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ The `spaces` preview is a little more involved as it is a custom process and req
236236

237237
The process is relatively straightforward, and follows [the steps mentioned above](#spaces) but there a few details to be aware of.
238238

239-
- We use [a custom script](https://github.com/gradio-app/gradio/blob/main/scripts/copy_demos.py) to pull in a select number of spaces and build them into a single FastAPI application. We serve each demo on its own subpath. This is the demo app that gets deployed to spaces.
239+
- We use [a custom script](https://github.com/gradio-app/github/blob/main/packages/copy-demos/index.ts) to pull in a select number of spaces and build them into a single FastAPI application. We serve each demo on its own subpath. This is the demo app that gets deployed to spaces.
240240
- We build a new wheel from the pull requests source code and upload it to s3, we then add the url for this wheel to the requirements.txt of the space we are deploying.
241241
- The wheel name (and subsequently the url) include the commit SHA, every build is unique even for the same pull request
242242
- It is important the 'version' of the wheel is the same as the latest version of Gradio. This is because spaces _first_ installs the requirements from the `requirements.txt` and _then_ installs whatever it needs to based on the `sdk` field of the spaces `README.md`. Since the `sdk` is set to Gradio in this case, it will attempt to install the latest version of Gradio and see that the version requirement is already satisfied. If we didn't have matching versions then our custom wheel would be overwritten.

0 commit comments

Comments
 (0)