Fix Guitar Pro export, build backend, and missing dependencies - #5
Open
JaraLucan wants to merge 1 commit into
Open
Fix Guitar Pro export, build backend, and missing dependencies#5JaraLucan wants to merge 1 commit into
JaraLucan wants to merge 1 commit into
Conversation
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.gp5export was completely broken with any installed pyguitarpro (0.9.3 or 0.11):guitarpro.models.Tempodoesn't exist in either, andMeasure(header, track)had its arguments reversed against the actualMeasure(track, header)signature. Both are fixed with a version-tolerant tempo shim and the corrected call.setuptools.backends._legacy:_Backend) is not an importable module, sopip install .failed at the build step. Corrected tosetuptools.build_meta.pip install .turned out to install a non-functional package:[project]never declared adependencieslist, so torch, demucs, librosa etc. never came along and every entry point crashed onimport 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 inpyproject.toml.Test plan
pip install .leaves it untouched (still+cu124, not overwritten by a CPU wheel) andtabgrabber --version/--helpand the full test suite work from the installed package, not just a dev checkoutpython -m build, inspected contents)🤖 Generated with Claude Code