From c1f68cbf0ed68f068d24b7397a1586a5696288fe64759629a8833a01260612cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Mon, 16 Jun 2025 12:11:07 +0000 Subject: [PATCH] - Convert to libalternatives OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-actdiag?expand=0&rev=23 --- .gitattributes | 23 ++++++++ .gitignore | 1 + actdiag-3.0.0.tar.gz | 3 + clean-up-assertions.patch | 118 ++++++++++++++++++++++++++++++++++++++ python-actdiag.changes | 68 ++++++++++++++++++++++ python-actdiag.spec | 74 ++++++++++++++++++++++++ 6 files changed, 287 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 actdiag-3.0.0.tar.gz create mode 100644 clean-up-assertions.patch create mode 100644 python-actdiag.changes create mode 100644 python-actdiag.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/actdiag-3.0.0.tar.gz b/actdiag-3.0.0.tar.gz new file mode 100644 index 0000000..650f791 --- /dev/null +++ b/actdiag-3.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0efc9b2887d3ec765b0f45bde1d5757a52301151ea62bcc2297e77aad9264006 +size 2574809 diff --git a/clean-up-assertions.patch b/clean-up-assertions.patch new file mode 100644 index 0000000..38a3391 --- /dev/null +++ b/clean-up-assertions.patch @@ -0,0 +1,118 @@ +From a897ea0af0792dbb721c47dff49f222e409c4334 Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Thu, 18 Jan 2024 15:09:22 +1100 +Subject: [PATCH] Clean up test assertions + +Python 3.1 and 3.2 massively cleaned up and reorganized assert* methods +in TestCase, all for the better. A large amount of methods were then +deprecated, and they have finally been removed in Python 3.12. Clean up +the callsites. +--- + src/actdiag/tests/test_rst_directives.py | 37 ++++++++++-------------- + 1 file changed, 16 insertions(+), 21 deletions(-) + +diff --git a/src/actdiag/tests/test_rst_directives.py b/src/actdiag/tests/test_rst_directives.py +index 9af9ff7..4738970 100644 +--- a/src/actdiag/tests/test_rst_directives.py ++++ b/src/actdiag/tests/test_rst_directives.py +@@ -47,11 +47,11 @@ def test_setup(self): + self.assertEqual(directives.ActdiagDirective, + docutils._directives['actdiag']) + self.assertEqual('PNG', options['format']) +- self.assertEqual(False, options['antialias']) +- self.assertEqual(None, options['fontpath']) +- self.assertEqual(False, options['nodoctype']) +- self.assertEqual(False, options['noviewbox']) +- self.assertEqual(False, options['inline_svg']) ++ self.assertFalse(options['antialias']) ++ self.assertIsNone(options['fontpath']) ++ self.assertFalse(options['nodoctype']) ++ self.assertFalse(options['noviewbox']) ++ self.assertFalse(options['inline_svg']) + + def test_setup_with_args(self): + directives.setup(format='SVG', antialias=True, fontpath='/dev/null', +@@ -62,11 +62,11 @@ def test_setup_with_args(self): + self.assertEqual(directives.ActdiagDirective, + docutils._directives['actdiag']) + self.assertEqual('SVG', options['format']) +- self.assertEqual(True, options['antialias']) ++ self.assertTrue(options['antialias']) + self.assertEqual('/dev/null', options['fontpath']) +- self.assertEqual(True, options['nodoctype']) +- self.assertEqual(True, options['noviewbox']) +- self.assertEqual(True, options['inline_svg']) ++ self.assertTrue(options['nodoctype']) ++ self.assertTrue(options['noviewbox']) ++ self.assertTrue(options['inline_svg']) + + @capture_stderr + def test_cleanup(self): +@@ -131,7 +131,7 @@ def test_setup_noviewbox_is_true(self): + self.assertEqual(1, len(doctree)) + self.assertEqual(nodes.image, type(doctree[0])) + svg = open(doctree[0]['uri']).read() +- self.assertRegexpMatches(svg, r' + +- Convert to libalternatives + +------------------------------------------------------------------- +Mon Apr 8 10:32:41 UTC 2024 - Dirk Müller + +- add sle15_python_module_pythons + +------------------------------------------------------------------- +Thu Jan 18 04:31:47 UTC 2024 - Steve Kowalik + +- Switch to autosetup and pyproject macros. +- Add patch clean-up-assertions.patch: + * Use non-deprecated assertion functions. + +------------------------------------------------------------------- +Thu Aug 4 20:14:27 UTC 2022 - Ben Greiner + +- Fix the requirements +- Enable tests +- Don't catchall files + +------------------------------------------------------------------- +Thu Aug 4 08:24:17 UTC 2022 - Otto Hollmann + +- Update to 3.0.0 + * Drop python3.6 support + * Use funcparserlib-1.0.0a0 or newer to support new python versions + * Allow to write multiline string via triple quotes (""" ... """) + * Fix a bug: Fix #147: file existence disclosure using svg renderer + +------------------------------------------------------------------- +Wed May 27 09:35:59 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Tue Feb 25 15:57:30 UTC 2020 - Thomas Bechtold + +- update to 2.0.0: + * Drop python2 and python3.4 support + +------------------------------------------------------------------- +Tue Jan 8 17:36:08 UTC 2019 - Jonathan Brownell + +- Update conditionals to use Suggests properly based on RHEL version + +------------------------------------------------------------------- +Tue Jan 8 04:43:59 UTC 2019 - Thomas Bechtold + +- Use Requires instead of Suggests for RHEL/Fedora systems + +------------------------------------------------------------------- +Wed Dec 5 01:51:27 UTC 2018 - Jan Engelhardt + +- Use noun phrase in summary. + +------------------------------------------------------------------- +Tue Dec 4 12:45:27 UTC 2018 - Matej Cepl + +- Remove superfluous devel dependency for noarch package + +------------------------------------------------------------------- +Thu Sep 7 15:17:16 UTC 2017 - tbechtold@suse.com + +- Initial packaging (version 0.5.4) diff --git a/python-actdiag.spec b/python-actdiag.spec new file mode 100644 index 0000000..3c71f6c --- /dev/null +++ b/python-actdiag.spec @@ -0,0 +1,74 @@ +# +# spec file for package python-actdiag +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%bcond_without libalternatives +%{?sle15_python_module_pythons} +Name: python-actdiag +Version: 3.0.0 +Release: 0 +Summary: Text to activity-diagram image generator +License: Apache-2.0 +URL: http://blockdiag.com/ +Source: https://files.pythonhosted.org/packages/source/a/actdiag/actdiag-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#blockdiag/actdiag#25 +Patch0: clean-up-assertions.patch +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module blockdiag >= 3} +BuildRequires: %{python_module docutils} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: alts +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: alts +Requires: python-blockdiag >= 3 +BuildArch: noarch +%python_subpackages + +%description +actdiag generates activity-diagram image files from spec-text files. + +%prep +%autosetup -p1 -n actdiag-%{version} +# python-blockdiag-nose-to-pytest.patch of python-blockdiag changed the function name +sed -i 's/testcase_generator/_testcase_generator/' src/actdiag/tests/test_generate_diagram.py + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/actdiag +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest src/actdiag/tests + +%pre +%python_libalternatives_reset_alternative actdiag + +%files %{python_files} +%license LICENSE +%doc README.rst +%python_alternative %{_bindir}/actdiag +%{python_sitelib}/actdiag +%{python_sitelib}/actdiag-%{version}.dist-info + +%changelog