Verify package.xml version in conf.py Check in docs/source/conf.py that the version number in package.xml matches include/ceres/version.h so CI catches any version skew when the source version is bumped. Change-Id: Ib8e92176836d40d81a6b0017308d66b19a350bc7
diff --git a/docs/source/conf.py b/docs/source/conf.py index bdb337d..e620a80 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py
@@ -22,6 +22,13 @@ version = f'{_major}.{_minor}' release = f'{_major}.{_minor}.{_patch}' +# Verify that package.xml matches include/ceres/version.h. +_package_xml = (_repo_root / 'package.xml').read_text(encoding='utf-8') +if f'<version>{release}</version>' not in _package_xml: + raise RuntimeError( + f'package.xml version does not match version.h ({release})' + ) + # Parse the latest stable release metadata from CITATION.cff for index.rst. _citation_cff = (_repo_root / 'CITATION.cff').read_text(encoding='utf-8') _stable_version = re.search(