2024-08-17 15:20:00 +09:00
|
|
|
# Copyright 2023-2024 Gentoo Authors
|
2020-03-12 20:38:09 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
EAPI=8
|
2020-03-12 20:38:09 +01:00
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
DISTUTILS_USE_PEP517=setuptools
|
2025-02-20 18:56:40 +05:00
|
|
|
PYTHON_COMPAT=( python3_{11..12} )
|
2023-10-02 17:51:15 +02:00
|
|
|
inherit distutils-r1 optfeature
|
2020-03-12 20:38:09 +01:00
|
|
|
|
|
|
|
|
DESCRIPTION="Python wrapper of telegram bots API"
|
2023-10-02 17:51:15 +02:00
|
|
|
HOMEPAGE="https://docs.python-telegram-bot.org https://github.com/python-telegram-bot/python-telegram-bot"
|
2020-03-12 20:38:09 +01:00
|
|
|
|
|
|
|
|
if [[ ${PV} == *9999 ]]; then
|
|
|
|
|
inherit git-r3
|
|
|
|
|
EGIT_REPO_URI="https://github.com/python-telegram-bot/python-telegram-bot"
|
|
|
|
|
else
|
2020-03-13 13:33:07 +01:00
|
|
|
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
2024-08-17 15:20:00 +09:00
|
|
|
KEYWORDS="~amd64"
|
2020-03-12 20:38:09 +01:00
|
|
|
fi
|
|
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
LICENSE="LGPL-3"
|
2020-03-12 20:38:09 +01:00
|
|
|
SLOT="0"
|
2022-09-17 13:32:23 +02:00
|
|
|
|
2020-03-12 20:38:09 +01:00
|
|
|
RDEPEND="
|
2023-10-02 17:51:15 +02:00
|
|
|
>=dev-python/cachetools-5.3.0[${PYTHON_USEDEP}]
|
|
|
|
|
>=dev-python/cryptography-39.0.1[${PYTHON_USEDEP}]
|
|
|
|
|
>=dev-python/httpx-0.24.0[${PYTHON_USEDEP}]
|
|
|
|
|
>=dev-python/tornado-6.2[${PYTHON_USEDEP}]
|
|
|
|
|
dev-python/setuptools[${PYTHON_USEDEP}]
|
|
|
|
|
"
|
|
|
|
|
BDEPEND="
|
|
|
|
|
test? (
|
|
|
|
|
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
|
|
|
|
|
dev-python/flaky[${PYTHON_USEDEP}]
|
|
|
|
|
dev-python/pytest[${PYTHON_USEDEP}]
|
|
|
|
|
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
|
|
|
|
|
dev-python/pytz[${PYTHON_USEDEP}]
|
|
|
|
|
>=dev-python/tornado-6.2[${PYTHON_USEDEP}]
|
|
|
|
|
)
|
2020-03-12 20:38:09 +01:00
|
|
|
"
|
|
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
PATCHES=(
|
|
|
|
|
"${FILESDIR}/${P}-no-internet-tests.patch"
|
|
|
|
|
)
|
2020-03-12 20:38:09 +01:00
|
|
|
|
2020-03-13 13:33:07 +01:00
|
|
|
distutils_enable_tests pytest
|
|
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
# Run only the tests that don't require a connection
|
|
|
|
|
python_test() {
|
|
|
|
|
epytest -m no_req
|
|
|
|
|
}
|
2020-03-13 13:33:07 +01:00
|
|
|
|
2023-10-02 17:51:15 +02:00
|
|
|
python_prepare_all() {
|
2020-03-13 13:33:07 +01:00
|
|
|
distutils-r1_python_prepare_all
|
|
|
|
|
}
|
2023-10-02 17:51:15 +02:00
|
|
|
|
|
|
|
|
pkg_postinst() {
|
|
|
|
|
optfeature_header "Optional package dependencies:"
|
|
|
|
|
optfeature "using telegram.ext.JobQueue" dev-python/APScheduler
|
|
|
|
|
}
|