Skip to content

Commit 710b615

Browse files
Migrate to modern docutils interface (#1372)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 8834b89 commit 710b615

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ botocore-dev = [
7373
dev = [
7474
"dill >= 0.3.3, < 0.5", # Used in test_patches.py
7575
"docker >= 7.1, < 8",
76-
"docutils >= 0.16, < 0.22", # Used in test_version.py
76+
"docutils >= 0.19, < 0.22", # Used in test_version.py
7777
"moto[server,s3,sqs,awslambda,dynamodb,cloudformation,sns,batch,ec2,rds] >= 5.0.11, < 6",
7878
"packaging >= 24.1, < 26", # Used in test_version.py
7979
"pip >= 24.3.1, < 26", # Used in test_version.py

tests/test_version.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333
)
3434

3535

36-
# from: https://stackoverflow.com/a/48719723/1241593
36+
# from: https://stackoverflow.com/a/75996218
3737
def _parse_rst(text: str) -> docutils.nodes.document:
3838
parser = docutils.parsers.rst.Parser()
39-
components = (docutils.parsers.rst.Parser,)
40-
settings = docutils.frontend.OptionParser(
41-
components=components
42-
).get_default_values()
39+
settings = docutils.frontend.get_default_settings(
40+
docutils.parsers.rst.Parser
41+
)
4342
document = docutils.utils.new_document('<rst-doc>', settings=settings)
4443
parser.parse(text, document)
4544
return document

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)