Skip to content

Commit de1ada6

Browse files
author
Matias Melograno
committed
removed future
1 parent 1ae4b26 commit de1ada6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+110
-329
lines changed

setup.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""Setup module."""
2-
#!/usr/bin/env python
2+
# !/usr/bin/env python
33

44
from os import path
55
from setuptools import setup, find_packages
@@ -16,23 +16,21 @@
1616
INSTALL_REQUIRES = [
1717
'requests>=2.9.1',
1818
'pyyaml>=5.1',
19-
'future>=0.15.2',
2019
'docopt>=0.6.2',
2120
'enum34;python_version<"3.4"',
22-
'futures>=3.0.5;python_version<"3"'
2321
]
2422

2523
with open(path.join(path.abspath(path.dirname(__file__)), 'splitio', 'version.py')) as f:
2624
exec(f.read()) # pylint: disable=exec-used
2725

2826
setup(
2927
name='splitio_client',
30-
version=__version__, # pylint: disable=undefined-variable
28+
version=__version__, # pylint: disable=undefined-variable
3129
description='Split.io Python Client',
3230
author='Patricio Echague, Sebastian Arrubia',
3331
author_email='pato@split.io, sebastian@split.io',
3432
url='https://github.com/splitio/python-client',
35-
download_url=('https://github.com/splitio/python-client/tarball/' + __version__), # pylint: disable=undefined-variable
33+
download_url=('https://github.com/splitio/python-client/tarball/' + __version__), # pylint: disable=undefined-variable
3634
license='Apache License 2.0',
3735
install_requires=INSTALL_REQUIRES,
3836
tests_require=TESTS_REQUIRES,

splitio/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from __future__ import absolute_import, division, print_function, \
2-
unicode_literals
3-
41
from splitio.client.factory import get_factory
52
from splitio.client.key import Key
63
from splitio.version import __version__

splitio/api/auth.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import logging
44
import json
55

6-
from future.utils import raise_from
7-
86
from splitio.api import APIException, headers_from_metadata
97
from splitio.api.client import HttpClientException
108
from splitio.models.token import from_raw
@@ -53,4 +51,4 @@ def authenticate(self):
5351
except HttpClientException as exc:
5452
_LOGGER.error('Exception raised while authenticating')
5553
_LOGGER.debug('Exception information: ', exc_info=True)
56-
raise_from(APIException('Could not perform authentication.'), exc)
54+
raise APIException('Could not perform authentication.') from exc

splitio/api/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""Synchronous HTTP Client for split API."""
2-
from __future__ import division
3-
42
from collections import namedtuple
53

6-
from future.utils import raise_from
74
import requests
85

96
HttpResponse = namedtuple('HttpResponse', ['status_code', 'body'])
@@ -107,7 +104,7 @@ def get(self, server, path, apikey, query=None, extra_headers=None): # pylint:
107104
)
108105
return HttpResponse(response.status_code, response.text)
109106
except Exception as exc: # pylint: disable=broad-except
110-
raise_from(HttpClientException('requests library is throwing exceptions'), exc)
107+
raise HttpClientException('requests library is throwing exceptions') from exc
111108

112109
def post(self, server, path, apikey, body, query=None, extra_headers=None): # pylint: disable=too-many-arguments
113110
"""
@@ -144,4 +141,4 @@ def post(self, server, path, apikey, body, query=None, extra_headers=None): # p
144141
)
145142
return HttpResponse(response.status_code, response.text)
146143
except Exception as exc: # pylint: disable=broad-except
147-
raise_from(HttpClientException('requests library is throwing exceptions'), exc)
144+
raise HttpClientException('requests library is throwing exceptions') from exc

splitio/api/events.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Events API module."""
22
import logging
33

4-
from future.utils import raise_from
5-
64
from splitio.api import APIException, headers_from_metadata
75
from splitio.api.client import HttpClientException
86

@@ -75,4 +73,4 @@ def flush_events(self, events):
7573
except HttpClientException as exc:
7674
_LOGGER.error('Error posting events because an exception was raised by the HTTPClient')
7775
_LOGGER.debug('Error: ', exc_info=True)
78-
raise_from(APIException('Events not flushed properly.'), exc)
76+
raise APIException('Events not flushed properly.') from exc

splitio/api/impressions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import logging
44
from itertools import groupby
55

6-
from future.utils import raise_from
7-
86
from splitio.api import APIException, headers_from_metadata
97
from splitio.api.client import HttpClientException
108
from splitio.engine.impressions import ImpressionsMode
@@ -107,7 +105,7 @@ def flush_impressions(self, impressions):
107105
'Error posting impressions because an exception was raised by the HTTPClient'
108106
)
109107
_LOGGER.debug('Error: ', exc_info=True)
110-
raise_from(APIException('Impressions not flushed properly.'), exc)
108+
raise APIException('Impressions not flushed properly.') from exc
111109

112110
def flush_counters(self, counters):
113111
"""
@@ -133,4 +131,4 @@ def flush_counters(self, counters):
133131
'HTTPClient'
134132
)
135133
_LOGGER.debug('Error: ', exc_info=True)
136-
raise_from(APIException('Impressions not flushed properly.'), exc)
134+
raise APIException('Impressions not flushed properly.') from exc

splitio/api/segments.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import json
44
import logging
55

6-
from future.utils import raise_from
7-
86
from splitio.api import APIException, headers_from_metadata
97
from splitio.api.client import HttpClientException
108

@@ -62,4 +60,4 @@ def fetch_segment(self, segment_name, change_number):
6260
segment_name
6361
)
6462
_LOGGER.debug('Error: ', exc_info=True)
65-
raise_from(APIException('Segments not fetched properly.'), exc)
63+
raise APIException('Segments not fetched properly.') from exc

splitio/api/splits.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import logging
44
import json
55

6-
from future.utils import raise_from
7-
86
from splitio.api import APIException, headers_from_metadata
97
from splitio.api.client import HttpClientException
108

@@ -55,4 +53,4 @@ def fetch_splits(self, change_number):
5553
except HttpClientException as exc:
5654
_LOGGER.error('Error fetching splits because an exception was raised by the HTTPClient')
5755
_LOGGER.debug('Error: ', exc_info=True)
58-
raise_from(APIException('Splits not fetched correctly.'), exc)
56+
raise APIException('Splits not fetched correctly.') from exc

splitio/api/telemetry.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
"""Telemetry API Module."""
22
import logging
33

4-
from future.utils import raise_from
5-
64
from splitio.api import APIException, headers_from_metadata
75
from splitio.api.client import HttpClientException
86

@@ -64,7 +62,7 @@ def flush_latencies(self, latencies):
6462
'Error posting latencies because an exception was raised by the HTTPClient'
6563
)
6664
_LOGGER.debug('Error: ', exc_info=True)
67-
raise_from(APIException('Latencies not flushed correctly.'), exc)
65+
raise APIException('Latencies not flushed correctly.') from exc
6866

6967
@staticmethod
7068
def _build_gauges(gauges):
@@ -102,7 +100,7 @@ def flush_gauges(self, gauges):
102100
'Error posting gauges because an exception was raised by the HTTPClient'
103101
)
104102
_LOGGER.debug('Error: ', exc_info=True)
105-
raise_from(APIException('Gauges not flushed correctly.'), exc)
103+
raise APIException('Gauges not flushed correctly.') from exc
106104

107105
@staticmethod
108106
def _build_counters(counters):
@@ -140,4 +138,4 @@ def flush_counters(self, counters):
140138
'Error posting counters because an exception was raised by the HTTPClient'
141139
)
142140
_LOGGER.debug('Error: ', exc_info=True)
143-
raise_from(APIException('Counters not flushed correctly.'), exc)
141+
raise APIException('Counters not flushed correctly.') from exc

splitio/client/client.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
"""A module for Split.io SDK API clients."""
2-
from __future__ import absolute_import, division, print_function, \
3-
unicode_literals
4-
52
import logging
63
import time
74
from splitio.engine.evaluator import Evaluator, CONTROL

0 commit comments

Comments
 (0)