File python-python-telegram-bot.spec of Package python-python-telegram-bot
#
# spec file for package python-python-telegram-bot
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-python-telegram-bot
Version: 12.8
Release: 0
Summary: Python telegram bot
License: LGPL-3.0-only
Group: Development/Languages/Python
URL: https://github.com/python-telegram-bot/python-telegram-bot
Source: https://github.com/python-telegram-bot/python-telegram-bot/archive/v%{version}.tar.gz#/python-telegram-bot-%{version}.tar.gz
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# urllib3 is vendored! https://github.com/python-telegram-bot/python-telegram-bot/issues/1568
Requires: python-certifi
Requires: python-cryptography
Requires: python-decorator >= 4.4.0
Requires: python-tornado >= 5.1
Requires: python-urllib3
Suggests: python-PySocks
Suggests: python-ujson
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module beautifulsoup4}
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module cryptography}
BuildRequires: %{python_module decorator >= 4.4.0}
BuildRequires: %{python_module flaky}
#BuildRequires: %{python_module pytest-blockage}
BuildRequires: %{python_module pytest-socket}
BuildRequires: %{python_module pytest-percent}
BuildRequires: %{python_module pytest-timeout}
BuildRequires: %{python_module tornado >= 5.1}
BuildRequires: %{python_module urllib3}
# /SECTION
%python_subpackages
%description
Python telegram bot.
%prep
%setup -q -n python-telegram-bot-%{version}
rm -f tox.ini setup.cfg
rm -r telegram/vendor/ptb_urllib3
# tests/test_official.py setup import ptb_urllib3 and contacts internet
rm tests/test_official.py
find telegram -type f -exec sed -i '1{/^#!/d}' \{\} \;
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# test_dispatcher hangs
# The majority of the test suite has a sprinkling of tests that requires internet,
# but has no marks or interest in supporting offline testing.
%pytest -k 'not test_dispatcher' --disable-socket --required-percent=85
%files %{python_files}
%doc README.rst
%license LICENSE LICENSE.dual LICENSE.lesser
%{python_sitelib}/*
%changelog