Skip to content

Conversation

@sjmf
Copy link
Owner

@sjmf sjmf commented Feb 2, 2026

Summary

  • Fix ModuleNotFoundError: No module named 'backend' when running as an installed package (fixes Backend module relative import broken #22)
  • Extract dynamic imports in keyboard.py into a _load_implementation() helper with a data-driven _MODE_IMPLEMENTATIONS dict, replacing repetitive try/except blocks
  • Read CFBundleVersion from pyproject.toml at PyInstaller build time instead of hardcoding (was stale at 1.5.1)
  • Bump version to 1.5.4

Test plan

  • All 12 tests/backend/test_keyboard.py and tests/backend/test_mouse.py tests pass
  • pip install into a clean venv and run kvm-control --mode tty <port> to verify the import fix end-to-end
  • pyinstaller kvm-gui.spec builds and the .app bundle reports the correct version

🤖 Generated with Claude Code

sjmf and others added 3 commits February 2, 2026 21:11
This also has the side effect of making test_keyboard_module_fallback_import much nicer

Towards #22
Read CFBundleShortVersionString and CFBundleVersion from pyproject.toml
at build time instead of hardcoding (was already stale at 1.5.1).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sjmf sjmf self-assigned this Feb 2, 2026
@sjmf sjmf mentioned this pull request Feb 2, 2026
@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.98%. Comparing base (a94660a) to head (958d30c).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
- Coverage   78.18%   77.98%   -0.20%     
==========================================
  Files          19       19              
  Lines        1733     1731       -2     
  Branches      213      210       -3     
==========================================
- Hits         1355     1350       -5     
- Misses        378      381       +3     
Flag Coverage Δ
unittests 77.98% <100.00%> (-0.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sjmf sjmf merged commit a29250a into main Feb 3, 2026
4 of 7 checks passed
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.

Backend module relative import broken

1 participant