2024-07-31 11:18:26 +00:00
|
|
|
#!/bin/bash -eux
|
|
|
|
|
2024-11-05 11:46:31 +00:00
|
|
|
# hatchling 1.24+ requires uv and others for testing - they're not available
|
2024-08-02 10:32:39 +00:00
|
|
|
# in our systems, hence PyPI installation
|
2024-11-05 11:46:31 +00:00
|
|
|
# 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
|
2024-08-02 10:32:39 +00:00
|
|
|
# we don't rebase packages often in CentOS Stream, so version constraints
|
|
|
|
# should be reasonably safe to be hardcoded
|
2024-11-05 11:46:31 +00:00
|
|
|
pip install uv==0.1.35 editables==0.5 rich==13.9.4 httpx==0.27.2
|
2024-08-02 10:32:39 +00:00
|
|
|
|
2024-07-31 11:18:26 +00:00
|
|
|
# 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
|
|
|
|
|
2024-08-02 10:59:25 +00:00
|
|
|
PYTHONPATH="$PWD/src" python3 -m pytest tests/backend -v
|