Skip to content

Commit

Permalink
Merge branch 'master' into TimFelixBeyer-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
TimFelixBeyer authored Dec 26, 2024
2 parents 25afc26 + 1dfb6d0 commit ab546f9
Show file tree
Hide file tree
Showing 218 changed files with 4,771 additions and 4,001 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ignore=
E127,
# under indented
E128,
# space around | -- nice to omit in int|str
E227,
# 0 blank lines -- good test but something going wrong in new algorithm
E301,
# blank lines
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/maincheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10.6", "3.10", "3.11"] # "3.10" must be in quotes to not have it eval to 3.1
python-version: ["3.10", "3.11", "3.12", "3.13"] # "3.10" must be in quotes to not have it eval to 3.1
steps:
- uses: actions/setup-python@v4
with:
Expand All @@ -27,8 +27,8 @@ jobs:
- name: Run Main Test script
run: python -c 'from music21.test.testSingleCoreAll import ciMain as ci; ci()'
- name: Coveralls
if: ${{ matrix.python-version == '3.10.6' }}
env:
if: ${{ matrix.python-version == '3.12' }}
env: # when changing number above also change coverageM21.getCoverage
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
run: coveralls
Expand All @@ -40,7 +40,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
Expand All @@ -63,7 +63,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ __pycache__/
.idea/vcs.xml
.idea/workspace.xml
.idea/markdown-*.xml
.idea/copilot

# OSX
.DS_Store
Expand Down
4 changes: 3 additions & 1 deletion .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ disable=
too-many-lines, # yes, someday
too-many-return-statements, # we'll see
too-many-instance-attributes, # maybe later
too-many-positional-arguments, # try to get down to 6 first...
# no-self-use, # moved to optional extension.
invalid-name, # these are good music21 names; fix the regexp instead...
too-few-public-methods, # never remove or set to 1
Expand Down Expand Up @@ -100,7 +101,8 @@ disable=
consider-using-f-string, # future?
unnecessary-lambda-assignment, # opinionated
consider-using-generator, # generators are less performant for small container sizes, like most of ours

not-an-iterable, # false positives on RecursiveIterator in recent pylint versions.
unpacking-non-sequence, # also getting false positives.
# 'protected-access', # this is an important one, but for now we do a lot of
# # x = copy.deepcopy(self); x._volume = ... which is not a problem...

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
`Music21` welcomes contributions such as bug reports, new features, fixes, and
documentation improvements. The
[project repository](http://www.github.com/cuthbertLab/music21) is hosted at GitHub.
[project repository](https://github.com/cuthbertLab/music21) is hosted at GitHub.

Information that was formerly here is now in
[Developer Reference](https://web.mit.edu/music21/doc/developerReference/index.html)
[Developer Reference](https://www.music21.org/music21docs/developerReference/index.html)

## Resources ##

[Module Documentation and User's Guide](https://web.mit.edu/music21/doc/index.html)
[Module Documentation and User's Guide](https://www.music21.org/music21docs/)

[Mailing List](https://groups.google.com/forum/#!forum/music21list)

Expand Down
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,34 @@
`music21` -- A Toolkit for Computer-Aided Musical Analysis and
Computational Musicology

Copyright © 2006-2023 [Michael Scott Asato Cuthbert](http://www.trecento.com)
Copyright © 2006-2024 [Michael Scott Asato Cuthbert](http://www.trecento.com)

For more information, visit:
https://web.mit.edu/music21
https://www.music21.org/music21docs/

To try it out, visit:
https://tinyurl.com/m21colab (runs music21 v7)

And to install, see:
https://web.mit.edu/music21/doc/usersGuide/usersGuide_01_installing.html
https://www.music21.org/music21docs/usersGuide/usersGuide_01_installing.html

`Music21` runs on Python 3.10+. Use version 4 on Python 2 or Py3.4, version 5
on Py3.5, version 6 on Py3.6, version 7 on Py3.7, version 8 on Py3.8/Py3.9.
`Music21` runs on Python 3.10+. (Use version 4 on Python 2 or Py3.4, version 5
on Py3.5, version 6 on Py3.6, version 7 on Py3.7, version 8 on Py3.8/Py3.9.)

Released under the BSD (3-clause) license. See LICENSE.
Externally provided software (including the MIT licensed Lilypond/MusicXML test Suite) and
Externally provided software (including the MIT-licensed Lilypond/MusicXML test Suite) and
music encoding in the corpus may have different licenses and/or copyrights.
A no-corpus version of `music21` is available also on GitHub.
A no-corpus version of `music21` is available also on GitHub for those needing strict
BSD-license of all parts of the system.

[![Build Status](https://github.com/cuthbertLab/music21/workflows/maincheck/badge.svg)](https://github.com/cuthbertLab/music21)
[![Coverage Status](https://coveralls.io/repos/github/cuthbertLab/music21/badge.svg?branch=master)](https://coveralls.io/github/cuthbertLab/music21?branch=master)

## Documentation ##

[User's Guide](https://web.mit.edu/music21/doc/usersGuide/index.html)
[User's Guide](https://www.music21.org/music21docs/usersGuide/index.html)

[Module Documentation](https://web.mit.edu/music21/doc/moduleReference/index.html)
[Module Documentation](https://www.music21.org/music21docs/moduleReference/index.html)

## Mailing list ##

Expand All @@ -39,7 +40,7 @@ See: https://groups.google.com/forum/#!forum/music21list

[Contributing Guide](CONTRIBUTING.md)

## Community Code of Conduct ##
## Community Code of Conduct<a name="community-code-of-conduct"></a> ##

`Music21` encourages contributions, discussions, and usage from all people interested in
music and computers. This encouragement extends to all people regardless of (among other aspects)
Expand All @@ -64,8 +65,7 @@ Maintainers will respect confidentiality with regard to reports.

## Acknowledgements ##

The development of `music21` has been supported by
The early development of `music21` was supported by
the generosity of the Seaver Institute and the
National Endowment for the Humanities. MIT's Music and Theater Arts Section
and the School of Humanities, Arts, and Social Sciences encouraged Cuthbert
in its development.
National Endowment for the Humanities, along with MIT's Music and Theater Arts Section
and the School of Humanities, Arts, and Social Sciences.
68 changes: 39 additions & 29 deletions dist/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
# Authors: Christopher Ariza
# Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
'''
Builds various kinds of music21 distribution files and uploads them to PyPI and GoogleCode.
To do a release,
1. update the VERSION in _version.py and the single test cases in base.py.
1. update the VERSION in _version.py and the single test case in base.py.
2. run `corpus.corpora.CoreCorpus().cacheMetadata()`.
for a major change that affects parsing run corpus.corpora.CoreCorpus().rebuildMetadataCache()
(20 min on IntelMacbook Air) -- either of these MAY change a
Expand All @@ -28,54 +28,59 @@
4. run test/warningMultiprocessTest.py for lowest and highest Py version -- fix all warnings!
4b. run `from music21.test import treeYield
5. run `from music21.test import treeYield
and then run `treeYield.find_all_non_hashable_m21objects()` and check that the set returned is
empty. Note -- it will print a bunch of module names, but only the final set matters.
Then do the same for `treeYield.find_all_non_default_instantiation_m21objects()`.
5. commit and wait for results on GitHub Actions
6. commit and wait for results on GitHub Actions
(normally not necessary, because it's slower and mostly duplicates multiprocessTest,
but should be done before making a release).
6. run documentation/make.py clean (skip on minor version changes)
7. run documentation/make.py linkcheck [*]
8. run documentation/make.py [*]
7. run documentation/make.py clean (skip on minor version changes)
8. run documentation/make.py linkcheck [*]
9. run documentation/make.py [*]
[*] you will need sphinx, Jupyter (pip or easy_install), markdown, and pandoc (.dmg) installed
10. ssh to athena.dialup.mit.edu (yes, dialup!), cd music21/doc and rm -rf * (skip on minor version changes)
10. move music21 documentation/build/html to music21.org/music21docs/
via Amazon S3 (contact MSAC for authentication if need be)
11. run documentation/upload.py or upload via ssh.
-- you will need an MIT username and password + a dual authentication passcode
12. zip up documentation/build/html and get ready to upload/delete it.
11. zip up documentation/build/html and get ready to upload/delete it.
Rename to music21.v.7.1.0-docs.zip (skip for Alpha/Beta)
13. Run "hatch build" -- requires hatch to be installed "brew install hatch"
12. From the music21 main folder (not the sub folder) run "hatch build" --
requires hatch to be installed "brew install hatch"
This builds the dist/music21-9.3.0.tar.gz and dist/music21-9.3.0-py3-none-any.whl
files. That used to be what *this* script did, but now hatch does it better!
14. Run this file -- it builds the no-corpus version of music21.
DO NOT RUN THIS ON A PC -- the Mac .tar.gz might have an incorrect permission if you do.
13. Run this file: it builds the no-corpus version of music21.
DO NOT RUN THIS ON A PC or the Mac .tar.gz might have an incorrect permission if you do.
15. PR and Commit to GitHub at this point w/ commit comment of the new version,
14. PR and Commit to GitHub at this point w/ commit comment of the new version,
then don't change anything until the next step is done.
(.gitignore will avoid uploading the large files created here...)
(.gitignore will avoid uploading the large files created here.)
16. Switch back to master/main branch
15. Switch back to master/main branch
17. Tag the commit: git tag -a vX.Y.Z -m "music21 vX.Y.Z"
16. Tag the commit: git tag -a vX.Y.Z -m "music21 vX.Y.Z"
Don't forget the "v" in the release tag.
Sanity check that the correct commit was tagged: git log
18. Push tags: git push --tags (or git push upstream --tags if not on main branch)
17. Push tags: git push --tags (or git push upstream --tags if not on main branch)
18. Create a new release on GitHub (using the tag just created) and upload the
non-wheel files created here and docs.
19. Create a new release on GitHub and upload the TWO non-wheel files created here and docs.
Drag in this order: .tar.gz, -docs.zip, no-corpus.tar.gz
Finish this before doing the next step, even though it looks like it could be done in parallel.
20. Upload the new file to PyPI with "twine upload music21-7.3.5a2.tar.gz", and same for the
whl file (but NOT no corpus) [*]
[*] Requires twine to be installed
19a. Upload the new file to PyPI with "twine upload music21-9.3.0.tar.gz" [*]
19b. Do the same for the whl file (but not for the no-corpus file) [*]
[*] Requires twine to be installed and up-to-date (pip install --upgrade twine)
You will need a file called ~/.pypirc with
Expand All @@ -84,12 +89,17 @@
pypi
[pypi]
username:your_username
password:your_password
username:__token__
password:pypi-the_gibberish_generated_in_create_api_token_at_the_bottom_of_account_settings
FYI -- PyPI is apparently uninterested in having contributions from smaller projects
which haven't been following their internal security discussions for years. All of this
is super mysterious and not well documented. sigh. But they did mail out USB sticks to
the top 1% of projects in Python!
21. Delete the two .tar.gz files and .whl file in dist...
20. Delete the two .tar.gz files and .whl file in dist.
22. For starting a new major release create a GitHub branch for the old one.
21. For starting a new major release create a GitHub branch for the old one.
22. Immediately increment the number in _version.py and run tests on it here
to prepare for next release.
Expand Down
4 changes: 2 additions & 2 deletions documentation/docbuild/documenters.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def inheritedDocAttrMapping(self):
'''
# if one of the _DOC_ATTRs is exactly the same as the previous base class,
# only show it once.
# TODO: do this on an attribute by attribute basis...
# TODO: do this on an attribute by attribute basis
seenBaseClassDocAttrs = []

if self._inheritedDocAttrMapping is None:
Expand Down Expand Up @@ -1501,7 +1501,7 @@ def run(self):
result.extend(self.makeHeading(self.headingText, 1))
result.extend(self.rstEditingWarningFormat)
result.extend(self.rstCorpusIntroductionFormat)
# TODO: use... common.getCorpusContentDirs to make sure nothing is missed.
# TODO: use common.getCorpusContentDirs to make sure nothing is missed.
for directoryInformation in corpus.corpora.CoreCorpus().getWorkReferences():
result.extend(self.getRstComposerDictFormat(directoryInformation))
return result
Expand Down
2 changes: 1 addition & 1 deletion documentation/docbuild/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
eval "${SCRIPT}";
Otherwise just contact MSC...
Otherwise just contact MSAC.
'''
from __future__ import annotations

Expand Down
2 changes: 1 addition & 1 deletion documentation/docbuild/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def write(self, filePath, rst):
shouldWrite = False
else:
pass
# # uncomment for help in figuring out why a file keeps being different...
# # uncomment for help in figuring out why a file keeps being different
# import difflib
# print(common.relativepath(filePath))
# print('\n'.join(difflib.ndiff(rst.split('\n'), oldRst.split('\n'))))
Expand Down
Loading

0 comments on commit ab546f9

Please sign in to comment.