summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2022-04-01 20:31:42 +0200
committerAntonio Rojas2022-04-01 20:31:42 +0200
commitcac7302cbf6f8c5c5cdf581adb73e09ab249f8d1 (patch)
treef7387f50d1985ec21af8d569d321f1d41a3cfaa6
parent5b0bb7f5ed57aa50ef808babdfaedd8bc144b061 (diff)
downloadaur-cac7302cbf6f8c5c5cdf581adb73e09ab249f8d1.tar.gz
import from community
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD88
2 files changed, 67 insertions, 44 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 158dfb07b00c..b3bebb07c695 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,17 +1,22 @@
pkgbase = python-telegram-bot
- pkgdesc = A Python wrapper around the Telegram Bot API
- pkgver = 11.1.0
+ pkgdesc = A pure Python interface for the Telegram Bot AP
+ pkgver = 13.11
pkgrel = 1
url = https://github.com/python-telegram-bot/python-telegram-bot
arch = any
- license = LGPL3
+ license = LGPL
+ checkdepends = python-beautifulsoup4
+ checkdepends = python-flaky
+ checkdepends = python-pytest-timeout
makedepends = python-setuptools
- depends = python-future
+ depends = python-apscheduler
+ depends = python-cryptography
+ depends = python-tornado
+ depends = python-ujson
depends = python-urllib3
- optdepends = python-ujson: Ultra fast JSON parsing
- optdepends = python-pysocks: SOCKS or HTTP proxy
- source = https://github.com/python-telegram-bot/python-telegram-bot/releases/download/v11.1.0/python-telegram-bot-11.1.0.tar.gz
- sha256sums = cca4e32ebb8da7fdf35ab2fa2b3edd441211364819c5592fc253acdb7561ea5b
+ depends = python-pytz
+ depends = python-cachetools
+ source = https://github.com/python-telegram-bot/python-telegram-bot/archive/v13.11/python-telegram-bot-13.11.tar.gz
+ sha512sums = 8ccae24ad577da18aba9428e006406627d018004fea7f52217e805a49c73a74ba22cd4785c38b34a2cd6df899e1ceed89cccbc2f9fd8a7af5292a89032d4da3a
pkgname = python-telegram-bot
-
diff --git a/PKGBUILD b/PKGBUILD
index 26a563ebc6de..0c0732bf2ee3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,45 +1,63 @@
-# Maintainer: Sean Enck <enckse@gmail.com>
-# Maintainer: Sherlock Holo <sherlockya(at)gmail.com>
+# Maintainer: Felix Yan <felixonmars@archlinux.org>
+
pkgname=python-telegram-bot
-pkgver=11.1.0
+pkgver=13.11
pkgrel=1
-pkgdesc="A Python wrapper around the Telegram Bot API"
+pkgdesc="A pure Python interface for the Telegram Bot AP"
url="https://github.com/python-telegram-bot/python-telegram-bot"
-depends=('python-future' 'python-urllib3')
+license=('LGPL')
+arch=('any')
+depends=('python-apscheduler' 'python-cryptography' 'python-tornado'
+ 'python-ujson' 'python-urllib3' 'python-pytz' 'python-cachetools')
makedepends=('python-setuptools')
-optdepends=('python-ujson: Ultra fast JSON parsing'
- 'python-pysocks: SOCKS or HTTP proxy')
+checkdepends=('python-beautifulsoup4' 'python-flaky' 'python-pytest-timeout')
+source=("https://github.com/python-telegram-bot/python-telegram-bot/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
+sha512sums=('8ccae24ad577da18aba9428e006406627d018004fea7f52217e805a49c73a74ba22cd4785c38b34a2cd6df899e1ceed89cccbc2f9fd8a7af5292a89032d4da3a')
-license=('LGPL3')
-arch=('any')
-#source=("https://pypi.python.org/packages/f9/89/b946d746abb68588efd57297a9490ccc2e9faaae6c5f20712495d132588e/python-telegram-bot-10.0.0.tar.gz")
-source=("https://github.com/python-telegram-bot/python-telegram-bot/releases/download/v$pkgver/python-telegram-bot-$pkgver.tar.gz")
-sha256sums=('cca4e32ebb8da7fdf35ab2fa2b3edd441211364819c5592fc253acdb7561ea5b')
-
-prepare(){
- cd $srcdir
- bsdtar -xf $pkgname-$pkgver.tar.gz
- #cp $srcdir/request.patch $srcdir/$pkgname-$pkgver/telegram/utils/
+prepare() {
+ cd $pkgname-$pkgver
+
+ rm -r telegram/vendor
+
+ # Use system cert store
+ sed -i '/certifi/d' telegram/__main__.py requirements.txt
+ sed -e '/import certifi/d' \
+ -e 's|certifi.where()|"/etc/ssl/certs/ca-certificates.crt"|' \
+ -i telegram/utils/request.py tests/test_official.py
+
+ # Fixes for new pytest
+ sed -i '/pytest.mark.nocoverage/d' tests/test_meta.py
+ sed -i '/ message=/d' tests/test_constants.py
+
+ # Fixes for testing with system urllib3
+ sed -i 's/from telegram.vendor.ptb_urllib3 import urllib3/import urllib3/' tests/test_official.py
+ sed -i 's/from telegram.vendor.ptb_urllib3.urllib3/from urllib3/' tests/test_bot.py
+ sed -e '/telegram.utils.deprecate.TelegramDeprecationWarning/i \ ignore:python-telegram-bot is using upstream urllib3. This is allowed but not supported by python-telegram-bot maintainers.:UserWarning' \
+ -i setup.cfg
+
+ # Spacing difference
+ sed -i 's/"switch_inline_query": ""/"switch_inline_query":""/;s/"switch_inline_query_current_chat": ""/"switch_inline_query_current_chat":""/' tests/test_inlinekeyboardmarkup.py
+}
+
+build() {
+ cd $pkgname-$pkgver
+ python setup.py build --with-upstream-urllib3
}
-build(){
- cd $srcdir/$pkgname-$pkgver
- rm -rf telegram/vendor
- sed '/certifi/d' requirements.txt -i
- #patch -p0 -i setup.patch
- cd telegram/utils
- #patch -p0 -i request.patch
- sed -i 's/import telegram.vendor.ptb_urllib3.urllib3 as urllib3/import urllib3 as urllib3/g' request.py
- sed -i 's/import telegram.vendor.ptb_urllib3.urllib3.contrib.appengine as appengine/import urllib3.contrib.appengine as appengine/g' request.py
- sed -i 's/from telegram.vendor.ptb_urllib3.urllib3.connection import HTTPConnection/from urllib3.connection import HTTPConnection/g' request.py
- sed -i 's/from telegram.vendor.ptb_urllib3.urllib3.util.timeout import Timeout/from urllib3.util.timeout import Timeout/g' request.py
- sed -i "s/certifi.where()/\"\/etc\/ssl\/certs\/ca-certificates.crt\"/g" request.py
- sed -i 's/import certifi//g' request.py
- cd $srcdir/$pkgname-$pkgver
- python setup.py build
+check() {
+ cd $pkgname-$pkgver
+ # test_run_monthly: fails on upstream ci too
+ # test_get_updates_bailout_err: seems to be a test error TODO
+ # test_deprecation_warnings_start_webhook: fails due to DeprecationWarning
+ # test_clean_deprecation_warning_polling: fails due to DeprecationWarning
+ python -m pytest \
+ --deselect tests/test_jobqueue.py::TestJobQueue::test_run_monthly \
+ --deselect tests/test_updater.py::TestUpdater::test_get_updates_bailout_err \
+ --deselect tests/test_updater.py::TestUpdater::test_deprecation_warnings_start_webhook \
+ --deselect tests/test_updater.py::TestUpdater::test_clean_deprecation_warning_polling
}
-package(){
- cd $srcdir/$pkgname-$pkgver
- python setup.py install --skip-build --root="$pkgdir" --optimize=1
+package() {
+ cd $pkgname-$pkgver
+ python setup.py install --root="$pkgdir" --optimize=1 --with-upstream-urllib3
}