-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathgithub_actions_dependencies.sh
More file actions
executable file
·71 lines (66 loc) · 2.09 KB
/
github_actions_dependencies.sh
File metadata and controls
executable file
·71 lines (66 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash -ef
set -eo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
STD_ARGS="--progress-bar off --upgrade"
INSTALL_ARGS="-e"
if [ ! -z "$CONDA_ENV" ]; then
echo "Uninstalling MNE for CONDA_ENV=${CONDA_ENV}"
# This will fail if mne-base is not in the env (like in our minimal env, so ||true them):
echo "::group::Uninstalling MNE"
conda remove -c conda-forge --force -yq mne-base || true
python -m pip uninstall -y mne || true
echo "::endgroup::"
# If using bare environment.yml and not on windows, do a non-editable install
if [[ "${RUNNER_OS}" != "Windows" ]] && [[ "${CONDA_ENV}" != "environment_"* ]]; then
INSTALL_ARGS=""
fi
# If on minimal, just install testing deps
if [[ "${MNE_CI_KIND}" == "minimal" ]]; then
GROUP="test"
EXTRAS=""
STD_ARGS="--progress-bar off ${MNE_QT_BACKEND}"
echo "::group::Upgrading pip installation"
python -m pip install --upgrade pip # upgrade pip to support --group
echo "::endgroup::"
else
GROUP="test_extra"
EXTRAS="[hdf5]"
fi
elif [[ "${MNE_CI_KIND}" == "old" ]]; then
GROUP="" # group "test" already included when pylock file generated
EXTRAS=""
STD_ARGS="--progress-bar off"
echo "::group::Syncing old environment dependencies from lockfile using uv"
uv pip sync ${SCRIPT_DIR}/pylock.ci-old.toml
uv pip install pip tomlkit ${MNE_QT_BACKEND}
echo "::endgroup::"
elif [[ "${MNE_CI_KIND}" == "pip" ]]; then
GROUP="test_extra"
EXTRAS="[full-pyside6]"
elif [[ "${MNE_CI_KIND}" == "pixi" ]]; then
GROUP="test_extra"
EXTRAS="[hdf5]"
INSTALL_ARGS=""
else
test "${MNE_CI_KIND}" == "pip-pre"
STD_ARGS="$STD_ARGS --pre"
${SCRIPT_DIR}/install_pre_requirements.sh || exit 1
GROUP="test_extra"
EXTRAS=""
fi
echo ""
# Make sure we only pass non-empty groups argument
if [ -z "$GROUP" ]; then
GROUP_ARG=""
else
GROUP_ARG="--group=$GROUP"
fi
if [[ "${MNE_CI_KIND}" != "old" ]]; then
echo "::group::Installing test dependencies using pip"
else
echo "::group::Installing MNE in development mode using pip"
fi
set -x
${PREFIX} python -m pip install $STD_ARGS $INSTALL_ARGS .$EXTRAS $GROUP_ARG
set +x
echo "::endgroup::"