forked from pool/python-actdiag
Accepting request 1301514 from devel:languages:python
- 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/request/show/1301514 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-actdiag?expand=0&rev=11
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Aug 27 02:55:25 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- 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á <mmachova@suse.com>
|
Mon Jun 16 12:10:48 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-actdiag
|
# spec file for package python-actdiag
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -27,6 +27,8 @@ URL: http://blockdiag.com/
|
|||||||
Source: https://files.pythonhosted.org/packages/source/a/actdiag/actdiag-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/a/actdiag/actdiag-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM gh#blockdiag/actdiag#25
|
# PATCH-FIX-UPSTREAM gh#blockdiag/actdiag#25
|
||||||
Patch0: clean-up-assertions.patch
|
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 base >= 3.7}
|
||||||
BuildRequires: %{python_module blockdiag >= 3}
|
BuildRequires: %{python_module blockdiag >= 3}
|
||||||
BuildRequires: %{python_module docutils}
|
BuildRequires: %{python_module docutils}
|
||||||
@@ -47,8 +49,6 @@ actdiag generates activity-diagram image files from spec-text files.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n actdiag-%{version}
|
%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
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
@@ -59,7 +59,49 @@ sed -i 's/testcase_generator/_testcase_generator/' src/actdiag/tests/test_genera
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%pytest src/actdiag/tests
|
# All of these are shipped by blockdiag and fail to parse
|
||||||
|
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
|
%pre
|
||||||
%python_libalternatives_reset_alternative actdiag
|
%python_libalternatives_reset_alternative actdiag
|
||||||
|
29
support-new-fancy-blockdiag-pytest.patch
Normal file
29
support-new-fancy-blockdiag-pytest.patch
Normal file
@@ -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)
|
Reference in New Issue
Block a user