File: remove_six.patch

package info (click to toggle)
influxdb-python 5.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,576 kB
  • sloc: python: 7,274; makefile: 5
file content (131 lines) | stat: -rw-r--r-- 3,730 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Description: remove need for python3-six
Author: Alexandre Detiste <tchet@debian.org>
Forwarded: no, project is archived

--- a/influxdb/helper.py
+++ b/influxdb/helper.py
@@ -10,7 +10,6 @@
 from datetime import datetime
 from warnings import warn
 
-import six
 
 
 class SeriesHelper(object):
@@ -176,7 +175,7 @@
         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,
--- a/influxdb/influxdb08/client.py
+++ b/influxdb/influxdb08/client.py
@@ -7,8 +7,7 @@
 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 @@
         """
         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')
--- a/influxdb/influxdb08/helper.py
+++ b/influxdb/influxdb08/helper.py
@@ -9,7 +9,6 @@
 from collections import namedtuple, defaultdict
 from warnings import warn
 
-import six
 
 
 class SeriesHelper(object):
@@ -141,7 +140,7 @@
         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]
--- a/influxdb/line_protocol.py
+++ b/influxdb/line_protocol.py
@@ -11,7 +11,6 @@
 
 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 @@
     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 @@
         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 _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
--- a/influxdb/client.py
+++ b/influxdb/client.py
@@ -21,7 +21,7 @@
 import requests
 import requests.exceptions
 from requests.adapters import HTTPAdapter
-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
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,4 @@
 python-dateutil>=2.6.0
 pytz
 requests>=2.17.0
-six>=1.10.0
 msgpack