archrelease: copy trunk to community-any
[ArchLinux/community.git] / python-authlib / repos / community-any / PKGBUILD
blobe23a0ae976d0a6ae8d60f482dda7bb2658c98044
1 # Maintainer: Eli Schwartz <eschwartz@archlinux.org>
3 _pkgname=authlib
4 pkgname=python-authlib
5 pkgver=1.2.0
6 pkgrel=2
7 pkgdesc="The ultimate Python library in building OAuth and OpenID Connect servers"
8 arch=('any')
9 url="https://github.com/lepture/authlib"
10 license=('BSD')
11 depends=('python-cryptography')
12 makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
13 checkdepends=('python-pytest-asyncio' 'python-pytest-django' 'python-requests'
14               'python-django' 'python-flask-sqlalchemy' 'python-httpx' 'python-starlette' 'python-cachelib')
15 source=("https://github.com/lepture/authlib/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
16 sha256sums=('049a3850f3c6d0dfa1b9cdcc6527aac7bcc7b1813c6829c6351dacf30c9975e4')
17 validpgpkeys=('72F8E895A70CEBDF4F2ADFE07E55E3E0118B2B4C') # Hsiaoming (UJET) <lepture@ujet.co>
19 prepare() {
20   cd ${_pkgname}-$pkgver
22   # no need to install an additional copy of the stdlib
23   find tests -name \*.py -exec sed -i 's/^import mock$/from unittest import mock/' {} +
26 build() {
27   cd ${_pkgname}-$pkgver
29   python -m build --wheel --no-isolation
32 check() {
33   cd ${_pkgname}-$pkgver
35   export PYTHONPATH="$PWD"
36   pytest tests/core -v
37   pytest tests/flask -v
38 # https://github.com/lepture/authlib/issues/456
39   pytest tests/jose -v -k 'not (test_dir_alg_xc20p or test_xc20p_content_encryption_decryption)'
40   export DJANGO_SETTINGS_MODULE=tests.clients.test_django.settings
41   pytest tests/clients -v
42   export DJANGO_SETTINGS_MODULE=tests.django.settings
43   pytest tests/django -v
46 package() {
47   cd ${_pkgname}-$pkgver
49   python -m installer --destdir="${pkgdir}" dist/*.whl
50   install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE