Skip to content

Commit bd36f60

Browse files
authored
Merge pull request #226 from splitio/task/deprecatePython2
Task/deprecate python2
2 parents 8becd57 + 9bf392f commit bd36f60

Some content is hidden

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

88 files changed

+268
-2099
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ target/
7171

7272
# vim backup files
7373
*.swp
74+
75+
.DS_Store

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ git:
55

66
matrix:
77
include:
8-
- python: '2.7'
98
- python: '3.6'
109
after_success:
1110
- bash sonar-scanner.sh

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
9.0.0 (Apr 30, 2021)
2+
- BREAKING CHANGE: Removed splitSdkMachineIp and splitSdkMachineName configs.
3+
- BREAKING CHANGE: Deprecated uWSGI local cache.
4+
- BREAKING CHANGE: Deprecated Python2 support.
5+
- Removed six, future and futures libs for compatibility between Python2 and Python3.
6+
- Updated strings encoding to utf-8 by default for Redis.
7+
8+
8.4.1 (Apr 16, 2021)
9+
- Bumped mmh3cffi dependency which now requires c99 flag to build.
10+
111
8.4.0 (Jan 6, 2021)
212
- Added RecordStats for supporting pipelined recording in redis when treatment call is made.
313
- Added hooks support for preforked servers.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This SDK is designed to work with Split, the platform for controlled rollouts, w
77
[![Twitter Follow](https://img.shields.io/twitter/follow/splitsoftware.svg?style=social&label=Follow&maxAge=1529000)](https://twitter.com/intent/follow?screen_name=splitsoftware)
88

99
## Compatibility
10-
This SDK is compatible with **Python 2.7 and higher**.
10+
This SDK is compatible with **Python 3 and higher**.
1111

1212
## Getting started
1313
Below is a simple example that describes the instantiation and most basic usage of our SDK:

doc/source/introduction.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project provides Python programs access to the `Split.io <http://split.io/>
66
Installation and Requirements
77
-----------------------------
88

9-
``splitio_client`` supports both Python 2 (2.7 or later) and Python 3 (3.3 or later). Stable versions can be installed from `PyPI <https://pypi.python.org>`_ using pip: ::
9+
``splitio_client`` supports Python 3 (3.3 or later). Stable versions can be installed from `PyPI <https://pypi.python.org>`_ using pip: ::
1010

1111
pip install splitio_client
1212

setup.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,43 @@
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
66

77
TESTS_REQUIRES = [
88
'flake8',
9-
'pytest<=4.6', # for deprecated python versions: https://docs.pytest.org/en/latest/py27-py34-deprecation.html
10-
'pytest-mock==2.0.0',
9+
'pytest>=6.2.3',
10+
'pytest-mock>=3.5.1',
1111
'coverage',
1212
'pytest-cov',
13-
'mock;python_version<"3"'
1413
]
1514

1615
INSTALL_REQUIRES = [
1716
'requests>=2.9.1',
1817
'pyyaml>=5.1',
19-
'future>=0.15.2',
2018
'docopt>=0.6.2',
21-
'six>=1.10.0',
2219
'enum34;python_version<"3.4"',
23-
'futures>=3.0.5;python_version<"3"'
2420
]
2521

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

2925
setup(
3026
name='splitio_client',
31-
version=__version__, # pylint: disable=undefined-variable
27+
version=__version__, # pylint: disable=undefined-variable
3228
description='Split.io Python Client',
3329
author='Patricio Echague, Sebastian Arrubia',
3430
author_email='pato@split.io, sebastian@split.io',
3531
url='https://github.com/splitio/python-client',
36-
download_url=('https://github.com/splitio/python-client/tarball/' + __version__), # pylint: disable=undefined-variable
32+
download_url=('https://github.com/splitio/python-client/tarball/' + __version__), # pylint: disable=undefined-variable
3733
license='Apache License 2.0',
3834
install_requires=INSTALL_REQUIRES,
3935
tests_require=TESTS_REQUIRES,
4036
extras_require={
4137
'test': TESTS_REQUIRES,
4238
'redis': ['redis>=2.10.5'],
4339
'uwsgi': ['uwsgi>=2.0.0'],
44-
'cpphash': ['mmh3cffi==0.2.0'],
40+
'cpphash': ['mmh3cffi==0.2.1'],
4541
},
4642
setup_requires=['pytest-runner'],
4743
classifiers=[

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

0 commit comments

Comments
 (0)