@@ -133,7 +133,7 @@ if [ $SET_VENV -eq 1 ] && [ $CREATE_VENV -eq 1 ]; then
133133 echo " To avoid this, use the --no-create-venv flag or set \$ GALAXY_VIRTUAL_ENV to an"
134134 echo " existing environment before starting Galaxy."
135135 if command -v uv > /dev/null; then
136- uv venv " $GALAXY_VIRTUAL_ENV " --python " $GALAXY_PYTHON "
136+ uv venv --python " $GALAXY_PYTHON " " $GALAXY_VIRTUAL_ENV "
137137 else
138138 # First try to use the venv standard library module, although it is
139139 # not always installed by default on Linux distributions.
@@ -168,6 +168,14 @@ if [ $SET_VENV -eq 1 ] && [ $CREATE_VENV -eq 1 ]; then
168168 fi
169169fi
170170
171+ if command -v uv > /dev/null; then
172+ PIP_CMD=" $( command -v uv) pip"
173+ UNINSTALL_OPTIONS=' '
174+ else
175+ PIP_CMD=' python -m pip'
176+ UNINSTALL_OPTIONS=' --yes'
177+ fi
178+
171179# activate virtualenv or conda env, sets $GALAXY_VIRTUAL_ENV and $GALAXY_CONDA_ENV
172180setup_python
173181
188196[ " $CI " = ' true' ] && export PIP_PROGRESS_BAR=off
189197
190198if [ $FETCH_WHEELS -eq 1 ]; then
191- if command -v uv > /dev/null; then
192- uv pip install $requirement_args --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
193-
194- set_galaxy_config_file_var
195- GALAXY_CONDITIONAL_DEPENDENCIES=$( PYTHONPATH=lib python -c " from __future__ import print_function; import galaxy.dependencies; print('\n'.join(galaxy.dependencies.optional('$GALAXY_CONFIG_FILE ')))" )
196- if [ -n " $GALAXY_CONDITIONAL_DEPENDENCIES " ]; then
197- if uv pip list --format=columns | grep " psycopg2[\(\ ]*2.7.3" > /dev/null; then
198- echo " An older version of psycopg2 (non-binary, version 2.7.3) has been detected. Galaxy now uses psycopg2-binary, which will be installed after removing psycopg2."
199- uv pip uninstall psycopg2 psycopg2-binary
200- fi
201- echo " $GALAXY_CONDITIONAL_DEPENDENCIES " | uv pip install -r /dev/stdin --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
202- fi
203- else
204- python -m pip install " pip>=$MIN_PIP_VERSION " wheel
205- # shellcheck disable=SC2086
206- pip install $requirement_args --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
207-
208- set_galaxy_config_file_var
209- GALAXY_CONDITIONAL_DEPENDENCIES=$( PYTHONPATH=lib python -c " from __future__ import print_function; import galaxy.dependencies; print('\n'.join(galaxy.dependencies.optional('$GALAXY_CONFIG_FILE ')))" )
210- if [ -n " $GALAXY_CONDITIONAL_DEPENDENCIES " ]; then
211- if pip list --format=columns | grep " psycopg2[\(\ ]*2.7.3" > /dev/null; then
212- echo " An older version of psycopg2 (non-binary, version 2.7.3) has been detected. Galaxy now uses psycopg2-binary, which will be installed after removing psycopg2."
213- pip uninstall -y psycopg2 psycopg2-binary
214- fi
215- echo " $GALAXY_CONDITIONAL_DEPENDENCIES " | pip install -r /dev/stdin --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
199+ if [ " ${PIP_CMD} " = ' python -m pip' ]; then
200+ ${PIP_CMD} install " pip>=${MIN_PIP_VERSION} " wheel
201+ fi
202+ # shellcheck disable=SC2086
203+ ${PIP_CMD} install $requirement_args --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
204+ set_galaxy_config_file_var
205+ GALAXY_CONDITIONAL_DEPENDENCIES=$( PYTHONPATH=lib python -c " from __future__ import print_function; import galaxy.dependencies; print('\n'.join(galaxy.dependencies.optional('$GALAXY_CONFIG_FILE ')))" )
206+ if [ -n " $GALAXY_CONDITIONAL_DEPENDENCIES " ]; then
207+ if ${PIP_CMD} list --format=columns | grep " psycopg2[\(\ ]*2.7.3" > /dev/null; then
208+ echo " An older version of psycopg2 (non-binary, version 2.7.3) has been detected. Galaxy now uses psycopg2-binary, which will be installed after removing psycopg2."
209+ ${PIP_CMD} uninstall ${UNINSTALL_OPTIONS} psycopg2 psycopg2-binary
216210 fi
211+ echo " $GALAXY_CONDITIONAL_DEPENDENCIES " | ${PIP_CMD} install -r /dev/stdin --index-url " ${GALAXY_WHEELS_INDEX_URL} " --extra-index-url " ${PYPI_INDEX_URL} "
217212 fi
218213fi
219214
0 commit comments