testing/py3-structlog: move from user

This commit is contained in:
Antoine Martin 2023-08-30 13:48:38 -04:00
parent 41c2bc27e3
commit 463176a8b4
2 changed files with 50 additions and 35 deletions

View file

@ -0,0 +1,50 @@
# Maintainer:
pkgname=py3-structlog
pkgver=23.1.0
pkgrel=1
pkgdesc="Simple, powerful, and fast logging for Python"
url="https://github.com/hynek/structlog"
arch="noarch"
license="Apache-2.0 OR MIT"
makedepends="
py3-gpep517
py3-hatch-fancy-pypi-readme
py3-hatch-vcs
py3-hatchling
py3-wheel
"
checkdepends="
py3-coverage
py3-freezegun
py3-pretend
py3-pytest
py3-pytest-asyncio
py3-pytest-xdist
py3-rich
py3-simplejson
"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/hynek/structlog/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/structlog-$pkgver"
build() {
SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver \
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 pytest -n4
}
package() {
python3 -m installer -d "$pkgdir" \
dist/*.whl
}
sha512sums="
527f5811a3d2365490c55d8e1f1cc0537254d8667bfc56214769bd6aae9f5368a1534536f061dbc06213c32dd9253703f8535323466ddb66032c6c1f776814ac py3-structlog-23.1.0.tar.gz
"

View file

@ -1,35 +0,0 @@
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
_pyname=structlog
pkgname="py3-$_pyname"
pkgver=22.3.0
pkgrel=0
arch="noarch"
pkgdesc="Structured Logging for Python"
url="https://pypi.python.org/project/$_pyname"
license="Apache-2.0"
depends="python3 py3-greenlet py3-twisted py3-rich py3-hatch-fancy-pypi-readme"
makedepends="py3-build py3-installer py3-hatch-vcs py3-wheel"
checkdepends="py3-pytest py3-freezegun py3-pretend py3-simplejson py3-rapidjson py3-pytest-asyncio"
source="$pkgname-$pkgver.tar.gz::https://pypi.io/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz"
builddir="$srcdir"/$_pyname-$pkgver
build() {
python3 -m build --wheel --no-isolation
}
check() {
# Install to a temporary root for test_packaging
pyver=$(python3 -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
python3 -m installer --destdir="$srcdir/tmp_install" dist/*.whl
PYTHONPATH="$srcdir"/tmp_install/usr/lib/python$pyver/site-packages pytest tests || true
}
package() {
python3 -m installer --destdir="$pkgdir" dist/*.whl
install -Dm644 LICENSE-APACHE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
sha512sums="
3326c597c2029ec544a1c47f4fcb848929ea1f6e9bb75bc8566a1a6b1e020e8ff2f330336b3c25431223994d7accb8f51bb302fe7226170b7ab977277aaa1740 py3-structlog-22.3.0.tar.gz
"