%global pypi_name uritools Name: python-%{pypi_name} Version: 4.0.2 Release: %autorelease Summary: URI parsing, classification and composition License: MIT URL: https://github.com/tkem/uritools Source: %url/archive/v%{version}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(pytest) BuildRequires: python3dist(sphinx) %global common_description %{expand: This module provides RFC 3986 compliant functions for parsing, classifying and composing URIs and URI references, largely replacing the Python Standard Library's urllib.parse module.} %description %{common_description} %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %{common_description} %package -n python-%{pypi_name}-doc Summary: Documentation for python-%{pypi_name} BuildArch: noarch %description -n python-%{pypi_name}-doc %{common_description} This package is providing the documentation for %{pypi_name}. %prep %autosetup -p1 -n %{pypi_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel # generate html docs sphinx-build-3 -b html docs/ html # remove the sphinx-build-3 leftovers rm -rf html/.{doctrees,buildinfo} %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pytest %files -n python3-%{pypi_name} -f %{pyproject_files} %doc CHANGELOG.rst README.rst %license LICENSE %files -n python-%{pypi_name}-doc %doc html %license LICENSE %changelog %autochangelog