1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 11:15:13 +03:00
aports/community/py3-pdm-backend/APKBUILD
mio 88210d1d39 community/py3-pdm-backend: fix scm and api tests
The `test_scm.py` and `test_api.py` tests did not configure a local git
user and email, which caused some tests to fail (errors reproducible in
rootbld, or in environments without a global git config). Configure an
example git user so tests can be completed.

Example error:

```
ERROR at setup of test__get_version_from_scm__returns_tag_if_method_unspecified[git] _

request = <SubRequest 'scm' for <Function test__get_version_from_scm__returns_tag_if_method_unspecified[git]>>
scm_dir = PosixPath('/tmp/tmp3dzww1_2')

    @pytest.fixture(params=["git", "hg"])
    def scm(request: pytest.FixtureRequest, scm_dir: Path) -> Scm:
        scm = cast(Scm, request.getfixturevalue(request.param))

        file_path = scm_dir / "test.txt"
        with open(file_path, "w") as f:
            f.write("a\n")

>       scm.commit("Add a", [file_path])

tests/pdm/backend/hooks/version/test_scm.py:197:

[...]

input = None, capture_output = True, timeout = None, check = True
popenargs = ([PosixPath('/usr/bin/git'), 'commit', '-m', 'Add a'],)
kwargs = {'cwd': PosixPath('/tmp/tmp3dzww1_2'), 'encoding': 'utf-8', 'stderr': -1, 'stdout': -1}
process = <Popen: returncode: 128 args: [PosixPath('/usr/bin/git'), 'commit', '-m', 'A...>
stdout = ''
stderr = 'Author identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email "you@example.co... only in this repository.\n\nfatal: unable to auto-detect email address (got \'buildozer@build-edge-x86_64.(none)\')\n'
retcode = 128
```
2025-05-05 23:38:46 +00:00

54 lines
1.6 KiB
Text

# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-pdm-backend
pkgver=2.4.4
pkgrel=0
pkgdesc="Build backend used by PDM that supports latest packaging standards"
url="https://pdm-backend.fming.dev/"
arch="noarch"
license="MIT"
depends="
py3-cerberus
py3-editables
py3-license-expression
py3-packaging
py3-pyproject-metadata
py3-tomli
py3-tomli-w
py3-validate-pyproject
python3
"
makedepends="py3-gpep517 py3-installer"
checkdepends="git py3-pytest py3-setuptools python3-dev"
subpackages="$pkgname-pyc"
source="https://github.com/pdm-project/pdm-backend/archive/refs/tags/$pkgver/py3-pdm-backend-$pkgver.tar.gz
unvendor.patch
fix-scm-api-tests.patch
"
builddir="$srcdir/pdm-backend-$pkgver"
build() {
PDM_BUILD_SCM_VERSION=$pkgver \
gpep517 build-wheel \
--wheel-dir .dist \
--output-fd 3 3>&1 >&2
}
check() {
python3 -m venv --system-site-packages .testenv
.testenv/bin/python3 -m installer .dist/*.whl
.testenv/bin/python3 -m pytest
}
package() {
python3 -m installer -d "$pkgdir" \
.dist/*.whl
rm -rf "$pkgdir"/usr/lib/python*/site-packages/pdm/backend/_vendor
find "$pkgdir" -type f -name '*.orig' -delete
}
sha512sums="
b8d6983d2df1028d30c046c9952e6182aed0b099e6d0d0b4cc784179cb3e4c9f518b58a6fe5c7a2d15b150dc134b7dc8c427ea142620e8bb29dd05be1a7efe1a py3-pdm-backend-2.4.4.tar.gz
56c7875d916c4893e2d0864b1b4d2bc668a30093d1c4572edf6d3754d05201e608ecf19202a97fcd0baac09474960ac2535cf03b265f01ccc65e1104c9871445 unvendor.patch
132a5188a88c13fa9d58fe86c38fa60ae1ebb7c1d6cd35a07679afe028ba9760abfc4668bea71963280e569ddef6d9a8352d4b4dcb88e62609329521d27cdcfb fix-scm-api-tests.patch
"