diff --git a/.github/scripts/install_ubuntu_deps.sh b/.github/scripts/install_ubuntu_deps.sh index 31a3751940..ea2035017f 100755 --- a/.github/scripts/install_ubuntu_deps.sh +++ b/.github/scripts/install_ubuntu_deps.sh @@ -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 diff --git a/.github/workflows/maincheck.yml b/.github/workflows/maincheck.yml index 7b21a16de4..25bc3c8b5f 100644 --- a/.github/workflows/maincheck.yml +++ b/.github/workflows/maincheck.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/documentation/nbvalNotebook.py b/documentation/nbvalNotebook.py index 613a8c2103..26aee567bf 100644 --- a/documentation/nbvalNotebook.py +++ b/documentation/nbvalNotebook.py @@ -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', diff --git a/pyproject.toml b/pyproject.toml index a6cf23be56..0ff7bbd428 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"