- Revert back to 7.6.0. elasticsearch-dsl is not compatible with

8.* releases (gh#elastic/elasticsearch-dsl-py#1569).
- Add python-elasticsearch-no-nose.patch to replace sed call in
  SPEC file.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-elasticsearch?expand=0&rev=33
This commit is contained in:
Matej Cepl 2022-10-18 10:09:23 +00:00 committed by Git OBS Bridge
parent 3bc84cdba5
commit 0d5b4ecd29
6 changed files with 142 additions and 44 deletions

BIN
7.6.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4b04930ff043894738e835ef6f6cc172f2e4929d3338263f6e650ef0fed76a93
size 514532

View File

@ -1,39 +1,46 @@
Index: elasticsearch-py-8.3.3/test_elasticsearch/test_helpers.py
===================================================================
--- elasticsearch-py-8.3.3.orig/test_elasticsearch/test_helpers.py
+++ elasticsearch-py-8.3.3/test_elasticsearch/test_helpers.py
@@ -19,7 +19,7 @@
import threading
import time
---
test_elasticsearch/test_connection.py | 2 +-
test_elasticsearch/test_helpers.py | 2 +-
test_elasticsearch/test_server/test_helpers.py | 2 +-
test_elasticsearch/test_transport.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
--- a/test_elasticsearch/test_connection.py
+++ b/test_elasticsearch/test_connection.py
@@ -2,7 +2,7 @@ import re
import ssl
import gzip
import io
-from mock import Mock, patch
+from unittest.mock import Mock, patch
import urllib3
import warnings
from requests.auth import AuthBase
--- a/test_elasticsearch/test_helpers.py
+++ b/test_elasticsearch/test_helpers.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-import mock
+from unittest import mock
import pytest
import time
import threading
from unittest import SkipTest
--- a/test_elasticsearch/test_server/test_helpers.py
+++ b/test_elasticsearch/test_server/test_helpers.py
@@ -1,4 +1,4 @@
-from mock import patch
+from unittest.mock import patch
from elasticsearch import Elasticsearch, helpers
Index: elasticsearch-py-8.3.3/test_elasticsearch/test_server/test_helpers.py
===================================================================
--- elasticsearch-py-8.3.3.orig/test_elasticsearch/test_server/test_helpers.py
+++ elasticsearch-py-8.3.3/test_elasticsearch/test_server/test_helpers.py
@@ -21,7 +21,7 @@ from datetime import datetime, timedelta
import pytest
from dateutil import tz
from elastic_transport import ApiResponseMeta, ObjectApiResponse
-from mock import call, patch
+from unittest.mock import call, patch
from elasticsearch import ApiError, helpers
from elasticsearch import helpers, TransportError
from elasticsearch.helpers import ScanError
Index: elasticsearch-py-8.3.3/test_elasticsearch/test_async/test_server/test_helpers.py
===================================================================
--- elasticsearch-py-8.3.3.orig/test_elasticsearch/test_async/test_server/test_helpers.py
+++ elasticsearch-py-8.3.3/test_elasticsearch/test_async/test_server/test_helpers.py
@@ -20,7 +20,7 @@ from datetime import datetime, timedelta
--- a/test_elasticsearch/test_transport.py
+++ b/test_elasticsearch/test_transport.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
-from mock import patch
+from unittest.mock import patch
import pytest
from elastic_transport import ApiResponseMeta, ObjectApiResponse
-from mock import MagicMock, call, patch
+from unittest.mock import MagicMock, call, patch
from elasticsearch import helpers
from elasticsearch.exceptions import ApiError
from elasticsearch.transport import Transport, get_host_info
from elasticsearch.connection import Connection

View File

@ -0,0 +1,77 @@
---
dev-requirements.txt | 2 --
setup.py | 2 --
test_elasticsearch/run_tests.py | 13 ++-----------
test_elasticsearch/test_helpers.py | 2 +-
4 files changed, 3 insertions(+), 16 deletions(-)
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,8 +1,6 @@
requests>=2, <3
-nose
coverage
mock
-nosexcover
sphinx<1.7
sphinx_rtd_theme
jinja2
--- a/setup.py
+++ b/setup.py
@@ -13,11 +13,9 @@ with open(join(dirname(__file__), "READM
install_requires = ["urllib3>=1.21.1"]
tests_require = [
"requests>=2.0.0, <3.0.0",
- "nose",
"coverage",
"mock",
"pyyaml",
- "nosexcover",
]
docs_require = ["sphinx<1.7", "sphinx_rtd_theme"]
--- a/test_elasticsearch/run_tests.py
+++ b/test_elasticsearch/run_tests.py
@@ -6,7 +6,7 @@ from os import environ
from os.path import dirname, join, pardir, abspath, exists
import subprocess
-import nose
+import unittest
def fetch_es_repo():
@@ -64,21 +64,12 @@ def run_all(argv=None):
# fetch yaml tests
fetch_es_repo()
- # always insert coverage when running tests
if argv is None:
argv = [
- "nosetests",
- "--with-xunit",
- "--with-xcoverage",
- "--cover-package=elasticsearch",
- "--cover-erase",
- "--logging-filter=elasticsearch",
- "--logging-level=DEBUG",
"--verbose",
- "--with-id",
]
- nose.run_exit(argv=argv, defaultTest=abspath(dirname(__file__)))
+ unittest.main(argv=argv, defaultTest=abspath(dirname(__file__)))
if __name__ == "__main__":
--- a/test_elasticsearch/test_helpers.py
+++ b/test_elasticsearch/test_helpers.py
@@ -2,7 +2,7 @@
import mock
import time
import threading
-from nose.plugins.skip import SkipTest
+from unittest import SkipTest
from elasticsearch import helpers, Elasticsearch
from elasticsearch.serializer import JSONSerializer

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Oct 18 10:04:37 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Revert back to 7.6.0. elasticsearch-dsl is not compatible with
8.* releases (gh#elastic/elasticsearch-dsl-py#1569).
- Add python-elasticsearch-no-nose.patch to replace sed call in
SPEC file.
-------------------------------------------------------------------
Thu Aug 18 16:35:28 UTC 2022 - Ben Greiner <code@bnavigator.de>

View File

@ -16,23 +16,28 @@
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
Name: python-elasticsearch
Version: 8.3.3
# DO NOT UPDATE until the compatible version of
# python-elasticsearch-dsl is available (i.e., the same major
# version ... currently we are waiting on 8.* release).
Version: 7.6.0
Release: 0
Summary: Python client for Elasticsearch
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/elastic/elasticsearch-py
Source: https://github.com/elastic/elasticsearch-py/archive/refs/tags/v%{version}.tar.gz#/elasticsearch-py-%{version}.tar.gz
Source: https://github.com/elastic/elasticsearch-py/archive/%{version}.tar.gz
Patch0: python-elasticsearch-no-nose.patch
# https://github.com/elastic/elasticsearch-py/issues/1983
Patch0: python-elasticsearch-no-mock.patch
BuildRequires: %{python_module elastic-transport >= 8 with %python-elastic-transport < 9}
Patch1: python-elasticsearch-no-mock.patch
BuildRequires: %{python_module certifi}
BuildRequires: %{python_module elastic-transport}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module urllib3 >= 1.21.1}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: (python-elastic-transport >= 8 with python-elastic-transport < 9)
Requires: python-elastic-transport
BuildArch: noarch
# SECTION test
BuildRequires: %{python_module PyYAML >= 5.4}
@ -52,6 +57,7 @@ to be opinion-free and very extendable.
%prep
%autosetup -p1 -n elasticsearch-py-%{version}
sed -i '/addopts/d' setup.cfg
rm README.rst
%build
%python_build
@ -65,7 +71,7 @@ sed -i '/addopts/d' setup.cfg
%files %{python_files}
%license LICENSE
%doc README.rst
%doc AUTHORS Changelog.rst README
%{python_sitelib}/elasticsearch
%{python_sitelib}/elasticsearch-%{version}*-info