Skip to content

Fix Guitar Pro export, build backend, and missing dependencies - #5

Open
JaraLucan wants to merge 1 commit into
topkoa:mainfrom
JaraLucan:fix/gp5-export-and-build-backend
Open

Fix Guitar Pro export, build backend, and missing dependencies#5
JaraLucan wants to merge 1 commit into
topkoa:mainfrom
JaraLucan:fix/gp5-export-and-build-backend

Conversation

@JaraLucan

Copy link
Copy Markdown

Summary

  • .gp5 export was completely broken with any installed pyguitarpro (0.9.3 or 0.11): guitarpro.models.Tempo doesn't exist in either, and Measure(header, track) had its arguments reversed against the actual Measure(track, header) signature. Both are fixed with a version-tolerant tempo shim and the corrected call.
  • The build backend (setuptools.backends._legacy:_Backend) is not an importable module, so pip install . failed at the build step. Corrected to setuptools.build_meta.
  • Once the build succeeded, pip install . turned out to install a non-functional package: [project] never declared a dependencies list, so torch, demucs, librosa etc. never came along and every entry point crashed on import librosa. Added the core runtime deps. torch/torchaudio are deliberately left out since they need the CUDA index URL from the README rather than a plain PyPI pin — see the comment in pyproject.toml.

Test plan

  • Added regression tests: write/parse roundtrip, four-string bass tuning, empty note list, nested output directory
  • Full test suite passes (44 tests)
  • Verified in a clean venv: install CUDA torch per the README, then pip install . leaves it untouched (still +cu124, not overwritten by a CPU wheel) and tabgrabber --version / --help and the full test suite work from the installed package, not just a dev checkout
  • Confirmed the wheel actually contains a working build (python -m build, inspected contents)

🤖 Generated with Claude Code

The .gp5 writer could not produce a file with any currently installed
pyguitarpro. Two separate breakages:

- `guitarpro.models.Tempo` does not exist in 0.9.3 or later, so setting
  the song tempo raised AttributeError before anything was written. A
  `_make_tempo()` shim now handles both the old class and the plain int
  that 0.10+ expects, and `MeasureHeader.tempo` is only set when the
  attribute is present (0.10 removed it).

- `Measure(header, track)` had its arguments reversed. The signature is
  `Measure(track, header)` in both 0.9.3 and 0.11, so the writer handed a
  Track where a MeasureHeader was expected and failed mid-write with
  "'Track' object has no attribute 'isRepeatOpen'", leaving a truncated
  file behind.

Separately, the build backend was `setuptools.backends._legacy:_Backend`,
which is not an importable module, so `pip install .` failed outright.
Corrected to `setuptools.build_meta` and dropped the now-unnecessary
`wheel` requirement.

And once that build actually succeeded, `pip install .` turned out to
install a non-functional package: `[project]` never declared a
`dependencies` list, so none of torch, demucs, librosa, etc. came along,
and every entry point crashed on the first `import librosa`. Added the
core runtime deps (everything except torch/torchaudio, which need the
CUDA index URL from the README rather than a plain PyPI pin - see the
comment in pyproject.toml for why). Verified in a clean venv: install the
CUDA torch build first as the README instructs, then `pip install .`
leaves it untouched and `tabgrabber --version`/`--help` and the full test
suite all work from the installed package rather than a dev checkout.

Adds regression tests covering a write/parse roundtrip, four-string bass
tuning, empty note lists, and nested output directories.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant