-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildenv
91 lines (73 loc) · 2.53 KB
/
buildenv
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# bump: conan-version /CONAN_VERSION='(.*)'/ https://github.com/conan-io/conan.git|semver:*
CONAN_VERSION='2.9.1'
export ZOPEN_STABLE_TAG="${CONAN_VERSION}"
export ZOPEN_STABLE_URL='https://github.com/conan-io/conan.git'
export ZOPEN_STABLE_DEPS='python'
export ZOPEN_DEV_URL='https://github.com/conan-io/conan.git'
export ZOPEN_DEV_DEPS='python'
export ZOPEN_BUILD_LINE='STABLE'
export ZOPEN_RUNTIME_DEPS='python'
export ZOPEN_CATEGORIES='development devops'
export ZOPEN_COMP='skip'
if [ -z "$ZOPEN_CHECK" ]; then
export ZOPEN_CHECK='zopen_check'
fi
export ZOPEN_CHECK_MINIMAL='yes'
export ZOPEN_CONFIGURE='skip'
export ZOPEN_MAKE='zopen_build'
export ZOPEN_MAKE_MINIMAL='yes'
export ZOPEN_INSTALL='zopen_install'
zopen_build() {
python -m venv .venv
. .venv/bin/activate
pip install setuptools build installer wheel && \
rm -rf dist && \
python -m build --wheel
zopen_build_result="$?"
deactivate
return "$zopen_build_result"
}
zopen_check() {
. .venv/bin/activate
pip install -r conans/requirements.txt
pip install -r conans/requirements_server.txt
pip install -r conans/requirements_dev.txt
pytest . --ignore=build
deactivate
}
zopen_check_results() {
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
summary="$(tail -n 1 "$chk")"
# Summarise pytest summary line
failed="$(echo "$summary" | sed -n 's/^.* \([0-9]*\) failed.*$/\1/p')"
errors="$(echo "$summary" | sed -n 's/^.* \([0-9]*\) errors.*$/\1/p')"
xfailed="$(echo "$summary" | sed -n 's/^.* \([0-9]*\) xfailed.*$/\1/p')"
passed="$(echo "$summary" | sed -n 's/^.* \([0-9]*\) passed.*$/\1/p')"
skipped="$(echo "$summary" | sed -n 's/^.* \([0-9]*\) skipped.*$/\1/p')"
echo "actualFailures:$(( $failed + $errors ))"
echo "totalTests:$(( $failed + $errors + $xfailed + $passed + $skipped ))"
echo 'expectedFailures:2253'
echo 'expectedTotalTests:4628'
}
zopen_get_version() {
echo "${CONAN_VERSION}"
}
zopen_install() {
set -e
mkdir -p "${ZOPEN_INSTALL_DIR}/lib/"
cp "dist/conan-${CONAN_VERSION}-py3-none-any.whl" "${ZOPEN_INSTALL_DIR}/lib/"
mkdir -p "${ZOPEN_INSTALL_DIR}/bin/"
touch "${ZOPEN_INSTALL_DIR}/bin/conan"
set +e
}
zopen_append_to_setup() {
echo "python -m pip install --prefix=. 'lib/conan-${CONAN_VERSION}-py3-none-any.whl'"
}
zopen_append_to_env() {
cat <<EOF
PYTHONPATH="\$PYTHONPATH:\$(python -c 'import site; import os; site.PREFIXES=[os.getcwd()]; print(site.getsitepackages()[0])')"
export PYTHONPATH="\$(deleteDuplicateEntries "\$PYTHONPATH" ":")"
EOF
}