Skip to content

Standardize music21 version access - #2209

Merged
mscuthbert merged 3 commits into
masterfrom
version-names-master
Nov 3, 2026
Merged

mscuthbert merged 3 commits into
masterfrom
version-names-master

Conversation

@mscuthbert

Copy link
Copy Markdown
Member

Standardize m21 versioning to match rest of python.: __version__ and __version_info__

Keeping VERSION_STR and VERSION as aliases

Do not export VERSION_STR or __version__ etc. with import * -- polluting environment.

Test that the music21 version is always acceptable to Packaging

from music21 import * put __version__ into the importing module, overwriting that module's own.  Remove __version__, __version_info__, VERSION, and VERSION_STR from __all__ in music21 and music21.base; all stay as attributes.  __init__ now imports __version__ and __version_info__ directly from _version instead of rebuilding them from the VERSION aliases, which adds music21.__version_info__ for conf.py.  Use __version__ in freezeThaw, configure, and the release docs.  Test that packaging reads __version__ without respelling it.

AI-assisted (Claude)
a34686d (the 2022 move to hatch) began building the tuple from the __version__ string and never converted the parts, so it has held ('11', '0', '0', 'b16') since then and comparisons went wrong: ('9', '0') > ('11', '0').  Nothing in music21 compared it, so it went unnoticed.

AI-assisted (Claude)
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.812%. remained the same — version-names-master into master

@mscuthbert
mscuthbert merged commit 36166ee into master Nov 3, 2026
12 checks passed
@mscuthbert
mscuthbert deleted the version-names-master branch November 3, 2026 02:48
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.

2 participants