Skip to content

Commit f0445b7

Browse files
committed
Add migration script steps to update mkdocs.yml
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent e6aed76 commit f0445b7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

cookiecutter/migrate.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,31 @@ def main() -> None:
3939
print("Disabling CODEOWNERS review requirement in GitHub ruleset...")
4040
disable_codeowners_review_requirement()
4141
print("=" * 72)
42+
print("Updating the mkdocs.yml for mkdocstrings-python v2 compatibility...")
43+
update_mkdocs_yml_mkdocstrings_python_v2()
44+
print("=" * 72)
4245
print("Migration script finished. Remember to follow any manual instructions.")
4346
print("=" * 72)
4447

4548

49+
def update_mkdocs_yml_mkdocstrings_python_v2() -> None:
50+
"""Rename 'inventories' imports to 'inventory'."""
51+
replace_file_contents_atomically(
52+
filepath=Path("mkdocs.yml"),
53+
old=" import:",
54+
new=" inventories:",
55+
)
56+
replace_file_contents_atomically(
57+
filepath=Path("mkdocs.yml"),
58+
old="""\
59+
options:
60+
paths: ["src"]""",
61+
new="""\
62+
paths: ["src"]
63+
options:""",
64+
)
65+
66+
4667
def create_dependabot_auto_merge_workflow() -> None:
4768
"""Create the Dependabot auto-merge workflow file."""
4869
workflow_dir = Path(".github") / "workflows"

0 commit comments

Comments
 (0)