## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global pypi_name Telethon %global pypi_version 1.32.1 %global import_name telethon Name: python-%{import_name} Version: %{pypi_version} Release: %autorelease Summary: Full-featured Telegram client library for Python 3 License: MIT URL: https://github.com/LonamiWebs/Telethon # Source on Pypi does not have tests Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(tox) %description Telethon is an asyncio_ Python 3 MTProto_ library to interact with Telegram API as a user or through a bot account (bot API alternative) %package -n python3-%{import_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} %description -n python3-%{import_name} Telethon is an asyncio_ Python 3 MTProto_ library to interact with Telegram API as a user or through a bot account (bot API alternative) %prep %autosetup -n %{pypi_name}-%{pypi_version} sed -i '/pytest-cov/d' dev-requirements.txt # Use current python version in test environment sed -i "/envlist/c\envlist=py%{python3_version_nodots}" pyproject.toml # do not install dependencies using pip sed -i "/deps =/d" pyproject.toml sed -i "/requirements.txt/d" pyproject.toml sed -i "/flake8/d" pyproject.toml %generate_buildrequires %pyproject_buildrequires -r dev-requirements.txt %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{import_name} %check # Run passing tests %{py3_test_envvars} %python3 -m pytest tests/telethon/test_helpers.py %{py3_test_envvars} %python3 -m pytest tests/telethon/test_pickle.py %{py3_test_envvars} %python3 -m pytest tests/telethon/client/test_messages.py %{py3_test_envvars} %python3 -m pytest tests/telethon/crypto/test_rsa.py %{py3_test_envvars} %python3 -m pytest tests/telethon/events/test_chataction.py %{py3_test_envvars} %python3 -m pytest tests/telethon/tl/test_serialization.py %files -n python3-%{import_name} -f %{pyproject_files} %doc README.rst %changelog * Thu Nov 23 2023 John Doe - 1.32.1-1 - Uncommitted changes