1a22e14
%global srcname Automat
1a22e14
%global libname automat
2bd5ba5
2bd5ba5
%global common_description %{expand:
Jeroen van Meeuwen (Kolab Systems) f0e32c4
Automat is a library for concise, idiomatic Python expression of finite-state
2bd5ba5
automata (particularly deterministic finite-state transducers).}
2bd5ba5
9555a12
Name:           python-%{srcname}
d58e36c
Version:        22.10.0
7733c38
Release:        %autorelease
2bd5ba5
Summary:        Self-service finite-state machines for the programmer on the go
2bd5ba5
2bd5ba5
License:        MIT
d2d419d
URL:            https://github.com/glyph/automat
940d3de
Source0:        %pypi_source
1104da8
2bd5ba5
BuildArch:      noarch
9555a12
BuildRequires:  python3-devel
b2c2450
BuildRequires:  python3dist(sphinx-rtd-theme)
Jeroen van Meeuwen (Kolab Systems) f0e32c4
1a22e14
%description %{common_description}
2bd5ba5
9555a12
%package -n     python3-%{srcname}
2bd5ba5
Summary:        %{summary}
91bcbc6
Provides:       python3-%{libname}
Jeroen van Meeuwen (Kolab Systems) f0e32c4
9555a12
%description -n python3-%{srcname} %{common_description}
9555a12
9555a12
%package -n python-%{srcname}-doc
4b909fc
Summary:        Automat documentation
b2c2450
9555a12
%description -n python-%{srcname}-doc
4b909fc
Documentation for Automat
4b909fc
2bd5ba5
%prep
1104da8
%autosetup  -p1 -n %{srcname}-%{version}
9555a12
7018ee1
# Backport of https://github.com/glyph/automat/commit/2bf0abddd9b532ef9dd90707a10a09ce48c24f3d
7018ee1
sed -i "s/py\.test/pytest/g" tox.ini
7018ee1
9555a12
%generate_buildrequires
9555a12
%pyproject_buildrequires -t
2bd5ba5
2bd5ba5
%build
9555a12
%pyproject_wheel
9555a12
e551e50
PYTHONPATH=%{pyproject_build_lib}  sphinx-build docs html
4b909fc
# remove the sphinx-build leftovers
4b909fc
rm -rf html/.{doctrees,buildinfo}
2bd5ba5
2bd5ba5
%install
9555a12
%pyproject_install
9555a12
%pyproject_save_files %{libname}
2bd5ba5
2bd5ba5
%check
9555a12
%tox
2bd5ba5
9555a12
%files -n python3-%{srcname} -f %{pyproject_files}
2bd5ba5
%{_bindir}/automat-visualize
2bd5ba5
9555a12
%files -n python-%{srcname}-doc
4b909fc
%doc html
4b909fc
%license LICENSE
4b909fc
2bd5ba5
%changelog
7733c38
%autochangelog