diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..b3b2709 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,5 @@ +[pytest] +filterwarnings = + error + # docutils planned change in 0.21 without clear solution yet + ignore:The frontend.*:DeprecationWarning diff --git a/setup.cfg b/setup.cfg index d8b680a..25cc4d6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ author_email = openstack-discuss@lists.openstack.org maintainer = PyCQA maintainer_email = code-quality@python.org license = Apache 2.0 -license_file = LICENSE +license_files = LICENSE classifiers = Development Status :: 5 - Production/Stable @@ -60,7 +60,9 @@ include_package_data = True zip_safe = False # These are required in actual runtime: install_requires = - docutils + # Ceiled due to DeprecationWarning: The frontend.OptionParser class will be + # replaced by a subclass of argparse.ArgumentParser in Docutils 0.21 or later. + docutils < 0.21 # see restructuredtext-lint>=0.7 stevedore tomli; python_version < '3.11' diff --git a/src/doc8/checks.py b/src/doc8/checks.py index 92a3ba1..4e9ecd0 100644 --- a/src/doc8/checks.py +++ b/src/doc8/checks.py @@ -160,7 +160,7 @@ def extract_lines(node, start_line): def gather_lines(node): lines = [] - for n in node.traverse(include_self=True): + for n in node.findall(include_self=True): lines.extend(extract_lines(n, find_line(n))) return lines diff --git a/src/doc8/utils.py b/src/doc8/utils.py index 5f5af09..b8bd08a 100644 --- a/src/doc8/utils.py +++ b/src/doc8/utils.py @@ -57,7 +57,7 @@ def path_ignorable(path): def filtered_traverse(document, filter_func): - for n in document.traverse(include_self=True): + for n in document.findall(include_self=True): if filter_func(n): yield n diff --git a/tox.ini b/tox.ini index a64886a..3f3b4b1 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ isolated_build = True [testenv] deps = -r{toxinidir}/test-requirements.txt -commands = pytest {posargs} +commands = pytest -v {posargs} whitelist_externals = rm sh