Skip to content

feat: add version.json to match go-multicodec - #52

Open
sumanjeet0012 wants to merge 2 commits into
multiformats:masterfrom
sumanjeet0012:feature-issue-8-version-json
Open

feat: add version.json to match go-multicodec#52
sumanjeet0012 wants to merge 2 commits into
multiformats:masterfrom
sumanjeet0012:feature-issue-8-version-json

Conversation

@sumanjeet0012

Copy link
Copy Markdown
Contributor

Closes #44.

What was changed:

  • Added version.json at the repository root containing {"version": "v1.0.0"}.
  • Added a [[tool.bumpversion.files]] entry to pyproject.toml so bump-my-version automatically keeps version.json in sync with pyproject.toml and multicodec/__init__.py on every release.

Why the change was needed:

  • go-multicodec ships a version.json file 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:

  • Ran pre-commit run --all-files (ruff lint, ruff format, pyupgrade, mypy — all passed).
  • Ran pytest tests — all 689 tests passed.
  • Confirmed the check-toml pre-commit hook validates the updated pyproject.toml successfully.

@acul71 acul71 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json with {"version": "v1.0.0"}
  • Add [[tool.bumpversion.files]] entry for version.json

Also present in the diff vs this branch’s old base: version bump 0.2.11.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 210 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.toml edits that are already on master. After rebase, the PR should ideally shrink to only version.json + the bumpversion file stanza

⚠️ Branch must be rebased onto current origin/master before merge.


3. Strengths

  • Clear alignment with go-multicodec’s version.json pattern ("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.rst or 44.misc.rst noting addition of version.json for 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" while version.json / pyproject.toml say 1.0.0 — inconsistent on the PR branch

  • Suggestion: Rebase onto master, drop obsolete version/classifier/coverage hunks already merged, keep only version.json + bumpversion file entry, ensure __version__, pyproject.toml, and version.json all match 1.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

⚠️ BLOCKER

  • 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: pyupgrade crashed with TypeError: cannot use a bytes pattern on a string-like object under 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

  1. Rebase onto current master
  2. Reduce diff to version.json + bumpversion files entry only
  3. Add newsfragments/44.*.rst
  4. Verify __version__ / project.version / version.json all agree after rebase
  5. Squash duplicate commits

10. Questions for the Author

  1. Can you rebase onto master and confirm the remaining diff is only the version.json wiring?
  2. Should version.json always carry the v prefix (as in go-multicodec), even though Python packaging versions omit it?
  3. Preferred newsfragment type: feature vs misc?

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.

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.

Add version.json to match go-multicodec

2 participants