Spaces:
Sleeping
Sleeping
Update to support brainforge-dataset-utils dependency installation
#1
by
neongecko
- opened
app.py
CHANGED
|
@@ -5,6 +5,19 @@ from subprocess import run, PIPE
|
|
| 5 |
run(["git", "clone",
|
| 6 |
f"https://{environ['GITHUB_TOKEN']}@github.com/neongeckocom/brainforge-webapp",
|
| 7 |
"-b", environ["GITHUB_BRANCH"]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
run(["pip", "install", "./brainforge-webapp"])
|
| 9 |
|
| 10 |
# Get Demo Commit ID
|
|
|
|
| 5 |
run(["git", "clone",
|
| 6 |
f"https://{environ['GITHUB_TOKEN']}@github.com/neongeckocom/brainforge-webapp",
|
| 7 |
"-b", environ["GITHUB_BRANCH"]])
|
| 8 |
+
|
| 9 |
+
# Replace SSH dependencies with HTTP using token envvar
|
| 10 |
+
requirements_file = "./brainforge-webapp/requirements/requirements.txt"
|
| 11 |
+
with open(requirements_file, 'r') as f:
|
| 12 |
+
lines = f.readlines()
|
| 13 |
+
|
| 14 |
+
for line in lines:
|
| 15 |
+
if "github.com" in line:
|
| 16 |
+
line.replace("git+ssh://git@github.com", f"git+https://{environ['GITHUB_TOKEN']}@github.com")
|
| 17 |
+
|
| 18 |
+
with open(requirements_file, 'w') as f:
|
| 19 |
+
f.writelines(lines)
|
| 20 |
+
|
| 21 |
run(["pip", "install", "./brainforge-webapp"])
|
| 22 |
|
| 23 |
# Get Demo Commit ID
|