dev-python/python-telegram-bot: update EAPI 7 -> 8

Signed-off-by: David Roman <davidroman96@gmail.com>
This commit is contained in:
David Roman
2023-10-02 17:51:15 +02:00
parent b691e5f39b
commit 9afb9c85a7
2 changed files with 36 additions and 710 deletions

View File

@@ -1,68 +1,61 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
PYTHON_COMPAT=( python3_10 )
inherit distutils-r1
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..12} )
inherit distutils-r1 optfeature
DESCRIPTION="Python wrapper of telegram bots API"
HOMEPAGE="https://python-telegram-bot.org https://github.com/python-telegram-bot/python-telegram-bot"
HOMEPAGE="https://docs.python-telegram-bot.org https://github.com/python-telegram-bot/python-telegram-bot"
if [[ ${PV} == *9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/python-telegram-bot/python-telegram-bot"
else
SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-3"
LICENSE="LGPL-3"
SLOT="0"
# This error is really strange
# UserWarning: python-telegram-bot is using upstream urllib3. This is allowed but not supported by python-telegram-bot maintainers.
RESTRICT="test"
IUSE=""
RDEPEND="
dev-python/certifi[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}]
dev-python/decorator[${PYTHON_USEDEP}]
dev-python/future[${PYTHON_USEDEP}]
dev-python/PySocks[${PYTHON_USEDEP}]
dev-python/ujson[${PYTHON_USEDEP}]
dev-python/urllib3[${PYTHON_USEDEP}]
dev-python/tornado[${PYTHON_USEDEP}]
>=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}]
)
"
DEPEND="test? (
dev-python/APScheduler[${PYTHON_USEDEP}]
dev-python/attrs[${PYTHON_USEDEP}]
dev-python/beautifulsoup4[${PYTHON_USEDEP}]
dev-python/flaky[${PYTHON_USEDEP}]
dev-python/pytest-timeout[${PYTHON_USEDEP}]
dev-python/pytz[${PYTHON_USEDEP}]
dev-python/yapf[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}/${P}-no-internet-tests.patch"
)
distutils_enable_tests pytest
distutils_enable_sphinx docs/source dev-python/sphinx-rtd-theme
# Run only the tests that don't require a connection
python_test() {
epytest -m no_req
}
python_prepare_all() {
# do not make a test flaky report
sed -i -e '/addopts/d' setup.cfg || die
sed -i 's/from telegram.vendor.ptb_urllib3 //g' tests/test_*.py
sed -i 's/telegram.vendor.ptb_urllib3.urllib3/urllib3/g' tests/test_*.py
# Remove tests files that require network access
rm tests/test_{animation,audio,bot,commandhandler,constants,conversationhandler}.py || die
rm tests/test_{dispatcher,document,forcereply,inlinekeyboardmarkup,inputmedia}.py || die
rm tests/test_{invoice,jobqueue,official,parsemode,persistence,photo,sticker,updater}.py || die
rm tests/test_replykeyboard{markup,remove}.py || die
rm tests/test_{video,videonote,voice}.py || die
distutils-r1_python_prepare_all
}
pkg_postinst() {
optfeature_header "Optional package dependencies:"
optfeature "using telegram.ext.JobQueue" dev-python/APScheduler
}