Python 3.12.0a2 removed the standard library distutils module, so we can no longer use it.
33 lines
1.2 KiB
Bash
Executable file
33 lines
1.2 KiB
Bash
Executable file
#!/bin/sh -eux
|
|
|
|
# set default version to %{python3_version} if available
|
|
VERSION=${VERSION:-$(rpm --eval '%{?python3_version}')} || true
|
|
# ...or 3.8 if that macro is not available or rpm fails for any reason
|
|
VERSION=${VERSION:-3.8}
|
|
|
|
PYTHON=${PYTHON:-python$VERSION}
|
|
|
|
# what to skip
|
|
# test_socket swaps and kills the machine https://bugs.python.org/issue34587
|
|
X=${X:-"-x test_socket"}
|
|
|
|
# parallel jobs, 0 lets Python decide what's best
|
|
JOBS=${JOBS:-0}
|
|
|
|
# Fedora sets explicit minimum/maximum TLS versions.
|
|
# Python's test suite assumes that the minimum/maximum version is set to
|
|
# a magic marker. We workaround the test problem by setting:
|
|
export OPENSSL_CONF=/non-existing-file
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1618753
|
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1778357
|
|
# https://bugs.python.org/issue35045
|
|
# https://bugs.python.org/issue38815
|
|
|
|
# setuptools 60+ uses its own copy of distutils by default
|
|
# this setting must be overriden with the environment variable for
|
|
# Python tests to use the standard library's distutils
|
|
# We only do this if stdlib distutils actually exists
|
|
$PYTHON -c 'import distutils' 2>/dev/null && export SETUPTOOLS_USE_DISTUTILS=stdlib || true
|
|
|
|
$PYTHON -m test.pythoninfo
|
|
$PYTHON -m test -wW -j$JOBS $X
|