From 20e20f6472ae7ba1f889269e52b9ee44bb23f382 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 21 Oct 2024 14:23:04 +0530 Subject: [PATCH 1/2] install pip for the python version installed by pip --- run.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 3bbb68e..6d7ae90 100755 --- a/run.sh +++ b/run.sh @@ -3,8 +3,11 @@ # this will create venv from python version defined in .python-version uv venv + +uv run python -m ensurepip --upgrade + # install requirements for the project uv pip install -r requirements.txt # run app using python from venv -uv run main.py ++uv run main.py 2>&1 | tee app.log From 82aba9d34372d5299bceb97dbf4c79d6750d0bba Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 21 Oct 2024 17:49:20 +0530 Subject: [PATCH 2/2] install from requirements.txt using app's venv python pip --- run.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 6d7ae90..ebd58ca 100755 --- a/run.sh +++ b/run.sh @@ -3,11 +3,16 @@ # this will create venv from python version defined in .python-version uv venv - +# Ensure pip is installed and up-to-date uv run python -m ensurepip --upgrade +# Note: we need to point to the pip against the python version +# since uv is sensitive to current environment +# so running this app from syftbox uses syftbox's uv environment, +# instead of the app environent + # install requirements for the project -uv pip install -r requirements.txt +uv run python -m pip install -r requirements.txt # run app using python from venv -+uv run main.py 2>&1 | tee app.log +uv run main.py 2>&1 | tee app.log \ No newline at end of file