forked from conda/constructor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_install.sh
More file actions
31 lines (27 loc) · 1.46 KB
/
Copy pathtest_install.sh
File metadata and controls
31 lines (27 loc) · 1.46 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
#!/bin/bash
set -euxo pipefail
echo "Added by test-install script" > "$PREFIX/test_install_sentinel.txt"
# tests
# base environment uses python 3.10 and excludes tk
test -f "$PREFIX/conda-meta/history"
"$PREFIX/bin/python" -c "from sys import version_info; assert version_info[:2] == (3, 10)"
# we use python -m pip instead of the pip entry point
# because the spaces break the shebang - this will be fixed
# with a new conda release, but for now this is the workaround
# we need. same with conda in the block below!
"$PREFIX/bin/python" -m pip -V
# tk(inter) shouldn't be listed by conda!
"$PREFIX/bin/python" -m conda list -p "$PREFIX" | jq -e '.[] | select(.name == "tk")' && exit 1
echo "Previous test failed as expected"
# extra env named 'py311' uses python 3.11, has tk, but we removed setuptools
test -f "$PREFIX/envs/py311/conda-meta/history"
"$PREFIX/envs/py311/bin/python" -c "from sys import version_info; assert version_info[:2] == (3, 11)"
# setuptools shouldn't be listed by conda!
"$PREFIX/bin/python" -m conda list -p "$PREFIX/envs/py311" | jq -e '.[] | select(.name == "setuptools")' && exit 1
"$PREFIX/envs/py311/bin/python" -c "import setuptools" && exit 1
echo "Previous test failed as expected"
# this env only contains dav1d, no python; it should have been created with no errors,
# even if we had excluded tk from the package list
test -f "$PREFIX/envs/dav1d/conda-meta/history"
test ! -f "$PREFIX/envs/dav1d/bin/python"
"$PREFIX/envs/dav1d/bin/dav1d" --version