%{!?dotests: %define dotests 1} %define name python3-sphinxcontrib-trio %define srcname sphinxcontrib-trio %define version 1.1.0 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: sphinx extension to document python code Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Url: http://sphinx-doc.org/ License: BSD Group: Development/Libraries BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Prefix: %{_prefix} BuildArch: noarch Patch1: tests-sphinx-build.patch BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-sphinx >= 2.3.0 BuildRequires: python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 Requires: python3 >= 3.7.3 #for running test cases pip install cssselect, lxml %description This sphinx extension helps you document Python code that uses async/await, or abstract methods, or context managers, or generators, or … you get the idea. It works by making sphinx’s regular directives for documenting Python functions and methods smarter and more powerful. The name is because it was originally written for the Trio project, and I’m not very creative. But don’t be put off – there’s nothing Trio- or async-specific about this extension; any Python project can benefit. %prep %setup -q -n %{srcname}-%{version} %patch1 -p0 %build export OBJECT_MODE=64 python3 setup.py build if [ "%{dotests}" == 1 ] then ( python3 -m pytest ) fi %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc README.rst LICENSE %{python_sitelib}/* %changelog * Thu Dec 12 2019 Baanu Tumma - 1.1.0-1 - Initial build for AIX Toolbox, built using python3