Files
gentoo/dev-python/authlib/authlib-1.8.0.ebuild
2026-08-31 11:42:13 +02:00

69 lines
1.6 KiB
Bash

# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517="setuptools"
PYTHON_COMPAT=( python3_{12..15} )
inherit distutils-r1
DESCRIPTION="A Python library in building OAuth and OpenID Connect servers and clients"
HOMEPAGE="
https://authlib.org/
https://github.com/authlib/authlib/
https://pypi.org/project/Authlib/
"
# pypi source distribution excludes the tests
SRC_URI="
https://github.com/authlib/authlib/archive/refs/tags/v${PV}.tar.gz
-> ${P}.gh.tar.gz
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="django test"
RESTRICT="!test? ( test )"
RDEPEND="
>=dev-python/cryptography-45.0.1[${PYTHON_USEDEP}]
>=dev-python/joserfc-1.6.1[${PYTHON_USEDEP}]
django? (
>=dev-python/django-3.2.9[${PYTHON_USEDEP}]
)
"
BDEPEND="
test? (
dev-python/anyio[${PYTHON_USEDEP}]
dev-python/cachelib[${PYTHON_USEDEP}]
dev-python/django[${PYTHON_USEDEP}]
dev-python/flask[${PYTHON_USEDEP}]
dev-python/httpx[${PYTHON_USEDEP}]
dev-python/httpx2[${PYTHON_USEDEP}]
dev-python/joserfc[${PYTHON_USEDEP}]
>=dev-python/pycryptodome-3.10[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/starlette[${PYTHON_USEDEP}]
)
"
EPYTEST_PLUGINS=( pytest-{asyncio,env} )
# EPYTEST_XDIST makes tests flaky
distutils_enable_tests pytest
src_prepare() {
distutils-r1_src_prepare
# convert from pycryptodomex to pycryptodome
sed -i -e 's:from Cryptodome:from Crypto:' \
authlib/jose/drafts/_jwe_enc_cryptodome.py || die
}
python_test() {
epytest tests/{core,jose,clients}
# TODO: django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
#epytest tests/django
}