Date: Friday, November 8, 2019 @ 23:24:14
  Author: foutrelis
Revision: 524727

upgpkg: python-telegram-bot 12.2.0-1

New upstream release.

Added:
  python-telegram-bot/trunk/fix-tests.patch
Modified:
  python-telegram-bot/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   17 +++++++++--------
 fix-tests.patch |   41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2019-11-08 23:13:02 UTC (rev 524726)
+++ PKGBUILD    2019-11-08 23:24:14 UTC (rev 524727)
@@ -1,7 +1,7 @@
 # Maintainer: Felix Yan <[email protected]>
 
 pkgname=python-telegram-bot
-pkgver=11.1.0
+pkgver=12.2.0
 pkgrel=1
 pkgdesc="A pure Python interface for the Telegram Bot AP"
 url="https://github.com/python-telegram-bot/python-telegram-bot";
@@ -9,17 +9,18 @@
 arch=('any')
 depends=('python-cryptography' 'python-future' 'python-tornado' 
'python-urllib3')
 makedepends=('python-setuptools')
-checkdepends=('python-pytest' 'python-beautifulsoup4' 'python-flaky')
+checkdepends=('python-pytest' 'python-beautifulsoup4' 'python-flaky'
+              'python-pytest-timeout')
 
source=("$pkgname-$pkgver.tar.gz::https://github.com/python-telegram-bot/python-telegram-bot/archive/v$pkgver.tar.gz";
-        
https://github.com/python-telegram-bot/python-telegram-bot/commit/9d99660ba95b103b3e1dc80414a5ce2fd805260b.patch)
-sha512sums=('89069ac8f5b5255f69fb88c36f2af11ad96b6835bda1e3bd9367ee552b0464d574fb4d3fc32b2f14cf2fc94af1772df002e37d8137ed0f649a53bbb2c0ba6051'
-            
'd3acc49c24a6c747923b04c617ee322256acb3d7c22e188908563b7957c8756381757a007817cbaf6a7e0c5a13d28de66086774b9f2a8a5d278d0c6cf74b197a')
+        fix-tests.patch)
+sha512sums=('c29c9750cef5b2baad54b8e9e5aee0ba1459557439ce8961733b00c67d678b0da87e91b973a847da4781ae2ba20c1d869d9dacd713f4d89f428c784b5a818bd8'
+            
'19a70af0cbfa12e4f3312cb8332dbd3f7964306594df2f46ba276de32636090ce3571a4272f9ce5a14471514f62159bcabba136cf956ce8c5b8a075de29f8185')
 
 prepare() {
   cd python-telegram-bot-$pkgver
-  # https://github.com/python-telegram-bot/python-telegram-bot/pull/1262
-  patch -p1 -i ../9d99660ba95b103b3e1dc80414a5ce2fd805260b.patch
 
+  patch -Np1 -i ../fix-tests.patch
+
   sed -i '/certifi/d' telegram/__main__.py requirements.txt
   sed -e '/import certifi/d' \
       -e 's|certifi.where()|"/etc/ssl/certs/ca-certificates.crt"|' \
@@ -27,7 +28,7 @@
   sed -e 's/import telegram.vendor.ptb_urllib3.urllib3/import urllib3/' \
       -e 's/from telegram.vendor.ptb_urllib3.urllib3/from urllib3/' \
       -e 's/from telegram.vendor.ptb_urllib3 import urllib3/import urllib3/' \
-      -i telegram/utils/request.py tests/test_official.py
+      -i telegram/utils/request.py tests/test_{bot,official}.py
 }
 
 build() {

Added: fix-tests.patch
===================================================================
--- fix-tests.patch                             (rev 0)
+++ fix-tests.patch     2019-11-08 23:24:14 UTC (rev 524727)
@@ -0,0 +1,41 @@
+diff -upr python-telegram-bot-12.2.0.orig/tests/test_constants.py 
python-telegram-bot-12.2.0/tests/test_constants.py
+--- python-telegram-bot-12.2.0.orig/tests/test_constants.py    2019-10-14 
21:12:13.000000000 +0300
++++ python-telegram-bot-12.2.0/tests/test_constants.py 2019-11-09 
01:18:12.242634772 +0200
+@@ -29,8 +29,7 @@ class TestConstants(object):
+     def test_max_message_length(self, bot, chat_id):
+         bot.send_message(chat_id=chat_id, text='a' * 
constants.MAX_MESSAGE_LENGTH)
+ 
+-        with pytest.raises(BadRequest, match='Message is too long',
+-                           message='MAX_MESSAGE_LENGTH is no longer valid'):
++        with pytest.raises(BadRequest, match='Message is too long'):
+             bot.send_message(chat_id=chat_id, text='a' * 
(constants.MAX_MESSAGE_LENGTH + 1))
+ 
+     @flaky(3, 1)
+@@ -42,7 +41,6 @@ class TestConstants(object):
+         assert good_msg.caption == good_caption
+ 
+         bad_caption = good_caption + 'Z'
+-        with pytest.raises(BadRequest, match="Media_caption_too_long",
+-                           message='MAX_CAPTION_LENGTH is no longer valid'):
++        with pytest.raises(BadRequest, match="Media_caption_too_long"):
+             with open('tests/data/telegram.png', 'rb') as f:
+                 bot.send_photo(photo=f, caption=bad_caption, chat_id=chat_id)
+diff -upr python-telegram-bot-12.2.0.orig/tests/test_meta.py 
python-telegram-bot-12.2.0/tests/test_meta.py
+--- python-telegram-bot-12.2.0.orig/tests/test_meta.py 2019-10-14 
21:12:13.000000000 +0300
++++ python-telegram-bot-12.2.0/tests/test_meta.py      2019-11-09 
01:17:23.231591903 +0200
+@@ -28,7 +28,6 @@ def call_pre_commit_hook(hook_id):
+     return os.system(' '.join(['pre-commit', 'run', '--all-files', hook_id])) 
 # pragma: no cover
+ 
+ 
[email protected]
+ @pytest.mark.parametrize('hook_id', argvalues=('yapf', 'flake8', 'pylint'))
+ @pytest.mark.skipif(not (os.getenv('TRAVIS') or os.getenv('APPVEYOR')), 
reason='Not running in CI')
+ @pytest.mark.skipif(not sys.version_info[:2] == (3, 6) or 
python_implementation() != 'CPython',
+@@ -38,7 +37,6 @@ def test_pre_commit_hook(hook_id):
+     assert call_pre_commit_hook(hook_id) == 0  # pragma: no cover
+ 
+ 
[email protected]
+ @pytest.mark.skipif(
+     not sys.version_info[:2] in ((3, 6), (2, 7)) or python_implementation() 
!= 'CPython',
+     reason='Only testing build on 2.7 and 3.6')

Reply via email to