Skip to content

Commit afd6c6e

Browse files
authored
Merge branch 'master' into gregc/pendingSpannerAssignmentWithOffset
2 parents 79aad8c + 6cc266d commit afd6c6e

File tree

333 files changed

+3207
-3125
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+3207
-3125
lines changed

.flake8

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/scripts/install_ubuntu_deps.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ sudo apt-get install -y libpng-dev
99
wget -q https://lilypond.org/download/binaries/linux-64/lilypond-2.22.1-1.linux-64.sh
1010
sh lilypond-2.22.1-1.linux-64.sh --batch
1111
export PATH=/home/runner/bin:$PATH
12-
pip3 install wheel
13-
pip3 install -r requirements_dev.txt
1412
python3 -m compileall music21

.github/workflows/maincheck.yml

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.10", "3.11", "3.12", "3.13"] # "3.10" must be in quotes to not have it eval to 3.1
17+
python-version: [3.11, 3.12, 3.13, 3.14]
1818
steps:
19+
- uses: actions/checkout@v4
1920
- uses: actions/setup-python@v4
2021
with:
2122
python-version: ${{ matrix.python-version }}
22-
- uses: actions/checkout@v2
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
25+
with:
26+
enable-cache: true
27+
cache-dependency-glob: |
28+
pyproject.toml
29+
- name: Install dependencies
30+
run: |
31+
uv pip install --system -e '.[dev]'
2332
- name: Install Ubuntu dependencies
2433
run: ./.github/scripts/install_ubuntu_deps.sh
2534
- name: Setup Lilypond
@@ -36,60 +45,70 @@ jobs:
3645
lint:
3746
runs-on: ubuntu-latest
3847
steps:
39-
- uses: actions/checkout@v1
48+
- uses: actions/checkout@v4
4049
- name: Set up Python
4150
uses: actions/setup-python@v4
4251
with:
43-
python-version: '3.11'
52+
python-version: '3.14'
4453
cache: 'pip'
54+
- name: Install uv
55+
uses: astral-sh/setup-uv@v7
56+
with:
57+
enable-cache: true
58+
cache-dependency-glob: |
59+
pyproject.toml
4560
- name: Install dependencies
4661
run: |
47-
python -m pip install --upgrade pip
48-
pip install wheel
49-
pip install -r requirements.txt
50-
pip install -r requirements_dev.txt
62+
uv pip install --system -e '.[dev]'
5163
- name: Install music21 in editable mode
5264
run: |
53-
python -m pip install -e .
65+
uv pip install --system -e .
5466
- name: Lint with pylint
5567
run: |
56-
pylint -j0 music21
57-
pylint -j0 documentation
68+
uv run pylint -j0 music21
69+
uv run pylint -j0 documentation
5870
59-
flake:
71+
ruff:
6072
runs-on: ubuntu-latest
6173
steps:
62-
- uses: actions/checkout@v1
74+
- uses: actions/checkout@v4
6375
- name: Set up Python
6476
uses: actions/setup-python@v4
6577
with:
66-
python-version: '3.11'
78+
python-version: '3.14'
6779
cache: 'pip'
80+
- name: Install uv
81+
uses: astral-sh/setup-uv@v7
82+
with:
83+
enable-cache: true
84+
cache-dependency-glob: |
85+
pyproject.toml
6886
- name: Install dependencies
6987
run: |
70-
python -m pip install --upgrade pip
71-
pip install wheel
72-
pip install -r requirements.txt
73-
pip install -r requirements_dev.txt
74-
- name: PEP8 with flake8
88+
uv pip install --system -e '.[dev]'
89+
- name: Code-style etc. with Ruff
7590
run: |
76-
flake8 music21
77-
flake8 documentation
91+
uv run ruff check music21
92+
uv run ruff check documentation
7893
7994
mypy:
8095
runs-on: ubuntu-latest
8196
steps:
82-
- uses: actions/checkout@v1
97+
- uses: actions/checkout@v4
8398
- name: Set up Python
8499
uses: actions/setup-python@v4
85100
with:
86-
python-version: '3.11'
101+
python-version: '3.14'
87102
cache: 'pip'
103+
- name: Install uv
104+
uses: astral-sh/setup-uv@v7
105+
with:
106+
enable-cache: true
107+
cache-dependency-glob: |
108+
pyproject.toml
88109
- name: Install dependencies
89110
run: |
90-
pip install wheel
91-
python -m pip install -r requirements.txt
92-
python -m pip install -r requirements_dev.txt
111+
uv pip install --system -e '.[dev]'
93112
- name: Type-check all modules with mypy
94113
run: |
95-
mypy music21
114+
uv run mypy music21

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ __pycache__/
66
.mypy_cache/**
77
**/.mypy_cache/**
88

9+
# we are a library, don't lock the requirements
10+
uv.lock
11+
912
# PyCharm
1013
# Keep some to help new users...
1114
.idea/codeStyles

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ init-import=no
290290

291291
# A regular expression matching the name of dummy variables (i.e. expectedly
292292
# not used).
293-
dummy-variables-rgx=_$|dummy|unused|i$|j$|junk|counter
293+
dummy-variables-rgx=_|dummy|unused|i$|j$|junk|counter
294294

295295
# List of additional names supposed to be defined in builtins. Remember that
296296
# you should avoid to define new builtins when possible.

.readthedocs.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
`music21` -- A Toolkit for Computer-Aided Musical Analysis and
44
Computational Musicology
55

6-
Copyright © 2006-2025 [Michael Scott Asato Cuthbert](http://www.trecento.com)
6+
Copyright © 2006-2026 [Michael Scott Asato Cuthbert](http://www.trecento.com)
77

88
For more information, visit:
99
https://www.music21.org/music21docs/
@@ -14,8 +14,8 @@ https://tinyurl.com/m21colab (runs music21 v7)
1414
And to install, see:
1515
https://www.music21.org/music21docs/usersGuide/usersGuide_01_installing.html
1616

17-
`Music21` runs on Python 3.10+. (Use version 4 on Python 2 or Py3.4, version 5
18-
on Py3.5, version 6 on Py3.6, version 7 on Py3.7, version 8 on Py3.8/Py3.9)
17+
`Music21` runs on Python 3.11+. (Use music21 version 4 on Python 2 or Py3.4, v5
18+
on Py3.5, v6 on Py3.6, v7 on Py3.7, v8 on Py3.8/Py3.9, and v9 on Py3.10)
1919

2020
Released under the BSD (3-clause) license. See LICENSE.
2121
Externally provided software (including the MIT-licensed Lilypond/MusicXML test Suite) and

dist/dist.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# ------------------------------------------------------------------------------
32
# Name: dist.py
43
# Purpose: Distribution and uploading script
@@ -26,7 +25,6 @@
2625
This takes a while and runs single core, and then almost always needs code patches
2726
so allocate time (2 min on M4). Start working on the announcement while it's running.
2827
29-
3028
4. run test/warningMultiprocessTest.py for lowest and highest Py version -- fix all warnings!
3129
5. run `from music21.test import treeYield
3230
and then run `treeYield.find_all_non_hashable_m21objects()` and check that the set returned is
@@ -38,24 +36,19 @@
3836
3937
7. run documentation/make.py clean (skip on minor version changes) -- you may need to make a
4038
documentation/build directory first.
41-
8. run documentation/make.py linkcheck [*] - missing http://www.musicxml.org/dtds/partwise.dtd
42-
and code-of-conduct links are both okay to fail. The points about
43-
"more than one target found for cross-reference 'Direction'"
44-
are known bugs in Sphinx (when the same named Enum appears in different modules)
45-
and we can't fix.
46-
StackOverflow seems also to be preventing linkcheck -- check manually every once in
47-
a while, but looking good May 2025.
48-
Ignore the errors at the end if everything looks good.
39+
8. run documentation/make.py linkcheck [*]
40+
some persistent errors that actually work are in the conf.py file under linkcheck_ignore
4941
9. run documentation/make.py [*]
5042
5143
[*] you will need sphinx, Jupyter (pip or easy_install), markdown, and pandoc (.dmg) installed
5244
5345
10. move music21 documentation/build/html to music21.org/music21docs/
54-
via Amazon S3 (contact MSAC for authentication if need be)
46+
via Amazon S3 (contact MSAC for authentication if need be) (MSAC has a program:
47+
combine_sync/deploy.py that will do this automatically.
5548
5649
11. zip up documentation/build/html and get ready to upload/delete it (you can put on your
5750
desktop or wherever you like).
58-
Rename to music21.v.9.5.0-docs.zip (skip for Alpha/Beta)
51+
Rename to music21-9.5.0-docs.zip (skip for Alpha/Beta)
5952
6053
12. From the music21 main folder (not subfolder) run "hatch build" --
6154
requires hatch to be installed "pip install hatch" -- brew version of hatch
@@ -64,20 +57,21 @@
6457
This builds the dist/music21-9.3.0.tar.gz and dist/music21-9.3.0-py3-none-any.whl
6558
files. That used to be what *this* script did, but now hatch does it better!
6659
67-
13. Run this (dist.py) file: it builds the no-corpus version of music21. (need Python 3.12 or higher)
60+
13. Run this (dist.py) file: it builds the no-corpus version of music21.
61+
(need Python 3.12 or higher)
6862
DO NOT RUN THIS ON A PC or the Mac .tar.gz might have an incorrect permission if you do.
6963
7064
14. PR and Commit to GitHub at this point w/ commit comment of the new version,
7165
then don't change anything until the next step is done. Merge to main/master
7266
(.gitignore will avoid uploading the large files created here.)
7367
74-
15. Switch back to master/main branch
68+
15. Switch back to master/main branch (or whatever main version we are releasing)
7569
7670
16. Tag the commit: git tag -a vX.Y.Z -m "music21 vX.Y.Z"
7771
Don't forget the "v" in the release tag.
7872
Sanity check that the correct commit was tagged: git log
7973
80-
17. Push tags: git push --tags (or git push upstream --tags if not on main branch)
74+
17. Push tags: git push --tags
8175
8276
18. Create a new release on GitHub (using the tag just created) and upload the
8377
non-wheel files created here and docs.

documentation/docbuild/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
__all__ = ['documenters', 'iterators', 'writers']
32

43
from . import documenters

documentation/docbuild/documenters.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# -*- coding: utf-8 -*-
21
# ------------------------------------------------------------------------------
32
# Name: documentation/library/documenters.py
43
# Purpose: music21 documentation helper classes for proper formatting
54
#
6-
# Authors: Josiah Wolf Oberholtzer
5+
# Authors: Joséphine Wolf Oberholtzer
76
# Christopher Ariza
87
# Michael Scott Asato Cuthbert
98
#
@@ -539,8 +538,11 @@ def _formatInheritedMembersMapping(self, mapping, banner):
539538
for classDocumenter in self.baseClassDocumenters:
540539
if classDocumenter not in mapping:
541540
continue
542-
result.append(banner.format(
543-
classDocumenter.rstCrossReferenceString))
541+
result.append(
542+
banner.format(
543+
classDocumenter.rstCrossReferenceString
544+
)
545+
)
544546
result.append('')
545547
memberDocumenters = mapping[classDocumenter]
546548
result.append('.. hlist::')
@@ -758,10 +760,9 @@ def inheritedReadwritePropertiesMapping(self):
758760
>>> mapping = documenter.inheritedReadwritePropertiesMapping
759761
>>> sortBy = lambda x: x.referentPackageSystemPath
760762
>>> for classDocumenter in sorted(mapping, key=sortBy):
761-
... print('{0}:'.format(classDocumenter.referentPackageSystemPath))
763+
... print(f'{classDocumenter.referentPackageSystemPath}:')
762764
... for attributeDocumenter in mapping[classDocumenter][:10]:
763-
... print('- {0}'.format(attributeDocumenter.referentPackageSystemPath))
764-
...
765+
... print(f'- {attributeDocumenter.referentPackageSystemPath}')
765766
music21.base.Music21Object:
766767
- music21.base.Music21Object.activeSite
767768
- music21.base.Music21Object.derivation
@@ -941,13 +942,10 @@ def rstInheritedDocAttrFormat(self):
941942
result.append('.. hlist::')
942943
result.append(' :columns: 3')
943944
result.append('')
944-
formatString = ' - :attr:`~{0}.{1}`'
945+
basePath = baseDocumenter.referentPackageSystemPath
945946
for attrName in attrNames:
946947
result.append(
947-
formatString.format(
948-
baseDocumenter.referentPackageSystemPath,
949-
attrName,
950-
)
948+
f' - :attr:`~{basePath}.{attrName}`'
951949
)
952950
result.append('')
953951
return result
@@ -1595,14 +1593,15 @@ def getRstComposerWorksFormat(self, corpusWork):
15951593

15961594
# def getRstVirtualWorkFileDictFormat(self, corpusFile):
15971595
# result = []
1598-
# result.append('- {0} *({1})*: `{2}`'.format(
1599-
# str(corpusFile.title),
1600-
# str(corpusFile.format),
1601-
# str(corpusFile.path),
1602-
# ))
1596+
# result.append(
1597+
# f'- {corpusFile.title} '
1598+
# f'*({corpusFile.format})*: '
1599+
# f'`{corpusFile.path}`'
1600+
# )
16031601
# result.append('')
1604-
# result.append(' Source: {0}'.format(
1605-
# str(corpusFile.url)))
1602+
# result.append(
1603+
# f' Source: {corpusFile.url}'
1604+
# )
16061605
# result.append('')
16071606
# return result
16081607

0 commit comments

Comments
 (0)