Skip to content

Commit 5923ca0

Browse files
authored
Address some deprecation warnings (#103)
1 parent efac416 commit 5923ca0

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

pytest.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[pytest]
2+
filterwarnings =
3+
error
4+
# docutils planned change in 0.21 without clear solution yet
5+
ignore:The frontend.*:DeprecationWarning

setup.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ author_email = [email protected]
1616
maintainer = PyCQA
1717
maintainer_email = [email protected]
1818
license = Apache 2.0
19-
license_file = LICENSE
19+
license_files = LICENSE
2020
classifiers =
2121
Development Status :: 5 - Production/Stable
2222

@@ -60,7 +60,9 @@ include_package_data = True
6060
zip_safe = False
6161
# These are required in actual runtime:
6262
install_requires =
63-
docutils
63+
# Ceiled due to DeprecationWarning: The frontend.OptionParser class will be
64+
# replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later.
65+
docutils>=0.19,<0.21
6466
restructuredtext-lint>=0.7
6567
stevedore
6668
tomli; python_version < '3.11'

src/doc8/checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def extract_lines(node, start_line):
160160

161161
def gather_lines(node):
162162
lines = []
163-
for n in node.traverse(include_self=True):
163+
for n in node.findall(include_self=True):
164164
lines.extend(extract_lines(n, find_line(n)))
165165
return lines
166166

src/doc8/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def path_ignorable(path):
5757

5858

5959
def filtered_traverse(document, filter_func):
60-
for n in document.traverse(include_self=True):
60+
for n in document.findall(include_self=True):
6161
if filter_func(n):
6262
yield n
6363

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ isolated_build = True
66
[testenv]
77
deps =
88
-r{toxinidir}/test-requirements.txt
9-
commands = pytest {posargs}
9+
commands = pytest -v {posargs}
1010
whitelist_externals =
1111
rm
1212
sh

0 commit comments

Comments
 (0)