feat: add version.json to match go-multicodec - #52
Conversation
acul71
left a comment
There was a problem hiding this comment.
AI PR Review: #52 — feat: add version.json to match go-multicodec
Reviewer: acul71 (maintainer)
PR: #52
Author: sumanjeet0012
Date: 2026-09-07
1. Summary of Changes
This PR addresses Closes #44: add a root version.json for ecosystem parity with go-multicodec, and wire it into bump-my-version.
Intended changes:
- Add
version.jsonwith{"version": "v1.0.0"} - Add
[[tool.bumpversion.files]]entry forversion.json
Also present in the diff vs this branch’s old base: version bump 0.2.1 → 1.0.0, Development Status classifier change, removal of codecov/coverage deps and coverage config, bumpversion quote-style change for __version__. Much of that work already landed on master via the 1.0.0 release prep commits.
Modules/files: version.json, pyproject.toml
Breaking changes: None from version.json itself
2. Branch Sync Status and Merge Conflicts
Branch Sync Status
- Status: Diverged from
origin/master - Details:
branch_sync_status.txt=10 2→ 10 commits behind, 2 commits ahead
Commits on master not in this branch include the v1.0.0 release (Bump version: 0.2.1 → 1.0.0), serialization (#26), codec table update (#33), codecov drop (#30), and related release prep.
Merge Conflict Analysis
- Test merge reported no textual conflicts / mergeable=
MERGEABLE - Impact: Still high process risk — rebasing will drop or conflict with overlapping
pyproject.tomledits that are already on master. After rebase, the PR should ideally shrink to onlyversion.json+ the bumpversion file stanza
origin/master before merge.
3. Strengths
- Clear alignment with go-multicodec’s
version.jsonpattern ("version": "v…") - Correct bumpversion search/replace using
v{current_version} - Small, understandable goal when isolated from stale base drift
4. Issues Found
Critical
-
File:
newsfragments/(missing) -
Issue: Missing mandatory newsfragment for issue #44
-
Suggestion: Add
newsfragments/44.feature.rstor44.misc.rstnoting addition ofversion.jsonfor ecosystem tooling -
File: branch vs
origin/master -
Issue: PR is 10 commits behind master and re-implements release/versioning edits already on master;
__version__on the PR tip is still"0.2.1"whileversion.json/pyproject.tomlsay1.0.0— inconsistent on the PR branch -
Suggestion: Rebase onto
master, drop obsolete version/classifier/coverage hunks already merged, keep onlyversion.json+ bumpversion file entry, ensure__version__,pyproject.toml, andversion.jsonall match1.0.0
Major
- File:
pyproject.toml - Issue: Diff removes codecov/coverage configuration relative to the PR’s old base; on current master that removal is already done — after rebase this noise should disappear. If any of it remains, it is out of scope for #44
- Suggestion: Scope the PR strictly to #44 after rebase
Minor
- File: commits
- Issue: Two commits with the same subject (
feat: add version.json…) - Suggestion: Squash on rebase
5. Security Review
No security concerns. Static JSON metadata file and bumpversion config only.
6. Documentation and Examples
Optional one-line mention in README/contributing that version.json is kept in sync via bump-my-version; newsfragment is sufficient for users/tooling consumers.
7. Newsfragment Requirement
- Severity: CRITICAL / BLOCKER
- Issue: No
newsfragments/44.*.rst; PR correctly references Closes #44 - Suggestion: Add fragment after rebase
- Action Required: Newsfragment + rebase before approval
8. Tests and Validation
Linting (make lint)
- Exit 2 locally:
pyupgradecrashed withTypeError: cannot use a bytes pattern on a string-like objectunder Python 3.14 pre-commit env - Other hooks (ruff, mypy, yaml/toml) passed
- Note: Likely environment/tooling issue on Python 3.14; GitHub Actions checks on the PR were SUCCESS when opened. Re-run after rebase on CI
Type Checking (make typecheck)
- Exit 0
Test Execution (make test)
- Exit 0 — 503 passed on this stale branch (master has more tests, e.g. serialization); not representative of post-rebase master
Documentation Build (make docs-ci)
- Exit 0
Sync / merge readiness
- Behind by 10 commits — rebase required regardless of clean test-merge
9. Recommendations for Improvement
- Rebase onto current
master - Reduce diff to
version.json+ bumpversionfilesentry only - Add
newsfragments/44.*.rst - Verify
__version__/project.version/version.jsonall agree after rebase - Squash duplicate commits
10. Questions for the Author
- Can you rebase onto
masterand confirm the remaining diff is only theversion.jsonwiring? - Should
version.jsonalways carry thevprefix (as in go-multicodec), even though Python packaging versions omit it? - Preferred newsfragment type:
featurevsmisc?
11. Overall Assessment
- Quality Rating: Needs Work
- Security Impact: None
- Merge Readiness: Needs fixes (rebase, scope cleanup, newsfragment, version consistency)
- Confidence: High
Verdict: REQUEST_CHANGES — good idea and correct target shape, but the branch is stale relative to the 1.0.0 release on master and is missing the mandatory newsfragment.
Closes #44.
What was changed:
version.jsonat the repository root containing{"version": "v1.0.0"}.[[tool.bumpversion.files]]entry topyproject.tomlsobump-my-versionautomatically keepsversion.jsonin sync withpyproject.tomlandmulticodec/__init__.pyon every release.Why the change was needed:
version.jsonfile used by ecosystem tooling to track version compatibility across implementations. py-multicodec was the only implementation missing this file, creating an inconsistency in the multiformats ecosystem.How it was verified:
pre-commit run --all-files(ruff lint, ruff format, pyupgrade, mypy — all passed).pytest tests— all 689 tests passed.check-tomlpre-commit hook validates the updatedpyproject.tomlsuccessfully.