As noted in #520 (comment), the --version flag in upstream-mark could be inferred from the local repository's suite.py files.
At the point upstream-mark runs, suite.py already contains the target version (with release: False) — the command only flips release to True. So the version string is already available locally without needing the user to pass it.
There is already a version-extraction pattern in SuiteOpsUtils.inferOpenMilestone() (using VERSION_PATTERN against compiler/mx.compiler/suite.py) that could be reused.
Proposed change:
- Make
--version optional in upstream-mark
- When omitted, read the version from
compiler/mx.compiler/suite.py in --dir and print it (e.g., "Auto-inferred version from suite.py: 23.1.11")
- Fail with a clear error if the version cannot be determined and
--version was not provided
As noted in #520 (comment), the
--versionflag inupstream-markcould be inferred from the local repository'ssuite.pyfiles.At the point
upstream-markruns,suite.pyalready contains the target version (withrelease: False) — the command only flipsreleasetoTrue. So the version string is already available locally without needing the user to pass it.There is already a version-extraction pattern in
SuiteOpsUtils.inferOpenMilestone()(usingVERSION_PATTERNagainstcompiler/mx.compiler/suite.py) that could be reused.Proposed change:
--versionoptional inupstream-markcompiler/mx.compiler/suite.pyin--dirand print it (e.g.,"Auto-inferred version from suite.py: 23.1.11")--versionwas not provided