1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-15 04:05:15 +03:00
aports/community/py3-whatthepatch/APKBUILD
mio ff7447d0b0 community/py3-whatthepatch: skip failing test on riscv64
Test fails on edge riscv64 builder.

```
self = <tests.test_patch.PatchTestSuite testMethod=test_huge_patch>

        def test_huge_patch(self):
            text_parts = [
                """diff --git a/huge.file b/huge.file
    index 0000000..1111111 100644
    --- a/huge.file
    +++ a/huge.file
    @@ -3,13 +3,1000007 @@
     00000000
     11111111
     22222222
    -33333333
    -44444444
    +55555555
    +66666666
    """
            ]
            text_parts.extend("+" + hex(n) + "\n" for n in range(0, 1000000))
            text = "".join(text_parts)
            start_time = time.time()
            result = list(wtp.patch.parse_patch(text))
            self.assertEqual(1, len(result))
            self.assertEqual(1000007, len(result[0].changes))
            # This is 2x the usual time for CI to allow for some slow tests
            # Really all we care about is that this parses faster than it used to (200s+)
>           self.assertGreater(20, time.time() - start_time)
E           AssertionError: 20 not greater than 20.947331190109253

tests/test_patch.py:1453: AssertionError
```
2025-04-11 16:07:06 +00:00

41 lines
1.3 KiB
Text

# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=py3-whatthepatch
pkgver=1.0.7
pkgrel=0
pkgdesc="library for parsing and applying patch files"
url="https://github.com/cscorley/whatthepatch"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-gpep517 py3-installer py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cscorley/whatthepatch/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/whatthepatch-$pkgver"
build() {
gpep517 build-wheel \
--wheel-dir .dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m venv --clear --without-pip --system-site-packages .testenv
.testenv/bin/python3 -m installer .dist/*.whl
.testenv/bin/python3 -m installer -d testenv .dist/*.whl
case "$CARCH" in
# test_huge_patch: fails on edge riscv64 builder with AssertionError
riscv64) .testenv/bin/python3 -m pytest -k 'not test_huge_patch' ;;
*) .testenv/bin/python3 -m pytest ;;
esac
}
package() {
python3 -m installer -d "$pkgdir" .dist/*.whl
}
sha512sums="
2e1492f062231e78dd1d9798cdd4445d14d04f0d6f30cdc5863017bd028fed7b670f9f3bf9928740c78c1b3286ce2121cd77690d3b7f259c26d5045514debfd1 py3-whatthepatch-1.0.7.tar.gz
"