Blob Blame History Raw
%global srcname constantly

%global common_description %{expand:
A library that provides symbolic constant support. It includes collections and
constants with text, numeric, and bit flag values. Originally
twisted.python.constants from the Twisted project.}

Name:           python-%{srcname}
Version:        15.1.0
Release:        %autorelease
Summary:        Symbolic constants in Python

License:        MIT
Source0:        %url/archive/%{version}/%{srcname}-%{version}.tar.gz
# Refresh now generated with versioneer 0.21

BuildArch:      noarch
BuildRequires:  python3-devel
BuildRequires:  python3dist(sphinx-rtd-theme)

# the tests are enabled by default but can be disabled
# to avoid a circular dependency on twisted->constantly
%bcond tests 1
%if %{with tests}
BuildRequires:  python3dist(twisted)

%description %{common_description}

%package -n     python3-%{srcname}
Summary:        %{summary}

%description -n python3-%{srcname} %{common_description}

%package doc
Summary:        Documentation for %{name}

%description doc

This is the documentation package for %{name}.

%autosetup -p1 -n %{srcname}-%{version}

%pyproject_buildrequires %{?with_tests:-t}


PYTHONPATH=%{pyproject_build_lib} sphinx-build docs html
# remove the sphinx-build leftovers
rm -rf html/.{doctrees,buildinfo}

%pyproject_save_files %{srcname}

%if %{with tests}

%files -n python3-%{srcname} -f %{pyproject_files}

%files -n python-%{srcname}-doc
%doc html
%license LICENSE