CI: Run upstream unit tests for hatchling
This commit is contained in:
parent
acb9b09e2f
commit
8bb89c3bf8
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
|||||||
|
1
|
18
tests/unit/main.fmf
Normal file
18
tests/unit/main.fmf
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
summary: run upstream unit tests
|
||||||
|
test: ./runtest.sh
|
||||||
|
require:
|
||||||
|
- cargo
|
||||||
|
- git-core
|
||||||
|
- python3-click
|
||||||
|
- python3-filelock
|
||||||
|
- python3-hatchling
|
||||||
|
- python3-httpx
|
||||||
|
- python3-packaging
|
||||||
|
- python3-pathspec
|
||||||
|
- python3-platformdirs
|
||||||
|
- python3-pytest
|
||||||
|
- python3-pytest-mock
|
||||||
|
- python3-rich
|
||||||
|
- python3-tomli-w
|
||||||
|
- python3-virtualenv
|
||||||
|
duration: 10m
|
20
tests/unit/runtest.sh
Executable file
20
tests/unit/runtest.sh
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash -eux
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# test_extra_met and test_unknown_extra try to pip install requests[security]==2.25.1
|
||||||
|
# which is too old to be compiled for Python 3.13 - skip them
|
||||||
|
k="not test_extra_met and not test_unknown_extra"
|
||||||
|
|
||||||
|
PYTHONPATH="$PWD/src" python3 -m pytest tests/backend -k "${k}" -v
|
Loading…
Reference in New Issue
Block a user