Blob Blame History Raw
# what it's called on pypi
%global srcname Automat
# what it's imported as
%global libname automat

%global common_description %{expand:
Automat is a library for concise, idiomatic Python expression of finite-state
automata (particularly deterministic finite-state transducers).}

%bcond_without  check

Name:           python-%{srcname}
Version:        20.2.0
Release:        %autorelease
Summary:        Self-service finite-state machines for the programmer on the go

License:        MIT
Source0:        %pypi_source
Patch0:         0001-Use-CodeType.replace-in-copycode-for-Python-3.8.patch

BuildArch:      noarch
BuildRequires:  python3-devel

%description %{common_description}

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

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

%package -n python-%{srcname}-doc
Summary:        Automat documentation
%description -n python-%{srcname}-doc
Documentation for Automat

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

%pyproject_buildrequires -t
echo 'python3dist(sphinx-rtd-theme)'


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

%pyproject_save_files %{libname}

%if %{with check}

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

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