From 3f28feaa71beae7560fcbc4b5547d5c6e2c2e673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=B5=A9=E5=8D=97?= Date: Sun, 19 Dec 2021 20:39:29 +0800 Subject: [PATCH] dev-python/python-telegram-bot: add new package (#1507) This package is pick from guru with version bump --- dev-python/python-telegram-bot/Manifest | 1 + dev-python/python-telegram-bot/metadata.xml | 12 ++++ .../python-telegram-bot-13.9.ebuild | 68 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 dev-python/python-telegram-bot/Manifest create mode 100644 dev-python/python-telegram-bot/metadata.xml create mode 100644 dev-python/python-telegram-bot/python-telegram-bot-13.9.ebuild diff --git a/dev-python/python-telegram-bot/Manifest b/dev-python/python-telegram-bot/Manifest new file mode 100644 index 0000000000..dbe60f2b98 --- /dev/null +++ b/dev-python/python-telegram-bot/Manifest @@ -0,0 +1 @@ +DIST python-telegram-bot-13.9.tar.gz 2132360 BLAKE2B 637f4163befb3001961e4519e06c07c7857897d01ee9adb15d42b9d0e25d9ba6828e3d885df3a493ae2254c21254111956b467afd2a4661e5b3ef607bbf11644 SHA512 4324d3fb6ff42a4ec7470b26f07ebaff423d436e30ae92fe210015ac8a716accdb5c437f145b356300eee8be26838592e8c51713b2b2daf9b79bb143e1cbdfce diff --git a/dev-python/python-telegram-bot/metadata.xml b/dev-python/python-telegram-bot/metadata.xml new file mode 100644 index 0000000000..c3e4fdfb4d --- /dev/null +++ b/dev-python/python-telegram-bot/metadata.xml @@ -0,0 +1,12 @@ + + + + + davidroman96@gmail.com + David Roman + + + chn@chn.moe + Haonan Chen + + diff --git a/dev-python/python-telegram-bot/python-telegram-bot-13.9.ebuild b/dev-python/python-telegram-bot/python-telegram-bot-13.9.ebuild new file mode 100644 index 0000000000..b442d165ea --- /dev/null +++ b/dev-python/python-telegram-bot/python-telegram-bot-13.9.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="Python wrapper of telegram bots API" +HOMEPAGE="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" +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 mirror" + +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}] + www-servers/tornado[${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}] +)" + +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 + + distutils-r1_python_prepare_all +}