Skip to content

Commit

Permalink
make compatible with python 3.7 (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
villebro authored Jun 5, 2020
1 parent fa2487e commit c44f364
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ matrix:
python: 3.6
- env: TOXENV=py37
python: 3.7
- env: TOXENV=py38
python: 3.8
before_install:
- sudo apt-get update
- sudo apt-get install libgnutls28-dev
Expand Down
4 changes: 2 additions & 2 deletions pydruid/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from pydruid.utils.query_utils import UnicodeWriter


class Query(collections.MutableSequence):
class Query(collections.abc.MutableSequence):
"""
Query objects are produced by PyDruid clients and can be used for
exporting query results into TSV files or
Expand Down Expand Up @@ -54,7 +54,7 @@ def parse(self, data):
self.result = res
else:
raise IOError(
"{Error parsing result: {0} for {1} query".format(
"Error parsing result: {0} for {1} query".format(
self.result_json, self.query_type
)
)
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
black==19.3b0
black==19.10b0
flake8-mypy==17.8.0
flake8==3.7.7
flake8==3.8.2
ipdb==0.12
pip-tools==4.4.0
pre-commit==1.17.0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
long_description_content_type="text/markdown",
install_requires=install_requires,
extras_require=extras_require,
setup_requires=["pytest-runner"],
tests_require=["pytest", "six", "mock"],
entry_points={
"console_scripts": ["pydruid = pydruid.console:main"],
Expand All @@ -54,5 +53,6 @@
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
)
2 changes: 1 addition & 1 deletion tests/db/test_cursor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

from collections import namedtuple
from mock import patch
from unittest.mock import patch
import unittest

from requests.models import Response
Expand Down
2 changes: 1 addition & 1 deletion tests/test_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pytest

from mock import Mock
from unittest.mock import Mock
from pydruid.utils.aggregators import doublesum
from pydruid.utils.filters import Dimension

Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import textwrap

import pytest
from mock import patch, Mock
from unittest.mock import patch, Mock
from six.moves import urllib
from six import StringIO

Expand Down
7 changes: 3 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ commands =
pytest {posargs}
deps =
-rrequirements.txt
mock==3.0.5
pytest==4.6.9
pytest==5.4.3
parallel_show_output = true
usedevelop = true

[testenv:black]
commands =
black --check pydruid setup.py tests
deps =
black>=19.3b0
black==19.10b0

[testenv:flake8]
commands =
flake8 pydruid setup.py
deps =
flake8==3.7.7
flake8==3.8.2

[tox]
envlist =
Expand Down

0 comments on commit c44f364

Please sign in to comment.