From ad34ea0ef9746f35f2554c6029f9cede44e33576c890c4a076941b38e5494dac Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 27 Aug 2025 03:01:45 +0000 Subject: [PATCH 1/2] - Add patch support-new-fancy-blockdiag-pytest.patch: * Use new methods added by new blockdiag, rather than yield tests. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-actdiag?expand=0&rev=25 --- .gitattributes | 23 +++++ .gitignore | 1 + actdiag-3.0.0.tar.gz | 3 + clean-up-assertions.patch | 118 +++++++++++++++++++++++ python-actdiag.changes | 74 ++++++++++++++ python-actdiag.spec | 116 ++++++++++++++++++++++ support-new-fancy-blockdiag-pytest.patch | 29 ++++++ 7 files changed, 364 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 create mode 100644 support-new-fancy-blockdiag-pytest.patch 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' + +- Add patch support-new-fancy-blockdiag-pytest.patch: + * Use new methods added by new blockdiag, rather than yield tests. + +------------------------------------------------------------------- +Mon Jun 16 12:10:48 UTC 2025 - Markéta Machová + +- 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..abf5453 --- /dev/null +++ b/python-actdiag.spec @@ -0,0 +1,116 @@ +# +# spec file for package python-actdiag +# +# Copyright (c) 2025 SUSE LLC and contributors +# +# 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 +# PATCH-FIX-OPENSUSE Support new fancy pytest parameterized methods in blockdiag +Patch1: support-new-fancy-blockdiag-pytest.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} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/actdiag +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# All of these are shipped by blockdiag and fail to parse +donttest+="diagram_attributes.diag-svg-options44 or " +donttest+="edge_datamodels.diag-svg-options60 or " +donttest+="empty_group.diag-svg-options84 or " +donttest+="empty_group_declaration.diag-svg-options88 or " +donttest+="empty_nested_group.diag-svg-options92 or " +donttest+="group_and_skipped_edge.diag-svg-options108 or " +donttest+="group_attribute.diag-svg-options112 or " +donttest+="group_children_height.diag-svg-options116 or " +donttest+="group_children_order.diag-svg-options120 or " +donttest+="group_children_order2.diag-svg-options124 or " +donttest+="group_children_order3.diag-svg-options128 or " +donttest+="group_children_order4.diag-svg-options132 or " +donttest+="group_declare_as_node_attribute.diag-svg-options136 or " +donttest+="group_height.diag-svg-options140 or " +donttest+="group_id_and_node_id_are_not_conflicted.diag-svg-options144 or " +donttest+="group_label.diag-svg-options148 or " +donttest+="group_order.diag-svg-options152 or " +donttest+="group_order2.diag-svg-options156 or " +donttest+="group_order3.diag-svg-options160 or " +donttest+="group_orientation.diag-svg-options164 or " +donttest+="group_sibling.diag-svg-options168 or " +donttest+="group_works_node_decorator.diag-svg-options172 or " +donttest+="large_group_and_node.diag-svg-options180 or " +donttest+="large_group_and_node2.diag-svg-options184 or " +donttest+="large_group_and_two_nodes.diag-svg-options188 or " +donttest+="merge_groups.diag-svg-options192 or " +donttest+="multiple_groups.diag-svg-options196 or " +donttest+="multiple_nested_groups.diag-svg-options200 or " +donttest+="nested_group_orientation.diag-svg-options216 or " +donttest+="nested_group_orientation2.diag-svg-options220 or " +donttest+="nested_groups.diag-svg-options224 or " +donttest+="nested_groups_and_edges.diag-svg-options228 or " +donttest+="nested_groups_work_node_decorator.diag-svg-options232 or " +donttest+="node_attribute_and_group.diag-svg-options244 or " +donttest+="node_in_group_follows_outer_node.diag-svg-options264 or " +donttest+="node_link.diag-svg-options268 or " +donttest+="outer_node_follows_node_in_group.diag-svg-options312 or " +donttest+="reverse_multiple_groups.diag-svg-options332 or " +donttest+="separate1.diag-svg-options344 or " +donttest+="separate2.diag-svg-options348 or " +donttest+="simple_group.diag-svg-options352" +%pytest src/actdiag/tests -k "not ($donttest)" + +%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 diff --git a/support-new-fancy-blockdiag-pytest.patch b/support-new-fancy-blockdiag-pytest.patch new file mode 100644 index 0000000..0bf78c4 --- /dev/null +++ b/support-new-fancy-blockdiag-pytest.patch @@ -0,0 +1,29 @@ +Index: actdiag-3.0.0/src/actdiag/tests/test_generate_diagram.py +=================================================================== +--- actdiag-3.0.0.orig/src/actdiag/tests/test_generate_diagram.py ++++ actdiag-3.0.0/src/actdiag/tests/test_generate_diagram.py +@@ -15,17 +15,15 @@ + + import os + +-from blockdiag.tests.test_generate_diagram import (get_diagram_files, +- testcase_generator) ++import pytest ++ ++from blockdiag.tests.test_generate_diagram import (generate, ++ generate_testdata) + + import actdiag.command + + +-def test_generate(): ++@pytest.mark.parametrize("source,file_type,options", generate_testdata) ++def test_generate_with_separate(source, file_type, options): + mainfunc = actdiag.command.main +- basepath = os.path.dirname(__file__) +- files = get_diagram_files(basepath) +- options = [] +- +- for testcase in testcase_generator(basepath, mainfunc, files, options): +- yield testcase ++ generate(mainfunc, source, file_type, options) From faeb53f3417ded1a0f64c135e71b614196b0e6e76d9f20c91262214436fde471 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Wed, 27 Aug 2025 03:08:53 +0000 Subject: [PATCH 2/2] remove numbers OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-actdiag?expand=0&rev=26 --- python-actdiag.spec | 82 ++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/python-actdiag.spec b/python-actdiag.spec index abf5453..806c133 100644 --- a/python-actdiag.spec +++ b/python-actdiag.spec @@ -60,47 +60,47 @@ actdiag generates activity-diagram image files from spec-text files. %check # All of these are shipped by blockdiag and fail to parse -donttest+="diagram_attributes.diag-svg-options44 or " -donttest+="edge_datamodels.diag-svg-options60 or " -donttest+="empty_group.diag-svg-options84 or " -donttest+="empty_group_declaration.diag-svg-options88 or " -donttest+="empty_nested_group.diag-svg-options92 or " -donttest+="group_and_skipped_edge.diag-svg-options108 or " -donttest+="group_attribute.diag-svg-options112 or " -donttest+="group_children_height.diag-svg-options116 or " -donttest+="group_children_order.diag-svg-options120 or " -donttest+="group_children_order2.diag-svg-options124 or " -donttest+="group_children_order3.diag-svg-options128 or " -donttest+="group_children_order4.diag-svg-options132 or " -donttest+="group_declare_as_node_attribute.diag-svg-options136 or " -donttest+="group_height.diag-svg-options140 or " -donttest+="group_id_and_node_id_are_not_conflicted.diag-svg-options144 or " -donttest+="group_label.diag-svg-options148 or " -donttest+="group_order.diag-svg-options152 or " -donttest+="group_order2.diag-svg-options156 or " -donttest+="group_order3.diag-svg-options160 or " -donttest+="group_orientation.diag-svg-options164 or " -donttest+="group_sibling.diag-svg-options168 or " -donttest+="group_works_node_decorator.diag-svg-options172 or " -donttest+="large_group_and_node.diag-svg-options180 or " -donttest+="large_group_and_node2.diag-svg-options184 or " -donttest+="large_group_and_two_nodes.diag-svg-options188 or " -donttest+="merge_groups.diag-svg-options192 or " -donttest+="multiple_groups.diag-svg-options196 or " -donttest+="multiple_nested_groups.diag-svg-options200 or " -donttest+="nested_group_orientation.diag-svg-options216 or " -donttest+="nested_group_orientation2.diag-svg-options220 or " -donttest+="nested_groups.diag-svg-options224 or " -donttest+="nested_groups_and_edges.diag-svg-options228 or " -donttest+="nested_groups_work_node_decorator.diag-svg-options232 or " -donttest+="node_attribute_and_group.diag-svg-options244 or " -donttest+="node_in_group_follows_outer_node.diag-svg-options264 or " -donttest+="node_link.diag-svg-options268 or " -donttest+="outer_node_follows_node_in_group.diag-svg-options312 or " -donttest+="reverse_multiple_groups.diag-svg-options332 or " -donttest+="separate1.diag-svg-options344 or " -donttest+="separate2.diag-svg-options348 or " -donttest+="simple_group.diag-svg-options352" +donttest+="diagram_attributes.diag-svg-options or " +donttest+="edge_datamodels.diag-svg-options or " +donttest+="empty_group.diag-svg-options or " +donttest+="empty_group_declaration.diag-svg-options or " +donttest+="empty_nested_group.diag-svg-options or " +donttest+="group_and_skipped_edge.diag-svg-options or " +donttest+="group_attribute.diag-svg-options or " +donttest+="group_children_height.diag-svg-options or " +donttest+="group_children_order.diag-svg-options or " +donttest+="group_children_order2.diag-svg-options or " +donttest+="group_children_order3.diag-svg-options or " +donttest+="group_children_order4.diag-svg-options or " +donttest+="group_declare_as_node_attribute.diag-svg-options or " +donttest+="group_height.diag-svg-options or " +donttest+="group_id_and_node_id_are_not_conflicted.diag-svg-options or " +donttest+="group_label.diag-svg-options or " +donttest+="group_order.diag-svg-options or " +donttest+="group_order2.diag-svg-options or " +donttest+="group_order3.diag-svg-options or " +donttest+="group_orientation.diag-svg-options or " +donttest+="group_sibling.diag-svg-options or " +donttest+="group_works_node_decorator.diag-svg-options or " +donttest+="large_group_and_node.diag-svg-options or " +donttest+="large_group_and_node2.diag-svg-options or " +donttest+="large_group_and_two_nodes.diag-svg-options or " +donttest+="merge_groups.diag-svg-options or " +donttest+="multiple_groups.diag-svg-options or " +donttest+="multiple_nested_groups.diag-svg-options or " +donttest+="nested_group_orientation.diag-svg-options or " +donttest+="nested_group_orientation2.diag-svg-options or " +donttest+="nested_groups.diag-svg-options or " +donttest+="nested_groups_and_edges.diag-svg-options or " +donttest+="nested_groups_work_node_decorator.diag-svg-options or " +donttest+="node_attribute_and_group.diag-svg-options or " +donttest+="node_in_group_follows_outer_node.diag-svg-options or " +donttest+="node_link.diag-svg-options or " +donttest+="outer_node_follows_node_in_group.diag-svg-options or " +donttest+="reverse_multiple_groups.diag-svg-options or " +donttest+="separate1.diag-svg-options or " +donttest+="separate2.diag-svg-options or " +donttest+="simple_group.diag-svg-options" %pytest src/actdiag/tests -k "not ($donttest)" %pre