Skip to content

Commit 8c8d6de

Browse files
Greg Leclercqggreg
authored andcommitted
Add imports for Python2.7 compatibility
1 parent bc14206 commit 8c8d6de

File tree

12 files changed

+50
-5
lines changed

12 files changed

+50
-5
lines changed

integration_tests/fixtures.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
1215

1316
from contextlib import closing
1417
import logging

integration_tests/test_dbapi.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
1215

1316
import fixtures
1417
from fixtures import run_presto

prestodb/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
1215

1316
from . import dbapi
1417
from . import client

prestodb/auth.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
112
from __future__ import absolute_import
213
from __future__ import division
314
from __future__ import print_function
4-
from __future__ import unicode_literals
515

616
import abc
717
import os

prestodb/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
>> query = PrestoQuery(request, sql)
3333
>> rows = list(query.execute())
3434
"""
35+
from __future__ import absolute_import
36+
from __future__ import division
37+
from __future__ import print_function
3538

3639
import logging
3740
import os

prestodb/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
1215

1316
from typing import Any, Optional, Text # NOQA: mypy types
1417

prestodb/dbapi.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
Fetch methods returns rows as a list of lists on purpose to let the caller
1818
decide to convert then to a list of tuples.
1919
"""
20+
from __future__ import absolute_import
21+
from __future__ import division
22+
from __future__ import print_function
23+
2024
from future.standard_library import install_aliases
2125
install_aliases()
2226
import logging

prestodb/exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
from __future__ import absolute_import
1919
from __future__ import division
2020
from __future__ import print_function
21-
from __future__ import unicode_literals
2221

2322
import functools
2423
import logging

prestodb/redirect.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# Licensed under the Apache License, Version 2.0 (the "License");
2+
# you may not use this file except in compliance with the License.
3+
# You may obtain a copy of the License at
4+
#
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
#
7+
# Unless required by applicable law or agreed to in writing, software
8+
# distributed under the License is distributed on an "AS IS" BASIS,
9+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10+
# See the License for the specific language governing permissions and
11+
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
15+
116
import abc
217
from future.standard_library import install_aliases
318
install_aliases()

tests/test_client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
12+
from __future__ import absolute_import
13+
from __future__ import division
14+
from __future__ import print_function
1215

1316
import httpretty
1417
import pytest

tests/test_exceptions.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
from __future__ import absolute_import
1919
from __future__ import division
2020
from __future__ import print_function
21-
from __future__ import unicode_literals
22-
2321

2422
from prestodb import exceptions
2523
import pytest

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
envlist = py27,py35,py3.6,pypy2
33

44
[testenv]
5-
deps=pytest
5+
deps = pytest
6+
httpretty
67
commands = pytest -s tests/ integration_tests/

0 commit comments

Comments
 (0)