Skip to content

Commit 89b8493

Browse files
committed
DOC: Validate versions.json before building docs #61573
1 parent cfe54bd commit 89b8493

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

web/pandas/versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
"name": "1.0",
5050
"version": "1.0",
5151
"url": "https://pandas.pydata.org/pandas-docs/version/1.0/"
52-
}
52+
},
5353
]

web/pandas_web.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,11 @@ def main(
441441
For ``.md`` and ``.html`` files, render them with the context
442442
before copying them. ``.md`` files are transformed to HTML.
443443
"""
444+
# Sanity check: validate that versions.json is valid JSON
445+
versions_path = os.path.join(source_path, "versions.json")
446+
with open(versions_path, encoding="utf-8") as f:
447+
json.load(f)
448+
444449
config_fname = os.path.join(source_path, "config.yml")
445450

446451
shutil.rmtree(target_path, ignore_errors=True)

0 commit comments

Comments
 (0)