Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Commit 7f5303c

Browse files
michael-kNurdok
authored andcommitted
Add support for python 3.7 (#324)
* Add support for python 3.7 * Import Set from collections.abc instead of collections Importing abstract base classes from collections is deprecated since Python 3.7, see https://bugs.python.org/issue25988.
1 parent 676e4f3 commit 7f5303c

File tree

8 files changed

+26
-4
lines changed

8 files changed

+26
-4
lines changed

.appveyor.yml

+2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ environment:
44
- TOXENV: "py34-tests"
55
- TOXENV: "py35-tests"
66
- TOXENV: "py36-tests"
7+
- TOXENV: "py37-tests"
78
- TOXENV: "pypy-tests"
89
- TOXENV: "py27-install"
910
- TOXENV: "py34-install"
1011
- TOXENV: "py35-install"
1112
- TOXENV: "py36-install"
13+
- TOXENV: "py37-install"
1214
- TOXENV: "pypy-install"
1315
- TOXENV: "docs"
1416

.travis.yml

+8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ matrix:
1717
env: TOXENV=py35-tests
1818
- python: 3.6
1919
env: TOXENV=py36-tests
20+
- python: 3.7
21+
dist: xenial
22+
sudo: required
23+
env: TOXENV=py37-tests
2024
- python: pypy
2125
env: TOXENV=pypy-tests
2226
- python: 2.7
@@ -27,6 +31,10 @@ matrix:
2731
env: TOXENV=py35-install
2832
- python: 3.6
2933
env: TOXENV=py36-install
34+
- python: 3.7
35+
dist: xenial
36+
sudo: required
37+
env: TOXENV=py37-install
3038
- python: pypy
3139
env: TOXENV=pypy-install
3240
- python: 2.7

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ docstring conventions.
2525
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
2626
should not be considered a reference implementation.
2727

28-
**pydocstyle** supports Python 2.7, 3.4, 3.5, 3.6 and pypy.
28+
**pydocstyle** supports Python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy.
2929

3030
Quick Start
3131
-----------

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ docstring conventions.
88
`PEP 257 <http://www.python.org/dev/peps/pep-0257/>`_ out of the box, but it
99
should not be considered a reference implementation.
1010

11-
**pydocstyle** supports Python 2.7, 3.4, 3.5, 3.6 and pypy.
11+
**pydocstyle** supports Python 2.7, 3.4, 3.5, 3.6, 3.7, and pypy.
1212

1313

1414
.. include:: quickstart.rst

docs/release_notes.rst

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ New features
1616
* Violations are now reported on the line where the docstring starts, not the
1717
line of the ``def``/``class`` it corresponds to (#238, #83).
1818
* Updated description of pep257 and numpy conventions (#300).
19+
* Added support for Python 3.7 (#324).
1920

2021
Bug Fixes
2122

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
'Programming Language :: Python :: 3.4',
3737
'Programming Language :: Python :: 3.5',
3838
'Programming Language :: Python :: 3.6',
39+
'Programming Language :: Python :: 3.7',
3940
'Operating System :: OS Independent',
4041
'License :: OSI Approved :: MIT License',
4142
],

src/pydocstyle/config.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import copy
44
import itertools
55
import os
6-
from collections import Set, namedtuple
6+
from collections import namedtuple
77
from re import compile as re
88

99

@@ -13,6 +13,12 @@
1313
from .utils import __version__, log
1414
from .violations import ErrorRegistry, conventions
1515

16+
try:
17+
from collections.abc import Set
18+
except ImportError:
19+
# python 2.7
20+
from collections import Set
21+
1622

1723
def check_initialized(method):
1824
"""Check that the configuration object was initialized."""

tox.ini

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# install tox" and then run "tox" from this directory.
55

66
[tox]
7-
envlist = {py27, py34, py35, py36, pypy}-{tests, install}, docs
7+
envlist = {py27, py34, py35, py36, py37, pypy}-{tests, install}, docs
88

99
[testenv]
1010
# Make sure reading the UTF-8 from test.py works regardless of the locale used.
@@ -39,6 +39,10 @@ commands = {[testenv:py27-install]commands}
3939
skip_install = {[testenv:py27-install]skip_install}
4040
commands = {[testenv:py27-install]commands}
4141

42+
[testenv:py37-install]
43+
skip_install = {[testenv:py27-install]skip_install}
44+
commands = {[testenv:py27-install]commands}
45+
4246
[testenv:pypy-install]
4347
skip_install = {[testenv:py27-install]skip_install}
4448
commands = {[testenv:py27-install]commands}

0 commit comments

Comments
 (0)