mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-01 15:37:32 +08:00
ac480e7df5
which has been removed in the upcoming Python 3.13 .
73 lines
1.9 KiB
Bash
Executable File
73 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
PACKAGE_LIST_FILE=packages_by_dep_dag.txt
|
|
FOR_PULSAR=0
|
|
|
|
for arg in "$@"; do
|
|
if [ "$arg" = "--for-pulsar" ]; then
|
|
PACKAGE_LIST_FILE=packages_for_pulsar_by_dep_dag.txt
|
|
FOR_PULSAR=1
|
|
fi
|
|
done
|
|
|
|
# Don't display the pip progress bar when running under CI
|
|
if [ "$CI" = 'true' ]; then
|
|
export PIP_PROGRESS_BAR=off
|
|
fi
|
|
|
|
# Change to packages directory.
|
|
cd "$(dirname "$0")"
|
|
|
|
# Use a throw-away virtualenv
|
|
TEST_PYTHON=${TEST_PYTHON:-"python3"}
|
|
TEST_ENV_DIR=${TEST_ENV_DIR:-$(mktemp -d -t gxpkgtestenvXXXXXX)}
|
|
|
|
"$TEST_PYTHON" -m venv "$TEST_ENV_DIR"
|
|
# shellcheck disable=SC1091
|
|
. "${TEST_ENV_DIR}/bin/activate"
|
|
pip install --upgrade pip setuptools wheel
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
pip install -r../lib/galaxy/dependencies/pinned-typecheck-requirements.txt
|
|
fi
|
|
|
|
# Ensure ordered by dependency DAG
|
|
while read -r package_dir || [ -n "$package_dir" ]; do # https://stackoverflow.com/questions/12916352/shell-script-read-missing-last-line
|
|
# Ignore empty lines
|
|
if [ -z "$package_dir" ]; then
|
|
continue
|
|
fi
|
|
# Ignore lines beginning with `#`
|
|
if [[ $package_dir =~ ^#.* ]]; then
|
|
continue
|
|
fi
|
|
|
|
printf "\n========= TESTING PACKAGE %s =========\n\n" "$package_dir"
|
|
|
|
cd "$package_dir"
|
|
|
|
# Install extras (if needed)
|
|
if [ "$package_dir" = "util" ]; then
|
|
pip install '.[image_util,template,jstree,config_template]'
|
|
elif [ "$package_dir" = "tool_util" ]; then
|
|
pip install '.[cwl,mulled,edam,extended-assertions]'
|
|
else
|
|
pip install .
|
|
fi
|
|
|
|
pip install -r test-requirements.txt
|
|
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
marker_args=(-m 'not external_dependency_management')
|
|
else
|
|
marker_args=()
|
|
fi
|
|
# Ignore exit code 5 (no tests ran)
|
|
pytest "${marker_args[@]}" . || test $? -eq 5
|
|
if [ $FOR_PULSAR -eq 0 ]; then
|
|
make mypy
|
|
fi
|
|
cd ..
|
|
done < $PACKAGE_LIST_FILE
|