Skip to content

Commit c44f364

Browse files
authored
make compatible with python 3.7 (#216)
1 parent fa2487e commit c44f364

File tree

8 files changed

+13
-12
lines changed

8 files changed

+13
-12
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ matrix:
99
python: 3.6
1010
- env: TOXENV=py37
1111
python: 3.7
12+
- env: TOXENV=py38
13+
python: 3.8
1214
before_install:
1315
- sudo apt-get update
1416
- sudo apt-get install libgnutls28-dev

pydruid/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pydruid.utils.query_utils import UnicodeWriter
2626

2727

28-
class Query(collections.MutableSequence):
28+
class Query(collections.abc.MutableSequence):
2929
"""
3030
Query objects are produced by PyDruid clients and can be used for
3131
exporting query results into TSV files or
@@ -54,7 +54,7 @@ def parse(self, data):
5454
self.result = res
5555
else:
5656
raise IOError(
57-
"{Error parsing result: {0} for {1} query".format(
57+
"Error parsing result: {0} for {1} query".format(
5858
self.result_json, self.query_type
5959
)
6060
)

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
black==19.3b0
1+
black==19.10b0
22
flake8-mypy==17.8.0
3-
flake8==3.7.7
3+
flake8==3.8.2
44
ipdb==0.12
55
pip-tools==4.4.0
66
pre-commit==1.17.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
long_description_content_type="text/markdown",
3737
install_requires=install_requires,
3838
extras_require=extras_require,
39-
setup_requires=["pytest-runner"],
4039
tests_require=["pytest", "six", "mock"],
4140
entry_points={
4241
"console_scripts": ["pydruid = pydruid.console:main"],
@@ -54,5 +53,6 @@
5453
"Programming Language :: Python :: 3.5",
5554
"Programming Language :: Python :: 3.6",
5655
"Programming Language :: Python :: 3.7",
56+
"Programming Language :: Python :: 3.8",
5757
],
5858
)

tests/db/test_cursor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
from collections import namedtuple
4-
from mock import patch
4+
from unittest.mock import patch
55
import unittest
66

77
from requests.models import Response

tests/test_async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import pytest
1919

20-
from mock import Mock
20+
from unittest.mock import Mock
2121
from pydruid.utils.aggregators import doublesum
2222
from pydruid.utils.filters import Dimension
2323

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import textwrap
33

44
import pytest
5-
from mock import patch, Mock
5+
from unittest.mock import patch, Mock
66
from six.moves import urllib
77
from six import StringIO
88

tox.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@ commands =
33
pytest {posargs}
44
deps =
55
-rrequirements.txt
6-
mock==3.0.5
7-
pytest==4.6.9
6+
pytest==5.4.3
87
parallel_show_output = true
98
usedevelop = true
109

1110
[testenv:black]
1211
commands =
1312
black --check pydruid setup.py tests
1413
deps =
15-
black>=19.3b0
14+
black==19.10b0
1615

1716
[testenv:flake8]
1817
commands =
1918
flake8 pydruid setup.py
2019
deps =
21-
flake8==3.7.7
20+
flake8==3.8.2
2221

2322
[tox]
2423
envlist =

0 commit comments

Comments
 (0)