diff --git a/rerun_py/tests/unit/test_version.py b/rerun_py/tests/unit/test_version.py index 32f93472695a..d941a9f30c79 100644 --- a/rerun_py/tests/unit/test_version.py +++ b/rerun_py/tests/unit/test_version.py @@ -7,6 +7,8 @@ def test_version() -> None: ver = semver.VersionInfo.parse(rr.__version__) + assert len(rr.__version_info__) == 4 + assert ver.major == rr.__version_info__[0] assert ver.minor == rr.__version_info__[1] assert ver.patch == rr.__version_info__[2] @@ -15,9 +17,7 @@ def test_version() -> None: assert ver.prerelease == rr.__version_info__[3] else: # The last field is `None` if there is no prerelease. - # TODO(andreas): We released `0.18.0` `"None"` as prerelease, but really it should be `None`. - # assert rr.__version_info__[3] is None - assert len(rr.__version_info__) == 4 + assert rr.__version_info__[3] is None assert rr.__version__ in rr.version() diff --git a/scripts/ci/update_rerun_py_and_c_version.py b/scripts/ci/update_rerun_py_and_c_version.py index 34680d98372c..7622118e641c 100644 --- a/scripts/ci/update_rerun_py_and_c_version.py +++ b/scripts/ci/update_rerun_py_and_c_version.py @@ -33,10 +33,13 @@ def update_python_line(line: str, version_line: str, version_info_line: str) -> def set_rerun_py_version(init_path: Path, version: semver.VersionInfo) -> None: version_line = f'__version__ = "{version}"\n' - version_info_line = ( - # TODO(andreas): We released `0.18.0` `"None"` as prerelease, but really it should be `None`. - f'__version_info__ = ({version.major}, {version.minor}, {version.patch}, "{version.prerelease}")\n' - ) + version_info_items = list(str(item) for item in (version.major, version.minor, version.patch)) + if version.prerelease is not None: + version_info_items.append(f'"{version.prerelease}"') + else: + version_info_items.append("None") + + version_info_line = f'__version_info__ = ({", ".join(version_info_items)})\n' with init_path.open() as f: lines = f.readlines()