%global modname pywikibot Name: python-pywikibot Version: 10.3.2 Release: %autorelease Summary: A Python library that interfaces with the MediaWiki API License: MIT URL: https://github.com/wikimedia/pywikibot Source: %{url}/archive/%{version}/%{modname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel # fix import error on pyproject_check_import: pywikibot.data.mysql (optional dependency) BuildRequires: python3-PyMySQL %global _description %{expand: Pywikibot is a Python library and collection of tools that automate work on MediaWiki sites. Originally designed for Wikipedia, it is now used throughout the Wikimedia Foundation’s projects and on many other MediaWiki wikis. } %description %_description %package -n python3-%{modname} Summary: %{summary} %description -n python3-%{modname} %_description %prep %autosetup -p1 -n %{modname}-%{version} # Remove shebang from scripts which are not executable after installation. # (Otherwise rpminspect complains.) # Calling them as intended through the `pwb` executable works just fine. sed -i '/#!\/usr\/bin\/env python3$/d' pywikibot/scripts/*.py %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{modname} -l %check # py-memento-client is an optional dependency and not packaged anywhere, # therefore skipping that import %pyproject_check_import -e pywikibot.data.memento %tox %files -n python3-%{modname} -f %{pyproject_files} %doc README.* %doc ROADMAP.rst %doc HISTORY.rst %{_bindir}/pwb %changelog %autochangelog