Fix mac app sound resource paths#250
Conversation
|
Tested locally on the PR branch. This is the clean split I recommended in #246 — scope concern from that thread is resolved. The single blocker is the Windows test failure I called out there on May 16, which was not addressed. Blocker: same Windows-incompatible test as before. Reproduced on this branch:
assert os.path.isabs(manager.sounds_folder)That's also a more accurate assertion of what the test name claims. While you're in there — other things worth addressing in this PR rather than as follow-ups:
Non-blocking, just flagging: the project still has no equivalent build spec for Windows/Linux. Someone will need to fill that gap before non-mac users can get bundled builds, but that's not this PR's job. Production code ( Once the test is platform-agnostic, this is good to merge. |
|
Tested locally — all 12 tests in One regression risk worth addressing before merge: this likely breaks Windows i.e. they relocate the sounds folder out of The fallback branch ( Small fix — verify the def _default_sounds_folder() -> str:
if getattr(sys, "frozen", False):
bundle_root = getattr(sys, "_MEIPASS", None)
if bundle_root:
candidate = Path(bundle_root) / "sounds"
if candidate.is_dir():
return str(candidate)
return str(Path(sys.executable).resolve().parent / "sounds")
return str(Path(__file__).resolve().parent / "sounds")Plus a test for "_MEIPASS set but sounds dir absent → falls back to executable's sibling". Keeps Mac Minor nits (non-blocking):
|
made it so the sounds are playable on the mac app bundle aswell.