Accepting request 1090456 from home:pgajdos:python
- do not require six - modified patches % python-influxdb-remove-nose.patch (refreshed) - added patches do not require six (repo archived in favour of influxdb2, not reporting) + python-influxdb-no-six.patch OBS-URL: https://build.opensuse.org/request/show/1090456 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-influxdb?expand=0&rev=32
This commit is contained in:
parent
41a251074d
commit
944648d45e
153
python-influxdb-no-six.patch
Normal file
153
python-influxdb-no-six.patch
Normal file
@ -0,0 +1,153 @@
|
||||
Index: influxdb-5.3.1/influxdb.egg-info/requires.txt
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb.egg-info/requires.txt
|
||||
+++ influxdb-5.3.1/influxdb.egg-info/requires.txt
|
||||
@@ -1,7 +1,6 @@
|
||||
python-dateutil>=2.6.0
|
||||
pytz
|
||||
requests>=2.17.0
|
||||
-six>=1.10.0
|
||||
msgpack
|
||||
|
||||
[test]
|
||||
Index: influxdb-5.3.1/influxdb/client.py
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb/client.py
|
||||
+++ influxdb-5.3.1/influxdb/client.py
|
||||
@@ -20,7 +20,7 @@ from itertools import chain, islice
|
||||
import msgpack
|
||||
import requests
|
||||
import requests.exceptions
|
||||
-from six.moves.urllib.parse import urlparse
|
||||
+from urllib.parse import urlparse
|
||||
|
||||
from influxdb.line_protocol import make_lines, quote_ident, quote_literal
|
||||
from influxdb.resultset import ResultSet
|
||||
Index: influxdb-5.3.1/influxdb/helper.py
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb/helper.py
|
||||
+++ influxdb-5.3.1/influxdb/helper.py
|
||||
@@ -10,8 +10,6 @@ from collections import namedtuple, defa
|
||||
from datetime import datetime
|
||||
from warnings import warn
|
||||
|
||||
-import six
|
||||
-
|
||||
|
||||
class SeriesHelper(object):
|
||||
"""Subclass this helper eases writing data points in bulk.
|
||||
@@ -176,7 +174,7 @@ class SeriesHelper(object):
|
||||
json = []
|
||||
if not cls.__initialized__:
|
||||
cls._reset_()
|
||||
- for series_name, data in six.iteritems(cls._datapoints):
|
||||
+ for series_name, data in cls._datapoints.items():
|
||||
for point in data:
|
||||
json_point = {
|
||||
"measurement": series_name,
|
||||
Index: influxdb-5.3.1/influxdb/influxdb08/client.py
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb/influxdb08/client.py
|
||||
+++ influxdb-5.3.1/influxdb/influxdb08/client.py
|
||||
@@ -7,8 +7,7 @@ import json
|
||||
import socket
|
||||
import requests
|
||||
import requests.exceptions
|
||||
-from six.moves import xrange
|
||||
-from six.moves.urllib.parse import urlparse
|
||||
+from urllib.parse import urlparse
|
||||
|
||||
from influxdb import chunked_json
|
||||
|
||||
@@ -294,7 +293,7 @@ class InfluxDBClient(object):
|
||||
"""
|
||||
def list_chunks(data_list, n):
|
||||
"""Yield successive n-sized chunks from l."""
|
||||
- for i in xrange(0, len(data_list), n):
|
||||
+ for i in range(0, len(data_list), n):
|
||||
yield data_list[i:i + n]
|
||||
|
||||
batch_size = kwargs.get('batch_size')
|
||||
Index: influxdb-5.3.1/influxdb/line_protocol.py
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb/line_protocol.py
|
||||
+++ influxdb-5.3.1/influxdb/line_protocol.py
|
||||
@@ -11,7 +11,6 @@ from numbers import Integral
|
||||
|
||||
from pytz import UTC
|
||||
from dateutil.parser import parse
|
||||
-from six import binary_type, text_type, integer_types, PY2
|
||||
|
||||
EPOCH = UTC.localize(datetime.utcfromtimestamp(0))
|
||||
|
||||
@@ -28,7 +27,7 @@ def _convert_timestamp(timestamp, precis
|
||||
if isinstance(timestamp, Integral):
|
||||
return timestamp # assume precision is correct if timestamp is int
|
||||
|
||||
- if isinstance(_get_unicode(timestamp), text_type):
|
||||
+ if isinstance(_get_unicode(timestamp), str):
|
||||
timestamp = parse(timestamp)
|
||||
|
||||
if isinstance(timestamp, datetime):
|
||||
@@ -108,10 +107,10 @@ def _escape_value(value):
|
||||
return ''
|
||||
|
||||
value = _get_unicode(value)
|
||||
- if isinstance(value, text_type):
|
||||
+ if isinstance(value, str):
|
||||
return quote_ident(value)
|
||||
|
||||
- if isinstance(value, integer_types) and not isinstance(value, bool):
|
||||
+ if isinstance(value, int) and not isinstance(value, bool):
|
||||
return str(value) + 'i'
|
||||
|
||||
if isinstance(value, bool):
|
||||
@@ -125,15 +124,13 @@ def _escape_value(value):
|
||||
|
||||
def _get_unicode(data, force=False):
|
||||
"""Try to return a text aka unicode object from the given data."""
|
||||
- if isinstance(data, binary_type):
|
||||
+ if isinstance(data, bytes):
|
||||
return data.decode('utf-8')
|
||||
|
||||
if data is None:
|
||||
return ''
|
||||
|
||||
if force:
|
||||
- if PY2:
|
||||
- return unicode(data)
|
||||
return str(data)
|
||||
|
||||
return data
|
||||
Index: influxdb-5.3.1/requirements.txt
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/requirements.txt
|
||||
+++ influxdb-5.3.1/requirements.txt
|
||||
@@ -1,5 +1,4 @@
|
||||
python-dateutil>=2.6.0
|
||||
pytz
|
||||
requests>=2.17.0
|
||||
-six>=1.10.0
|
||||
msgpack
|
||||
Index: influxdb-5.3.1/influxdb/influxdb08/helper.py
|
||||
===================================================================
|
||||
--- influxdb-5.3.1.orig/influxdb/influxdb08/helper.py
|
||||
+++ influxdb-5.3.1/influxdb/influxdb08/helper.py
|
||||
@@ -9,8 +9,6 @@ from __future__ import unicode_literals
|
||||
from collections import namedtuple, defaultdict
|
||||
from warnings import warn
|
||||
|
||||
-import six
|
||||
-
|
||||
|
||||
class SeriesHelper(object):
|
||||
"""Define the SeriesHelper object for InfluxDB v0.8.
|
||||
@@ -141,7 +139,7 @@ class SeriesHelper(object):
|
||||
json = []
|
||||
if not cls.__initialized__:
|
||||
cls._reset_()
|
||||
- for series_name, data in six.iteritems(cls._datapoints):
|
||||
+ for series_name, data in cls._datapoints.items():
|
||||
json.append({'name': series_name,
|
||||
'columns': cls._fields,
|
||||
'points': [[getattr(point, k) for k in cls._fields]
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 2 08:59:55 UTC 2023 - pgajdos@suse.com
|
||||
|
||||
- do not require six
|
||||
- modified patches
|
||||
% python-influxdb-remove-nose.patch (refreshed)
|
||||
- added patches
|
||||
do not require six (repo archived in favour of influxdb2, not reporting)
|
||||
+ python-influxdb-no-six.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 9 16:05:29 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-influxdb
|
||||
#
|
||||
# Copyright (c) 2022 SUSE LLC
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -30,18 +30,18 @@ Source: https://files.pythonhosted.org/packages/source/i/influxdb/influx
|
||||
Patch0: python-influxdb-remove-nose.patch
|
||||
# PATCH-FIX-UPSTREAM influxdb-pr845-pandas-future.patch -- gh#influxdb/influxdb-python#845
|
||||
Patch1: https://github.com/influxdata/influxdb-python/pull/845.patch#/influxdb-pr845-pandas-future.patch
|
||||
# do not require six (repo archived in favour of influxdb2, not reporting)
|
||||
Patch2: python-influxdb-no-six.patch
|
||||
BuildRequires: %{python_module python-dateutil >= 2.6.0}
|
||||
BuildRequires: %{python_module pytz}
|
||||
BuildRequires: %{python_module requests >= 2.17.0}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module six >= 1.10.0}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-msgpack
|
||||
Requires: python-python-dateutil >= 2.6.0
|
||||
Requires: python-pytz
|
||||
Requires: python-requests >= 2.17.0
|
||||
Requires: python-six >= 1.10.0
|
||||
ExcludeArch: %ix86 %arm ppc
|
||||
# SECTION test requirements
|
||||
BuildRequires: %{python_module msgpack}
|
||||
@ -60,10 +60,6 @@ InfluxDB-Python is a client for interacting with InfluxDB 1.x
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n influxdb-%{version}
|
||||
# remove extra mock
|
||||
sed -e 's/^import mock/from unittest import mock/' \
|
||||
-e 's/^from mock import/from unittest.mock import/' \
|
||||
-i influxdb/tests/*.py influxdb/tests/*/*.py
|
||||
|
||||
%build
|
||||
%python_build
|
||||
@ -73,6 +69,10 @@ sed -e 's/^import mock/from unittest import mock/' \
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
# remove extra mock
|
||||
sed -e 's/^import mock/from unittest import mock/' \
|
||||
-e 's/^from mock import/from unittest.mock import/' \
|
||||
-i influxdb/tests/*.py influxdb/tests/*/*.py
|
||||
# https://github.com/influxdata/influxdb-python/issues/884
|
||||
donttest="test_write_points_from_dataframe_with_nan_json or test_write_points_from_dataframe_with_tags_and_nan_json"
|
||||
%pytest influxdb -k "not ($donttest)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user