From bfb26cc7fc73e16ce5690bbb04129891a0f7c8fcf3835cf127cc764f5e5f5e5e Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Mon, 27 Dec 2021 10:36:02 +0000 Subject: [PATCH] Accepting request 942660 from home:jayvdb:branches:devel:languages:python:django - Use django-codemod to make Django 4 compatible - Remove unnecessary build dependency coverage OBS-URL: https://build.opensuse.org/request/show/942660 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-haystack?expand=0&rev=8 --- python-django-haystack.changes | 6 ++++++ python-django-haystack.spec | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/python-django-haystack.changes b/python-django-haystack.changes index 3163ce6..4130f6a 100644 --- a/python-django-haystack.changes +++ b/python-django-haystack.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Dec 26 23:30:09 UTC 2021 - John Vandenberg + +- Use django-codemod to make Django 4 compatible +- Remove unnecessary build dependency coverage + ------------------------------------------------------------------- Fri Dec 3 04:17:14 UTC 2021 - Steve Kowalik diff --git a/python-django-haystack.spec b/python-django-haystack.spec index 7f98f7c..706dc4f 100644 --- a/python-django-haystack.spec +++ b/python-django-haystack.spec @@ -25,6 +25,7 @@ Summary: Pluggable search for Django License: BSD-3-Clause URL: https://haystacksearch.org/ Source: https://files.pythonhosted.org/packages/source/d/django-haystack/django-haystack-%{version}.tar.gz +BuildRequires: %{python_module django-codemod} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: fdupes @@ -37,7 +38,6 @@ BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Django >= 2.2} BuildRequires: %{python_module Whoosh >= 2.5.4} -BuildRequires: %{python_module coverage} BuildRequires: %{python_module elasticsearch} BuildRequires: %{python_module geopy >= 2.0.0} BuildRequires: %{python_module pysolr >= 3.7.0} @@ -54,9 +54,15 @@ Pluggable search for Django. %prep %setup -q -n django-haystack-%{version} +sed -i 's:==:>=:' setup.py + +djcodemod run --removed-in 4.0 haystack/{admin,forms}.py + +# This causes errors with pytest +sed -i '/django.setup()/d' test_haystack/__init__.py +echo 'import django; django.setup()' > conftest.py %build -sed -i 's:==:>=:' setup.py %python_build %install @@ -64,13 +70,16 @@ sed -i 's:==:>=:' setup.py %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +export DJANGO_SETTINGS_MODULE=test_haystack.settings # elasticsearch and solr tests require running services # test_ensure_wgs84 is broken with some GDAL issues -%pytest -k 'not (elasticsearch or solr or test_ensure_wgs84)' +%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}:${PWD} +$python -m pytest -k 'not (elasticsearch or solr or test_ensure_wgs84)' +} %files %{python_files} %doc AUTHORS README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/*haystack*/ %changelog