Spaces:
Running
on
Zero
Running
on
Zero
Refactor datamapplot version retrieval to use subprocess and update requirements to point to the main branch
Browse files- app.py +9 -6
- requirements.txt +1 -3
app.py
CHANGED
|
@@ -20,14 +20,17 @@ import gradio as gr
|
|
| 20 |
|
| 21 |
print(f"Gradio version: {gr.__version__}")
|
| 22 |
|
| 23 |
-
import
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
|
|
|
|
| 31 |
|
| 32 |
|
| 33 |
|
|
|
|
| 20 |
|
| 21 |
print(f"Gradio version: {gr.__version__}")
|
| 22 |
|
| 23 |
+
import subprocess
|
| 24 |
|
| 25 |
+
def print_datamapplot_version():
|
| 26 |
+
try:
|
| 27 |
+
# On Unix systems, you can pipe commands by setting shell=True.
|
| 28 |
+
version = subprocess.check_output("pip freeze | grep datamapplot", shell=True, text=True)
|
| 29 |
+
print("datamapplot version:", version.strip())
|
| 30 |
+
except subprocess.CalledProcessError:
|
| 31 |
+
print("datamapplot not found in pip freeze output.")
|
| 32 |
|
| 33 |
+
print_datamapplot_version()
|
| 34 |
|
| 35 |
|
| 36 |
|
requirements.txt
CHANGED
|
@@ -1,8 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
datamapplot @ git+https://github.com/TutteInstitute/datamapplot.git@cda9fa5e86714a7937130c31ee04fa63f23317a5
|
| 3 |
uvicorn
|
| 4 |
fastapi
|
| 5 |
-
gradio==5.16.1
|
| 6 |
numpy
|
| 7 |
requests
|
| 8 |
pyalex
|
|
|
|
| 1 |
+
datamapplot @ git+https://github.com/TutteInstitute/datamapplot.git@main
|
|
|
|
| 2 |
uvicorn
|
| 3 |
fastapi
|
|
|
|
| 4 |
numpy
|
| 5 |
requests
|
| 6 |
pyalex
|