Skip to content

Commit

Permalink
Add imports for Python2.7 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Leclercq authored and ggreg committed Aug 31, 2017
1 parent bc14206 commit 8c8d6de
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 5 deletions.
3 changes: 3 additions & 0 deletions integration_tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from contextlib import closing
import logging
Expand Down
3 changes: 3 additions & 0 deletions integration_tests/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import fixtures
from fixtures import run_presto
Expand Down
3 changes: 3 additions & 0 deletions prestodb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from . import dbapi
from . import client
Expand Down
12 changes: 11 additions & 1 deletion prestodb/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import abc
import os
Expand Down
3 changes: 3 additions & 0 deletions prestodb/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
>> query = PrestoQuery(request, sql)
>> rows = list(query.execute())
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import logging
import os
Expand Down
3 changes: 3 additions & 0 deletions prestodb/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

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

Expand Down
4 changes: 4 additions & 0 deletions prestodb/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
Fetch methods returns rows as a list of lists on purpose to let the caller
decide to convert then to a list of tuples.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from future.standard_library import install_aliases
install_aliases()
import logging
Expand Down
1 change: 0 additions & 1 deletion prestodb/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import functools
import logging
Expand Down
15 changes: 15 additions & 0 deletions prestodb/redirect.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import abc
from future.standard_library import install_aliases
install_aliases()
Expand Down
3 changes: 3 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import httpretty
import pytest
Expand Down
2 changes: 0 additions & 2 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals


from prestodb import exceptions
import pytest
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
envlist = py27,py35,py3.6,pypy2

[testenv]
deps=pytest
deps = pytest
httpretty
commands = pytest -s tests/ integration_tests/

0 comments on commit 8c8d6de

Please sign in to comment.