git » python-structlog.git » main » tree

[main] / PKGBUILD

# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>

pkgname=python-structlog
# https://github.com/hynek/structlog/blob/main/CHANGELOG.md
pkgver=25.3.0
pkgrel=1
pkgdesc="Structured Logging for Python"
url="https://www.structlog.org"
# https://github.com/hynek/structlog/blob/24.2.0/pyproject.toml#L14
license=('MIT OR Apache-2.0')
arch=('any')
depends=('python')
# openssh needed to verify SSH signatures
makedepends=('git' 'openssh' 'python-build' 'python-installer'
             'python-hatchling' 'python-hatch-vcs' 'python-hatch-fancy-pypi-readme')
#checkdepends=('python-pytest' 'python-freezegun' 'python-pretend' 'python-simplejson'
#              'python-twisted' 'python-rapidjson' 'python-greenlet' 'python-pytest-asyncio'
#              'python-rich' 'python-better-exceptions')
optdepends=(
  'python-greenlet: for greenlet support in structlog.threadlocal (deprecated)'
  'python-twisted: for structlog.twisted'
  'python-rich: for structlog.dev'
  'python-better-exceptions: for structlog.dev'
)
# The PyPI tarball is signed, but missing conftest.py
source=("git+https://github.com/hynek/structlog.git#tag=$pkgver"
        "ssh_allowed_signers")

# XXX: move to verify() when devtools supports it
# https://gitlab.archlinux.org/archlinux/devtools/-/issues/224
prepare() {
  git -C structlog -c gpg.ssh.allowedSignersFile="$srcdir/ssh_allowed_signers" verify-tag $pkgver
}

pkgver() {
  cd structlog
  git describe --tags
}

build() {
  cd structlog
  python -m build --wheel --no-isolation
}

#check() {
#  cd structlog
  # Install to a temporary root for test_packaging
#  pyver=$(python -c "import sys; print('{}.{}'.format(*sys.version_info[:2]))")
#  python -m installer --destdir="$PWD/tmp_install" dist/*.whl
#  PYTHONPATH="$PWD/tmp_install/usr/lib/python$pyver/site-packages" pytest tests
#}

package() {
  cd structlog
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE-{APACHE,MIT} -t "$pkgdir"/usr/share/licenses/$pkgname
}
sha256sums=('b5a7cd53348060b74fb8633dbbe7e735870d342c5640c7785e08f35aa7e89f1f'
            '3c07fbe42c3d0dd845bc8fbe84b57bac8e006c527162c08d1e92c68d891968da')