Skip to content

Commit f4935be

Browse files
author
sd109
committed
Create venv if missing
1 parent 2332083 commit f4935be

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ __pycache__/
99
test-values.y[a]ml
1010
chart/web-app/settings.yml
1111
gradio-client-test.py
12-
venv*/
12+
**venv*/
13+
1314

1415
# Helm chart stuff
1516
chart/Chart.lock

Tiltfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ if not run_ui_locally:
2525
k8s_resource("chart-api", port_forwards="8081:8000")
2626

2727
if run_ui_locally:
28+
venv_name = "tilt-dev-venv"
2829
requirements = "images/ui-base/requirements.txt"
2930
# Run gradio app locally with hot-reloading
3031
local_resource(
3132
name="gradio-app",
3233
deps=requirements,
3334
serve_cmd="".join([
34-
"source venv/bin/activate",
35+
"([[ -d {} ]] || python3 -m venv {})".format(venv_name, venv_name),
36+
"&& source {}/bin/activate".format(venv_name),
3537
"&& pip install -r {}".format(requirements),
3638
"&& cd chart/web-app",
3739
"&& gradio app.py --demo-name app"

0 commit comments

Comments
 (0)