diff options
Diffstat (limited to 'dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild')
| -rw-r--r-- | dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild | 77 |
1 files changed, 35 insertions, 42 deletions
diff --git a/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild b/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild index a9daa2f8df45..01b17e71e33b 100644 --- a/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild +++ b/dev-python/python-telegram-bot/python-telegram-bot-9999.ebuild @@ -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 +DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{8,9,10,11} ) - -inherit distutils-r1 +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 - -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 +# Run only the tests that don't require a connection +python_test() { + epytest -m no_req +} +python_prepare_all() { distutils-r1_python_prepare_all } + +pkg_postinst() { + optfeature_header "Optional package dependencies:" + optfeature "using telegram.ext.JobQueue" dev-python/APScheduler +} |
