Visitar URL original
Release: check_version.py enforces the devN/postN counting rule before publish by tae898 · Pull Request #501 · humemai/arcadedb-embedded-python · GitHub
Skip to content

Release: check_version.py enforces the devN/postN counting rule before publish - #501

Merged
tae898 merged 3 commits into
mainfrom
fix-471-version-rule
Oct 24, 2026
Merged

tae898 merged 3 commits into
mainfrom
fix-471-version-rule

Conversation

@tae898

@tae898 tae898 commented Oct 24, 2026 •

Copy link
Copy Markdown

Closes #471

#472 already wrote the counting rule into release.md and added a tag-form regex to the release workflow. This PR adds the part that was still missing: a check that the tag is the correct next number, not only a valid form.

  • bindings/python/scripts/check_version.py VERSION [--git-remote origin] [--pypi PROJECT] [--published-file FILE] [--tag-prefix native-v]: a pure-Python validator plus CLI. It accepts only X.Y.Z, X.Y.Z.devN and X.Y.Z.postN (no aN, bN, rcN, v prefix or leading zeros), requires devN to start at 0 and postN at 1, and given the published versions requires the next number to be exactly one above the highest published one of that base (no reuse, no skipping). A dev version of an already released base and a post version of an unreleased base are refused. Exit 0 is correct, 1 is not the correct next version, 2 is a source that could not be read. It only checks and never changes anything.
  • bindings/python/tests/test_check_version.py: 42 cases (valid and forbidden forms, first dev is 0, first post is 1, increments, history gaps such as the real 26.8.1.dev16, per-base counters, the native series restarting at 26.11.1.dev0 after 26.10.2.dev1, the full sequence 26.11.1.dev0, .dev1, 26.11.1, .post1, the CLI exit codes, fail-closed on an unreadable source, git-tag source with and without the native-v prefix).
  • .github/workflows/release-python-packages.yml: the existing inline regex in "Validate version compatibility" is replaced by a call to the script against origin tags and PyPI (arcadedb-embedded). This is a validation step only: the release, publish and upstream-sync routines are otherwise unchanged. The step fails closed, and re-running the whole workflow for a version already on PyPI now fails the check, so rerun the publish job alone as release.md already says.
  • bindings/python/docs/development/release.md: the rule is stated once under "Version Numbering" with the enforcing command, and step 4 (Tag and Check) runs the check before tagging.

Counting restarts per base: devN restarts at 0 whenever the base A.B.C changes. The engine is at 26.11.1-SNAPSHOT, so the next native preview is 26.11.1.dev0; the published native 26.10.2.dev0 and dev1 were named after the old base, which was a mistake, and they stay on PyPI. After 26.10.2.dev1 the checker accepts 26.11.1.dev0 and rejects 26.11.1.dev1 and 26.11.1.dev2.

Local checks: pre-commit on the changed files, pytest on the new tests (42 passed), YAML parse and actionlint on the workflow, and the script against the real tags and PyPI (26.11.1.dev0 is accepted as the next version). The existing version strings pass in order in a test.

🤖 Generated with Claude Code

tae898 and others added 3 commits October 24, 2026 20:21
…e publish (#471)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…re a naming mistake (#471)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Bandit flags the test's own subprocess calls; argv is fixed and has no
shell. The git calls now use shutil.which('git') (skip if absent) so the
partial-path B607 finding goes away.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@tae898
tae898 merged commit fcde035 into main Oct 24, 2026
42 of 44 checks passed
@tae898
tae898 deleted the fix-471-version-rule branch October 24, 2026 14:35
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.

Release: write down and enforce the devN/postN counting rule

1 participant