diff --git a/python-python-louvain.changes b/python-python-louvain.changes index 2ab29ba..38ea6b8 100644 --- a/python-python-louvain.changes +++ b/python-python-louvain.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 14 14:20:48 UTC 2024 - Markéta Machová + +- Fix tests on Python 3.12 with tests-int-division.patch + ------------------------------------------------------------------- Fri Oct 14 09:09:53 UTC 2022 - Daniel Garcia diff --git a/python-python-louvain.spec b/python-python-louvain.spec index 03da6a5..db73192 100644 --- a/python-python-louvain.spec +++ b/python-python-louvain.spec @@ -1,7 +1,7 @@ # # spec file for package python-python-louvain # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,7 +16,7 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} +%{?sle15_python_module_pythons} %define skip_python2 1 %define skip_python36 1 Name: python-python-louvain @@ -28,6 +28,8 @@ URL: https://github.com/taynaud/python-louvain Source0: https://files.pythonhosted.org/packages/source/p/python-louvain/python-louvain-%{version}.tar.gz # PATCH-FIX-UPSTREAM fix-test-karate.patch gh#taynaud/python-louvain#95 Patch: fix-test-karate.patch +# PATCH-FIX-UPSTREAM tests-int-division.patch gh#taynaud/python-louvain#104 +Patch: tests-int-division.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy} BuildRequires: %{python_module setuptools} @@ -36,7 +38,8 @@ BuildRequires: python-rpm-macros Requires: python-networkx Requires: python-numpy Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives +Provides: python-community = %{version} BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module networkx} @@ -76,6 +79,7 @@ sed -i -e '/^#!\//, 1d' community/__init__.py %doc README.rst %license LICENSE %python_alternative %{_bindir}/community -%{python_sitelib}/* +%{python_sitelib}/community +%{python_sitelib}/python_louvain-%{version}*-info %changelog diff --git a/tests-int-division.patch b/tests-int-division.patch new file mode 100644 index 0000000..81ff872 --- /dev/null +++ b/tests-int-division.patch @@ -0,0 +1,13 @@ +Index: python-louvain-0.16/test_community.py +=================================================================== +--- python-louvain-0.16.orig/test_community.py ++++ python-louvain-0.16/test_community.py +@@ -61,7 +61,7 @@ class ModularityTest(unittest.TestCase): + graph = nx.erdos_renyi_graph(50, 0.1) + part = dict([]) + for node in graph: +- part[node] = random.randint(0, self.number_of_tests / 10) ++ part[node] = random.randint(0, self.number_of_tests // 10) + mod = co.modularity(part, graph) + self.assertGreaterEqual(mod, -1) + self.assertLessEqual(mod, 1)