Skip to content

Commit 2462598

Browse files
authored
Merge pull request #105 from domdfcoding/issue-104
Fix DeprecationWarning on Python 3.10
2 parents c8feb4a + ca2a843 commit 2462598

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

tabulate.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
from __future__ import print_function
66
from __future__ import unicode_literals
77
from collections import namedtuple
8-
from platform import python_version_tuple
8+
import sys
99
import re
1010
import math
1111

1212

13-
if python_version_tuple() >= ("3", "3", "0"):
13+
if sys.version_info >= (3, 3):
1414
from collections.abc import Iterable
1515
else:
1616
from collections import Iterable
1717

18-
if python_version_tuple()[0] < "3":
18+
if sys.version_info[0] < 3:
1919
from itertools import izip_longest
2020
from functools import partial
2121

tox.ini

+35-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# for testing and it is disabled by default.
99

1010
[tox]
11-
envlist = lint, py27, py35, py36, py37, py38
11+
envlist = lint, py27, py35, py36, py37, py38, py39, py310
1212

1313
[testenv]
1414
commands = pytest -v --doctest-modules --ignore benchmark.py
@@ -97,6 +97,40 @@ deps =
9797
pandas
9898
wcwidth
9999

100+
101+
[testenv:py39]
102+
basepython = python3.9
103+
commands = pytest -v --doctest-modules --ignore benchmark.py
104+
deps =
105+
pytest
106+
107+
[testenv:py39-extra]
108+
basepython = python3.9
109+
commands = pytest -v --doctest-modules --ignore benchmark.py
110+
deps =
111+
pytest
112+
numpy
113+
pandas
114+
wcwidth
115+
116+
117+
[testenv:py310]
118+
basepython = python3.10
119+
commands = pytest -v --doctest-modules --ignore benchmark.py
120+
deps =
121+
pytest
122+
123+
[testenv:py310-extra]
124+
basepython = python3.10
125+
setenv = PYTHONDEVMODE = 1
126+
commands = pytest -v --doctest-modules --ignore benchmark.py
127+
deps =
128+
pytest
129+
numpy
130+
pandas
131+
wcwidth
132+
133+
100134
[flake8]
101135
max-complexity = 22
102136
max-line-length = 99

0 commit comments

Comments
 (0)