m7n commited on
Commit
3a5b459
·
1 Parent(s): 904f6cf

Refactor datamapplot version retrieval to use subprocess and update requirements to point to the main branch

Browse files
Files changed (2) hide show
  1. app.py +9 -6
  2. 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 importlib.metadata
24
 
25
- try:
26
- version_metadata = importlib.metadata.version("datamapplot")
27
- print("datamapplot version via importlib.metadata:", version_metadata)
28
- except Exception as e:
29
- print("Could not obtain version via importlib.metadata:", e)
 
 
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
- setuptools==77.0.3
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