Skip to content

Commit

Permalink
Use lighter weight six for python3 compatibility
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
asottile authored and ggreg committed Dec 17, 2018
1 parent cd986e6 commit ef7d571
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion prestodb/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import abc
import os

from future.utils import with_metaclass
from six import with_metaclass
from typing import Any, Optional, Text # NOQA

import requests_kerberos
Expand Down
3 changes: 0 additions & 3 deletions prestodb/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
from __future__ import division
from __future__ import print_function

from future.standard_library import install_aliases
install_aliases()

from typing import Any, List, Optional # NOQA for mypy types

from prestodb import constants
Expand Down
6 changes: 2 additions & 4 deletions prestodb/redirect.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
from __future__ import print_function

import abc
from future.standard_library import install_aliases
install_aliases()

from future.utils import with_metaclass
from six import with_metaclass
import ipaddress
import socket
from typing import Any, Text # NOQA
from urllib.parse import urlparse
from six.moves.urllib_parse import urlparse


class RedirectHandler(with_metaclass(abc.ABCMeta)): # type: ignore
Expand Down
16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@
],
install_requires=[
'click',
'future',
'ipaddress',
'requests',
'requests_kerberos',
'six',
'typing',
],
extras_require={'tests':[
'httpretty',
'pytest',
'pytest-runner',
]}
extras_require={
'tests':[
'httpretty',
'pytest',
'pytest-runner',
],
':python_version=="2.7"': ['ipaddress', 'typing'],
},
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py35,py3.6,pypy2
envlist = py27,py35,py36,pypy2

[testenv]
deps = pytest
Expand Down

0 comments on commit ef7d571

Please sign in to comment.