Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-django-haystack for openSUSE:Factory checked in at 2024-01-14 19:02:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-django-haystack (Old) and /work/SRC/openSUSE:Factory/.python-django-haystack.new.21961 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-django-haystack" Sun Jan 14 19:02:38 2024 rev:9 rq:1138421 version:3.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-django-haystack/python-django-haystack.changes 2023-06-26 18:17:03.634728048 +0200 +++ /work/SRC/openSUSE:Factory/.python-django-haystack.new.21961/python-django-haystack.changes 2024-01-14 19:03:18.415009964 +0100 @@ -1,0 +2,6 @@ +Fri Jan 12 22:25:30 UTC 2024 - Georg Pfuetzenreuter <georg.pfuetzenreu...@suse.com> + +- Add gh-pr-1935_importlib.patch to repair DistributionNotFound + error caused by deprecated pkg_resources APIs + +------------------------------------------------------------------- New: ---- gh-pr-1935_importlib.patch BETA DEBUG BEGIN: New: - Add gh-pr-1935_importlib.patch to repair DistributionNotFound error caused by deprecated pkg_resources APIs BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-django-haystack.spec ++++++ --- /var/tmp/diff_new_pack.AE5axY/_old 2024-01-14 19:03:18.923028470 +0100 +++ /var/tmp/diff_new_pack.AE5axY/_new 2024-01-14 19:03:18.927028616 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-django-haystack # -# Copyright (c) 2023 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 @@ -24,11 +24,15 @@ License: BSD-3-Clause URL: https://github.com/django-haystack/django-haystack Source: https://files.pythonhosted.org/packages/source/d/django-haystack/django-haystack-%{version}.tar.gz +# pkg_resources is broken since the flufl.lock update in Factory +# https://github.com/django-haystack/django-haystack/pull/1935 +Patch: gh-pr-1935_importlib.patch BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Django >= 2.2 +Requires: python-packaging Suggests: python-elasticsearch Suggests: python-pysolr >= 3.7.0 Suggests: python-Whoosh >= 2.5.4 @@ -51,7 +55,7 @@ Pluggable search for Django. %prep -%setup -q -n django-haystack-%{version} +%autosetup -n django-haystack-%{version} -p1 sed -i 's:==:>=:' setup.py # This causes errors with pytest ++++++ gh-pr-1935_importlib.patch ++++++ >From da4651508e5d79e889fa2a7db5c0e40418703498 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter <m...@georg-pfuetzenreuter.net> Date: Fri, 12 Jan 2024 23:12:29 +0100 Subject: [PATCH] Migrate away from pkg_resources Using pkg_resources as an API is deprecated. Migrate functionality to their importlib and packaging equivalents. Signed-off-by: Georg Pfuetzenreuter <m...@georg-pfuetzenreuter.net> --- haystack/__init__.py | 13 +++++++------ test_haystack/solr_tests/test_solr_backend.py | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/haystack/__init__.py b/haystack/__init__.py index 94b8f4674..25448de96 100644 --- a/haystack/__init__.py +++ b/haystack/__init__.py @@ -1,7 +1,9 @@ +from importlib.metadata import PackageNotFoundError, version + import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured -from pkg_resources import DistributionNotFound, get_distribution, parse_version +from packaging.version import Version from haystack.constants import DEFAULT_ALIAS from haystack.utils import loading @@ -9,12 +11,11 @@ __author__ = "Daniel Lindsley" try: - pkg_distribution = get_distribution("django-haystack") - __version__ = pkg_distribution.version - version_info = pkg_distribution.parsed_version -except DistributionNotFound: + __version__ = version("django-haystack") + version_info = Version(__version__) +except PackageNotFoundError: __version__ = "0.0.dev0" - version_info = parse_version(__version__) + version_info = Version(__version__) if django.VERSION < (3, 2): diff --git a/test_haystack/solr_tests/test_solr_backend.py b/test_haystack/solr_tests/test_solr_backend.py index d20347e7e..d8c95d329 100644 --- a/test_haystack/solr_tests/test_solr_backend.py +++ b/test_haystack/solr_tests/test_solr_backend.py @@ -10,7 +10,7 @@ from django.conf import settings from django.test import TestCase from django.test.utils import override_settings -from pkg_resources import parse_version +from packaging.version import Version from haystack import connections, indexes, reset_search_queries from haystack.exceptions import SkipDocument @@ -1650,7 +1650,7 @@ def test_boost(self): @unittest.skipIf( - parse_version(pysolr.__version__) < parse_version("3.1.1"), + Version(pysolr.__version__) < Version("3.1.1"), "content extraction requires pysolr > 3.1.1", ) class LiveSolrContentExtractionTestCase(TestCase):