Skip to content

Commit ef7d571

Browse files
asottileggreg
authored andcommitted
Use lighter weight six for python3 compatibility
We're seeing issues of `python-future`'s types leaking out of the presto client and causing bad interactions with other libraries. `future` wasn't actually being used for all that much and was easily replaced with (already used) `six`. Additionally, I made `typing` and `ipaddress` only install in python2.x, they are already standard library modules in the other supported python versions.
1 parent cd986e6 commit ef7d571

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

prestodb/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import abc
1717
import os
1818

19-
from future.utils import with_metaclass
19+
from six import with_metaclass
2020
from typing import Any, Optional, Text # NOQA
2121

2222
import requests_kerberos

prestodb/dbapi.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
from __future__ import division
2222
from __future__ import print_function
2323

24-
from future.standard_library import install_aliases
25-
install_aliases()
26-
2724
from typing import Any, List, Optional # NOQA for mypy types
2825

2926
from prestodb import constants

prestodb/redirect.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
from __future__ import print_function
1515

1616
import abc
17-
from future.standard_library import install_aliases
18-
install_aliases()
1917

20-
from future.utils import with_metaclass
18+
from six import with_metaclass
2119
import ipaddress
2220
import socket
2321
from typing import Any, Text # NOQA
24-
from urllib.parse import urlparse
22+
from six.moves.urllib_parse import urlparse
2523

2624

2725
class RedirectHandler(with_metaclass(abc.ABCMeta)): # type: ignore

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@
5757
],
5858
install_requires=[
5959
'click',
60-
'future',
61-
'ipaddress',
6260
'requests',
6361
'requests_kerberos',
6462
'six',
65-
'typing',
6663
],
67-
extras_require={'tests':[
68-
'httpretty',
69-
'pytest',
70-
'pytest-runner',
71-
]}
64+
extras_require={
65+
'tests':[
66+
'httpretty',
67+
'pytest',
68+
'pytest-runner',
69+
],
70+
':python_version=="2.7"': ['ipaddress', 'typing'],
71+
},
7272
)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py35,py3.6,pypy2
2+
envlist = py27,py35,py36,pypy2
33

44
[testenv]
55
deps = pytest

0 commit comments

Comments
 (0)