python-hatchling/tests/unit/runtest.sh
Miro Hrončok 882fe9bfaa CI: Install more packages from PyPI
Apparently, httpx and rich are not available in RHEL+EPEL 10.

Perhaps they were installed from Fedora previously on Zuul,
due to https://issues.redhat.com/browse/TFT-2564
2024-11-05 12:46:31 +01:00

25 lines
1016 B
Bash
Executable File

#!/bin/bash -eux
# hatchling 1.24+ requires uv and others for testing - they're not available
# in our systems, hence PyPI installation
# install the specific version of packages that have been released around the time
# the tested hatchling's version was out, just to be sure it works
# we don't rebase packages often in CentOS Stream, so version constraints
# should be reasonably safe to be hardcoded
pip install uv==0.1.35 editables==0.5 rich==13.9.4 httpx==0.27.2
# Get the version of our installed component
VERSION=$(rpm -q --queryformat="%{VERSION}" python3-hatchling)
# The hatch's source code contains the tests for hatchling in tests/backend
git clone --depth 1 --branch hatchling-v$VERSION https://github.com/pypa/hatch/
cd hatch
# Delete the hatchling sources from the repository - we want to test the RPM package
rm -r backend/
# Work around tests wanting a proper Hatch installation
echo '__version__ = "(bogus)"' > src/hatch/_version.py
PYTHONPATH="$PWD/src" python3 -m pytest tests/backend -v