Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.13 Compatibility #1737

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 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", "3.11", "3.12"] # "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.11' }}
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 Down
4 changes: 2 additions & 2 deletions music21/common/weakrefTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def wrapWeakref(referent: _T) -> weakref.ReferenceType|_T:
>>> a1 = Mock()
>>> ref1 = common.wrapWeakref(a1)
>>> ref1
<weakref at 0x101f29ae8; to 'Mock' at 0x101e45358>
<weakref at 0x101f29ae8; to ...Mock' at 0x101e45358>
>>> ref2 = common.wrapWeakref(ref1)
>>> ref2
<weakref at 0x101f299af; to 'Mock' at 0x101e45358>
<weakref at 0x101f299af; to ...Mock' at 0x101e45358>
>>> ref3 = common.wrapWeakref(5)
>>> ref3
5
Expand Down
2 changes: 1 addition & 1 deletion music21/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class SiteRef(common.SlottedObjectMixin, prebase.ProtoM21Object):
>>> s.site
<music21.stream.Stream hi>
>>> s.siteWeakref
<weakref at 0x123456; to 'Stream' at 0x111111>
<weakref at 0x123456; to ...Stream' at 0x111111>
If you turn sites.WEAKREF_ACTIVE to False then .siteWeakref just stores another reference to
Expand Down
6 changes: 3 additions & 3 deletions music21/test/coverageM21.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def getCoverage(overrideVersion=False):
# (The odds of a failure on the middle version are low if
# the newest and oldest are passing)
#
# Note the .minor == 11 -- that makes it only run on 3.11
# Note the .minor == 12 -- that makes it only run on 3.12
#
# When changing the version, be sure also to change
# .github/maincheck.yml's line:
# if: ${{ matrix.python-version == '3.11' }}
if overrideVersion or sys.version_info.minor == 11:
# if: ${{ matrix.python-version == '3.12' }}
if overrideVersion or sys.version_info.minor == 12:
try:
# noinspection PyPackageRequirements
import coverage # type: ignore
Expand Down
Loading