Skip to content

feat: preserve tag/status/description when generating constants - #56

Open
acul71 wants to merge 1 commit into
masterfrom
issue-38
Open

feat: preserve tag/status/description when generating constants#56
acul71 wants to merge 1 commit into
masterfrom
issue-38

Conversation

@acul71

@acul71 acul71 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #38.

  • Update tools/update-table.py to write tag, status, and description into each CODECS entry
  • Regenerate multicodec/constants.py from upstream table.csv
  • Keep NAME_TABLE / CODE_TABLE prefix lookups working (typed + cast)
  • Ignore E501 on generated constants.py in ruff.toml
  • Add tests/test_constants_metadata.py

Does not close #39/#47 (no Code.status / Code.description API yet).

Demo

BEFORE (master):
    "sha2-256": {
        "prefix": 0x12,
    },

AFTER:
{'prefix': 18, 'tag': 'multihash', 'status': 'permanent', 'description': ''}
NAME_TABLE['sha2-256'] == 18
total codecs: 651

Test plan

  • make lint / typecheck / test / docs-ci locally
  • Newsfragment 38.internal.rst present
  • CI green on this PR
  • Review asked from @sumanjeet0012 (comment; formal request requires collaborator status)

Made with Cursor

Update tools/update-table.py to emit full CSV metadata into
constants.CODECS, regenerate the table, and add smoke tests.

Closes #38.

Co-authored-by: Cursor <cursoragent@cursor.com>
@acul71

acul71 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@sumanjeet0012 Could you please review this PR when you have a chance? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant