[packages/python3-automat] - up to 24.8.1

baggins baggins at pld-linux.org
Tue Apr 8 02:29:10 CEST 2025


commit f47af5078ef9e1c782ea754764d7e54e4697031a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Apr 8 01:37:34 2025 +0200

    - up to 24.8.1

 no-git.patch         |  26 ++++++++
 python-automat.spec  | 172 ---------------------------------------------------
 python3-automat.spec | 108 ++++++++++++++++++++++++++++++++
 3 files changed, 134 insertions(+), 172 deletions(-)
---
diff --git a/python-automat.spec b/python-automat.spec
deleted file mode 100644
index 460868a..0000000
--- a/python-automat.spec
+++ /dev/null
@@ -1,172 +0,0 @@
-#
-# Conditional build:
-%bcond_without	doc	# Sphinx documentation
-%bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
-
-Summary:	Self-service finite-state machines for the programmer on the go
-Summary(pl.UTF-8):	Bezobsługowe automaty skończone dla programisty w biegu
-Name:		python-automat
-# note: despite classifiers, 22.10.0 is not compatible with python 2.7 (uses inspect.getfullargspec), so keep 20.x here
-Version:	20.2.0
-Release:	7
-License:	MIT
-Group:		Libraries/Python
-#Source0Download: https://pypi.org/simple/automat/
-Source0:	https://files.pythonhosted.org/packages/source/a/automat/Automat-%{version}.tar.gz
-# Source0-md5:	d6cef9886b037b8857bfbc686f3ae30a
-URL:		https://pypi.org/project/Automat/
-%if %{with python2}
-BuildRequires:	python-m2r
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-setuptools
-BuildRequires:	python-setuptools_scm
-%if %{with tests}
-BuildRequires:	python-attrs >= 19.2.0
-BuildRequires:	python-graphviz >= 0.5.2
-BuildRequires:	python-pytest
-BuildRequires:	python-six
-BuildRequires:	python-twisted >= 16.1.1
-# it renames xml module to _xmlplus, breaking test_discover.py:WrapFQPNTests.test_singlePackage if Twisted is installed
-BuildConflicts:	python-PyXML
-%endif
-%endif
-%if %{with python3}
-BuildRequires:	python3-m2r
-BuildRequires:	python3-modules >= 1:3.5
-BuildRequires:	python3-setuptools
-BuildRequires:	python3-setuptools_scm
-%if %{with tests}
-BuildRequires:	python3-attrs >= 19.2.0
-BuildRequires:	python3-graphviz >= 0.5.2
-BuildRequires:	python3-pytest
-BuildRequires:	python3-six
-BuildRequires:	python3-twisted >= 16.1.1
-%endif
-%endif
-BuildRequires:	rpm-pythonprov
-BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with doc}
-BuildRequires:	sphinx-pdg-3
-%endif
-Requires:	python-modules >= 1:2.7
-BuildArch:	noarch
-BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-
-%description
-Automat is a library for concise, idiomatic Python expression of
-finite-state automata (particularly deterministic finite-state
-transducers).
-
-%description -l pl.UTF-8
-Automat to biblioteka do zwięzłego wyrażania automatów skończonych (w
-szczególności deterministycznych automatów skończończonych z wyjściem,
-tj. transduktorów) w Pythonie.
-
-%package -n python3-automat
-Summary:	Self-service finite-state machines for the programmer on the go
-Summary(pl.UTF-8):	Bezobsługowe automaty skończone dla programisty w biegu
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.5
-
-%description -n python3-automat
-Automat is a library for concise, idiomatic Python expression of
-finite-state automata (particularly deterministic finite-state
-transducers).
-
-%description -n python3-automat -l pl.UTF-8
-Automat to biblioteka do zwięzłego wyrażania automatów skończonych (w
-szczególności deterministycznych automatów skończończonych z wyjściem,
-tj. transduktorów) w Pythonie.
-
-%package apidocs
-Summary:	API documentation for Python automat module
-Summary(pl.UTF-8):	Dokumentacja API modułu Pythona automat
-Group:		Documentation
-
-%description apidocs
-API documentation for Python automat module.
-
-%description apidocs -l pl.UTF-8
-Dokumentacja API modułu Pythona automat.
-
-%prep
-%setup -q -n Automat-%{version}
-
-%build
-%if %{with python2}
-%py_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python} -m pytest automat/_test
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-%{__python3} -m pytest automat/_test
-%endif
-%endif
-
-%if %{with doc}
-PYTHONPATH=$(pwd) \
-%{__make} -C docs html \
-	SPHINXBUILD=sphinx-build-3
-%endif
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%py_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/automat-visualize{,-2}
-install -d $RPM_BUILD_ROOT%{_examplesdir}/python-automat-%{version}
-cp -p docs/examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python-automat-%{version}
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-
-%{__mv} $RPM_BUILD_ROOT%{_bindir}/automat-visualize{,-3}
-ln -sf automat-visualize-3 $RPM_BUILD_ROOT%{_bindir}/automat-visualize
-install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-automat-%{version}
-cp -p docs/examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-automat-%{version}
-%endif
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%if %{with python2}
-%files
-%defattr(644,root,root,755)
-%doc LICENSE README.md
-%attr(755,root,root) %{_bindir}/automat-visualize-2
-%{py_sitescriptdir}/automat
-%{py_sitescriptdir}/Automat-%{version}-py*.egg-info
-%{_examplesdir}/python-automat-%{version}
-%endif
-
-%if %{with python3}
-%files -n python3-automat
-%defattr(644,root,root,755)
-%doc LICENSE README.md
-%attr(755,root,root) %{_bindir}/automat-visualize
-%attr(755,root,root) %{_bindir}/automat-visualize-3
-%{py3_sitescriptdir}/automat
-%{py3_sitescriptdir}/Automat-%{version}-py*.egg-info
-%{_examplesdir}/python3-automat-%{version}
-%endif
-
-%if %{with doc}
-%files apidocs
-%defattr(644,root,root,755)
-%doc docs/_build/html/{_images,_static,*.html,*.js}
-%endif
diff --git a/python3-automat.spec b/python3-automat.spec
new file mode 100644
index 0000000..7a3c098
--- /dev/null
+++ b/python3-automat.spec
@@ -0,0 +1,108 @@
+#
+# Conditional build:
+%bcond_without	doc	# Sphinx documentation
+%bcond_without	tests	# unit tests
+
+Summary:	Self-service finite-state machines for the programmer on the go
+Summary(pl.UTF-8):	Bezobsługowe automaty skończone dla programisty w biegu
+Name:		python3-automat
+Version:	24.8.1
+Release:	1
+License:	MIT
+Group:		Libraries/Python
+#Source0Download: https://pypi.org/simple/automat/
+Source0:	https://files.pythonhosted.org/packages/source/a/automat/automat-%{version}.tar.gz
+# Source0-md5:	c023f8848366053a76f99cffba3ea34e
+Patch0:		no-git.patch
+URL:		https://pypi.org/project/Automat/
+BuildRequires:	python3-modules >= 1:3.5
+BuildRequires:	python3-build
+BuildRequires:	python3-installer
+BuildRequires:	python3-setuptools >= 35.0.2
+BuildRequires:	python3-setuptools_scm
+BuildRequires:	python3-wheel >= 0.29.0
+%if %{with tests}
+BuildRequires:	python3-attrs >= 19.2.0
+BuildRequires:	python3-graphviz >= 0.5.2
+BuildRequires:	python3-pytest
+BuildRequires:	python3-twisted >= 16.1.1
+%endif
+BuildRequires:	rpm-pythonprov
+BuildRequires:	rpmbuild(macros) >= 1.714
+%if %{with doc}
+BuildRequires:	python3-pydoctor
+BuildRequires:	sphinx-pdg-3
+%endif
+Requires:	python-modules >= 1:2.7
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Automat is a library for concise, idiomatic Python expression of
+finite-state automata (particularly deterministic finite-state
+transducers).
+
+%description -l pl.UTF-8
+Automat to biblioteka do zwięzłego wyrażania automatów skończonych (w
+szczególności deterministycznych automatów skończończonych z wyjściem,
+tj. transduktorów) w Pythonie.
+
+%package apidocs
+Summary:	API documentation for Python automat module
+Summary(pl.UTF-8):	Dokumentacja API modułu Pythona automat
+Group:		Documentation
+
+%description apidocs
+API documentation for Python automat module.
+
+%description apidocs -l pl.UTF-8
+Dokumentacja API modułu Pythona automat.
+
+%prep
+%setup -q -n automat-%{version}
+%patch -P0 -p1
+
+%{__sed} -i -e 's/@@VERSION@@/%{version}/' docs/conf.py
+
+%build
+%py3_build_pyproject
+
+%if %{with tests}
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+%{__python3} -m pytest automat/_test
+%endif
+
+%if %{with doc}
+%{__python3} -m zipfile -e build-3/*.whl build-3-doc
+PYTHONPATH=$(pwd)/build-3-doc \
+%{__make} -C docs html \
+	SPHINXBUILD=sphinx-build-3
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%py3_install_pyproject
+
+%{__mv} $RPM_BUILD_ROOT%{_bindir}/automat-visualize{,-3}
+ln -sf automat-visualize-3 $RPM_BUILD_ROOT%{_bindir}/automat-visualize
+install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-automat-%{version}
+cp -p docs/examples/*.py $RPM_BUILD_ROOT%{_examplesdir}/python3-automat-%{version}
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE README.md
+%attr(755,root,root) %{_bindir}/automat-visualize
+%attr(755,root,root) %{_bindir}/automat-visualize-3
+%{py3_sitescriptdir}/automat
+%{py3_sitescriptdir}/Automat-%{version}.dist-info
+%{_examplesdir}/python3-automat-%{version}
+
+%if %{with doc}
+%files apidocs
+%defattr(644,root,root,755)
+%doc docs/_build/html/{_images,_static,*.html,*.js}
+%endif
diff --git a/no-git.patch b/no-git.patch
new file mode 100644
index 0000000..83919b0
--- /dev/null
+++ b/no-git.patch
@@ -0,0 +1,26 @@
+--- automat-24.8.1/docs/conf.py~	2024-08-18 02:41:47.000000000 +0200
++++ automat-24.8.1/docs/conf.py	2025-04-08 01:29:04.729979460 +0200
+@@ -44,22 +44,7 @@
+ _project_root = pathlib.Path(__file__).parent.parent
+ _source_root = _project_root / "src"
+ 
+-_git_reference = subprocess.run(
+-    ["git", "rev-parse", "--abbrev-ref", "HEAD"],
+-    text=True,
+-    encoding="utf8",
+-    capture_output=True,
+-    check=True,
+-).stdout
+-
+-
+-# Try to find URL fragment for the GitHub source page based on current
+-# branch or tag.
+-
+-if _git_reference == "HEAD":
+-    # It looks like the branch has no name.
+-    # Fallback to commit ID.
+-    _git_reference = subprocess.getoutput("git rev-parse HEAD")
++_git_reference = "v@@VERSION@@"
+ 
+ if os.environ.get("READTHEDOCS", "") == "True":
+     rtd_version = os.environ.get("READTHEDOCS_VERSION", "")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-automat.git/commitdiff/f47af5078ef9e1c782ea754764d7e54e4697031a



More information about the pld-cvs-commit mailing list