Skip to content

test: spec compliance test validating constants.py against table.csv - #51

Open
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:feature-issue-4-spec-test
Open

test: spec compliance test validating constants.py against table.csv#51
sumanjeet0012 wants to merge 1 commit into
multiformats:masterfrom
sumanjeet0012:feature-issue-4-spec-test

Conversation

@sumanjeet0012

@sumanjeet0012 sumanjeet0012 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Closes #41.

What was changed:

  • Added multiformats/multicodec as a git submodule in multicodec-spec/.
  • Created a new test file tests/test_spec.py that validates CODECS, CODE_TABLE, and NAME_TABLE against the table.csv file from the authoritative upstream spec.
  • Updated multicodec/constants.py and multicodec/code_table.py to match the latest upstream table.csv.
  • Configured .pre-commit-config.yaml and pyproject.toml to appropriately exclude the submodule from linting.
  • Updated the Makefile to exclude the submodule and docs/conf.py (which previously failed due to import location) during make fix.

Why the change was needed:

  • The existing codebase lacked a compliance test, meaning the codecs registry could silently drift out of sync with the upstream spec. In fact, running the new test immediately caught missing codecs (mldsa-44-pub etc) that had been added to upstream but not updated in py-multicodec.

How it was verified:

  • Validated via make pr, which runs the ruff formatter/linter, mypy typechecks, and the full test suite.
  • The new test_spec_table_completeness test passes successfully.

@sumanjeet0012
sumanjeet0012 force-pushed the feature-issue-4-spec-test branch from 974befd to 3e9de86 Compare July 5, 2026 16:26
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.

No spec compliance test validating constants.py against table.csv

1 participant