Skip to content
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
2 changes: 0 additions & 2 deletions .github/scripts/install_ubuntu_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@ sudo apt-get install -y libpng-dev
wget -q https://lilypond.org/download/binaries/linux-64/lilypond-2.22.1-1.linux-64.sh
sh lilypond-2.22.1-1.linux-64.sh --batch
export PATH=/home/runner/bin:$PATH
pip3 install wheel
pip3 install -r requirements_dev.txt
python3 -m compileall music21
55 changes: 37 additions & 18 deletions .github/workflows/maincheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ jobs:
matrix:
python-version: [3.11, 3.12, 3.13, 3.14]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: |
uv pip install --system -e '.[dev]'
- name: Install Ubuntu dependencies
run: ./.github/scripts/install_ubuntu_deps.sh
- name: Setup Lilypond
Expand All @@ -42,19 +51,22 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
pip install -r requirements_dev.txt
uv pip install --system -e '.[dev]'
- name: Install music21 in editable mode
run: |
python -m pip install -e .
uv pip install --system -e .
- name: Lint with pylint
run: |
pylint -j0 music21
pylint -j0 documentation
uv run pylint -j0 music21
uv run pylint -j0 documentation

ruff:
runs-on: ubuntu-latest
Expand All @@ -65,16 +77,19 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
pip install -r requirements_dev.txt
uv pip install --system -e '.[dev]'
- name: Code-style etc. with Ruff
run: |
ruff check music21
ruff check documentation
uv run ruff check music21
uv run ruff check documentation

mypy:
runs-on: ubuntu-latest
Expand All @@ -85,11 +100,15 @@ jobs:
with:
python-version: '3.14'
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: |
pyproject.toml
- name: Install dependencies
run: |
pip install wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
uv pip install --system -e '.[dev]'
- name: Type-check all modules with mypy
run: |
mypy music21
uv run mypy music21
12 changes: 7 additions & 5 deletions documentation/nbvalNotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,13 @@ def runOne(nbFile):
us['musescoreDirectPNGPath'] = '/skip' + str(museScore)

# this config file changes 0x39f3a0 to 0xADDRESS.
sanitize_fn = str(common.getRootFilePath()
/ 'documentation'
/ 'docbuild'
/ 'nbval-sanitize.cfg'
)
sanitize_fn = str(
common.getRootFilePath()
/ 'documentation'
/ 'docbuild'
/ 'nbval-sanitize.cfg'
)

try:
retVal = subprocess.run(
['pytest',
Expand Down
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ dependencies = [
"webcolors>=1.5",
]

[project.optional-dependencies]
dev = [
'coverage',
'coveralls',
'docutils',
'hatch',
'hatchling',
'jupyter',
'mypy>=1.16.0',
'nbconvert',
'nbval',
'pylint>=3.2.0',
'pytest',
'python-Levenshtein',
'ruff',
'scipy',
'sphinx',
'twine',
'types-requests',
'wheel',
]

[[project.authors]]
name = "Michael Scott Asato Cuthbert"
email = "michael.asato.cuthbert@gmail.com"
Expand Down