Skip to content

Commit 7ee30e9

Browse files
committed
Install Kerberos deps when testing wheels
1 parent f6ec755 commit 7ee30e9

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.github/workflows/install-krb5.sh

+33-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,37 @@
22

33
set -Eexuo pipefail
44

5-
if [ "$RUNNER_OS" == "Linux" ]; then
6-
# Assume Ubuntu since this is the only Linux used in CI.
7-
sudo apt-get update
8-
sudo apt-get install -y --no-install-recommends \
9-
libkrb5-dev krb5-user krb5-kdc krb5-admin-server
5+
if [[ $OSTYPE == linux* ]]; then
6+
if [ "$(id -u)" = "0" ]; then
7+
SUDO=
8+
else
9+
SUDO=sudo
10+
fi
11+
12+
if [ -e /etc/os-release ]; then
13+
source /etc/os-release
14+
elif [ -e /etc/centos-release ]; then
15+
ID="centos"
16+
VERSION_ID=$(cat /etc/centos-release | cut -f3 -d' ' | cut -f1 -d.)
17+
else
18+
echo "install-postgres.sh: cannot determine which Linux distro this is" >&2
19+
exit 1
20+
fi
21+
22+
if [ "${ID}" = "debian" -o "${ID}" = "ubuntu" ]; then
23+
export DEBIAN_FRONTEND=noninteractive
24+
25+
$SUDO apt-get update
26+
$SUDO apt-get install -y --no-install-recommends \
27+
libkrb5-dev krb5-user krb5-kdc krb5-admin-server
28+
elif [ "${ID}" = "almalinux" ]; then
29+
$SUDO dnf install -y krb5-server krb5-libs
30+
elif [ "${ID}" = "centos" ]; then
31+
$SUDO yum install -y krb5-server krb5-libs
32+
elif [ "${ID}" = "alpine" ]; then
33+
$SUDO apk add krb5 krb5-server
34+
else
35+
echo "install-postgres.sh: Unsupported distro: ${distro}" >&2
36+
exit 1
37+
fi
1038
fi

pyproject.toml

+4-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ test-command = "python {project}/tests/__init__.py"
8181
test-command = "python {project}\\tests\\__init__.py"
8282

8383
[tool.cibuildwheel.linux]
84-
before-all = ".github/workflows/install-postgres.sh"
84+
before-all = """
85+
.github/workflows/install-postgres.sh \
86+
&& .github/workflows/install-krb5.sh \
87+
"""
8588
test-command = """\
8689
PY=`which python` \
8790
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" \

0 commit comments

Comments
 (0)