Skip to content

Commit

Permalink
Update python-elasticsearch to version 7.6.0 / rev 13 via SR 1029713
Browse files Browse the repository at this point in the history
https://build.opensuse.org/request/show/1029713
by user mcepl + dimstar_suse
- 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.
  • Loading branch information
mcepl authored and bmwiedemann committed Oct 19, 2022
1 parent 885bbb8 commit 96a7425
Show file tree
Hide file tree
Showing 8 changed files with 152 additions and 42 deletions.
Binary file modified packages/p/python-elasticsearch/.files
Binary file not shown.
12 changes: 12 additions & 0 deletions packages/p/python-elasticsearch/.rev
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,16 @@
<comment></comment>
<requestid>998086</requestid>
</revision>
<revision rev="13" vrev="4">
<srcmd5>a77c3d70adaa99b20f44b2263bc2b39f</srcmd5>
<version>7.6.0</version>
<time>1666178235</time>
<user>dimstar_suse</user>
<comment>- 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.
</comment>
<requestid>1029713</requestid>
</revision>
</revisionlist>
1 change: 1 addition & 0 deletions packages/p/python-elasticsearch/7.6.0.tar.gz

This file was deleted.

75 changes: 41 additions & 34 deletions packages/p/python-elasticsearch/python-elasticsearch-no-mock.patch
Original file line number Diff line number Diff line change
@@ -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

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
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 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

import pytest
from elastic_transport import ApiResponseMeta, ObjectApiResponse
-from mock import MagicMock, call, patch
+from unittest.mock import MagicMock, call, patch
--- 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

from elasticsearch import helpers
from elasticsearch.exceptions import ApiError
from elasticsearch.transport import Transport, get_host_info
from elasticsearch.connection import Connection
77 changes: 77 additions & 0 deletions packages/p/python-elasticsearch/python-elasticsearch-no-nose.patch
Original file line number Diff line number Diff line change
@@ -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

8 changes: 8 additions & 0 deletions packages/p/python-elasticsearch/python-elasticsearch.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
-------------------------------------------------------------------
Tue Oct 18 10:04:37 UTC 2022 - Matej Cepl <[email protected]>

- 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 <[email protected]>

Expand Down
20 changes: 13 additions & 7 deletions packages/p/python-elasticsearch/python-elasticsearch.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 96a7425

Please sign in to comment.