Skip to content

Add version resolution for OMPython with tests and CI checks - #480

Merged
adeas31 merged 1 commit into
OpenModelica:masterfrom
adeas31:version
Sep 24, 2026
Merged

adeas31 merged 1 commit into
OpenModelica:masterfrom
adeas31:version

Conversation

@adeas31

@adeas31 adeas31 commented Sep 24, 2026

Copy link
Copy Markdown
Member

Add OMPython._version to resolve the installed package version via importlib.metadata, falling back to reading pyproject.toml when running from an uninstalled source tree. Exposes version and get_version().

Only install tomli on Python < 3.11, since tomllib is available in the standard library from 3.11 onward.

Add unit tests covering both resolution paths: the installed-metadata path and the pyproject.toml fallback, including the case where both fail and resolution degrades to "unknown" instead of raising.

Update CI workflow to print the resolved OMPython version, fail the build if it resolves to "unknown", and surface it via step output and job summary.

@adeas31 adeas31 self-assigned this Sep 24, 2026
Add OMPython._version to resolve the installed package version via
importlib.metadata, falling back to reading pyproject.toml when
running from an uninstalled source tree. Exposes __version__ and
get_version().

Only install tomli on Python < 3.11, since tomllib is available in
the standard library from 3.11 onward.

Add unit tests covering both resolution paths: the installed-metadata
path and the pyproject.toml fallback, including the case where both
fail and resolution degrades to "unknown" instead of raising.

Update CI workflow to print the resolved OMPython version, fail the
build if it resolves to "unknown", and surface it via step output
and job summary.
@adeas31
adeas31 enabled auto-merge (squash) September 24, 2026 16:31
@adeas31
adeas31 merged commit ee22270 into OpenModelica:master Sep 24, 2026
10 checks passed
@adeas31
adeas31 deleted the version branch September 25, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant