Skip to content

Commit 9e58279

Browse files
author
Andrei Neagu
committed
upgraded to python 3.9 and repleced venv with vritualenv
1 parent 785e307 commit 9e58279

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

docker/python/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ RUN apt-get update \
2121
&& apt-get -y install --no-install-recommends \
2222
jq \
2323
&& rm --recursive --force /var/lib/apt/lists/*
24+
# install uv
25+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
2426

2527
# -------------------------- Build stage -------------------
2628
# Installs build/package management tools and third party dependencies

src/osparc_python_runner/main.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,16 @@ def setup():
117117
"set -o nounset",
118118
"IFS=$(printf '\\n\\t')",
119119
'echo "Creating virtual environment ..."',
120-
f'python3 -m venv --system-site-packages --symlinks --upgrade "{venv_dir}"',
121-
f'"{venv_dir}/bin/pip" install -U pip wheel setuptools',
122-
f'"{venv_dir}/bin/pip" install -r "{requirements_txt}"',
120+
f'python3 -m virtualenv --system-site-packages --symlinks --without-pip "{venv_dir}"',
121+
'uv pip install -U pip wheel setuptools',
122+
f'uv pip install -r "{requirements_txt}"',
123123
"\n".join(bash_input_env_export),
124124
"\n".join(bash_output_env_export),
125125
f'echo "Executing code {user_code_entrypoint.name}..."',
126126
f'"{venv_dir}/bin/python3" "{user_code_entrypoint}"',
127127
'echo "DONE ..."',
128128
]
129-
main_script_path = Path("main.sh")
130-
main_script_path.write_text("\n".join(script))
129+
Path("main.sh").write_text("\n".join(script))
131130

132131

133132
def teardown():

src/osparc_python_runner/requirements.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ decorator==5.2.1
2828
# via ipython
2929
defusedxml==0.7.1
3030
# via nbconvert
31+
distlib==0.3.9
32+
# via virtualenv
3133
docopt==0.6.2
3234
# via pipreqs
3335
executing==2.2.0
3436
# via stack-data
3537
fastjsonschema==2.21.1
3638
# via nbformat
39+
filelock==3.18.0
40+
# via virtualenv
3741
fonttools==4.58.0
3842
# via matplotlib
3943
idna==3.10
@@ -115,7 +119,9 @@ pillow==11.2.1
115119
pipreqs==0.5.0
116120
# via -r requirements.in
117121
platformdirs==4.3.8
118-
# via jupyter-core
122+
# via
123+
# jupyter-core
124+
# virtualenv
119125
prompt-toolkit==3.0.51
120126
# via ipython
121127
ptyprocess==0.7.0
@@ -180,6 +186,8 @@ tzdata==2025.2
180186
# via pandas
181187
urllib3==2.4.0
182188
# via requests
189+
virtualenv==20.31.2
190+
# via -r requirements.in
183191
wcwidth==0.2.13
184192
# via prompt-toolkit
185193
webencodings==0.5.1

src/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ seaborn
77

88
# tools
99
pipreqs
10+
virtualenv

0 commit comments

Comments
 (0)