Skip to content

Commit

Permalink
Install Kerberos deps when testing wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 18, 2024
1 parent f6ec755 commit f4d6cab
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/install-krb5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,31 @@

set -Eexuo pipefail

if [ "$RUNNER_OS" == "Linux" ]; then
# Assume Ubuntu since this is the only Linux used in CI.
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libkrb5-dev krb5-user krb5-kdc krb5-admin-server
if [[ $OSTYPE == linux* ]]; then
if [ -e /etc/os-release ]; then
source /etc/os-release
elif [ -e /etc/centos-release ]; then
ID="centos"
VERSION_ID=$(cat /etc/centos-release | cut -f3 -d' ' | cut -f1 -d.)
else
echo "install-postgres.sh: cannot determine which Linux distro this is" >&2
exit 1
fi

if [ "${ID}" = "debian" -o "${ID}" = "ubuntu" ]; then
export DEBIAN_FRONTEND=noninteractive

sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libkrb5-dev krb5-user krb5-kdc krb5-admin-server
elif [ "${ID}" = "almalinux" ]; then
sudo dnf install -y krb5-server krb5-libs
elif [ "${ID}" = "centos" ]; then
sudo yum install -y krb5-server krb5-libs
elif [ "${ID}" = "alpine" ]; then
sudo apk add krb5 krb5-server
else
echo "install-postgres.sh: Unsupported distro: ${distro}" >&2
exit 1
fi
fi
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,10 @@ test-command = "python {project}/tests/__init__.py"
test-command = "python {project}\\tests\\__init__.py"

[tool.cibuildwheel.linux]
before-all = ".github/workflows/install-postgres.sh"
before-all = """
.github/workflows/install-postgres.sh \
&& .github/workflows/install-krb5.sh \
"""
test-command = """\
PY=`which python` \
&& chmod -R go+rX "$(dirname $(dirname $(dirname $PY)))" \
Expand Down

0 comments on commit f4d6cab

Please sign in to comment.