Skip to content

feat(packaging): ship locales/adapters + isolate data & models - #17

Merged
ManSio merged 1 commit into
mainfrom
feat/pypi-packaging
Aug 28, 2026
Merged

feat(packaging): ship locales/adapters + isolate data & models#17
ManSio merged 1 commit into
mainfrom
feat/pypi-packaging

Conversation

@ManSio

@ManSio ManSio commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Make MSCodeBase publishable as a PyPI/uvx package and keep user data out of site-packages.

Problem: Server did not start from an installed wheel (ModuleNotFoundError: No module named '''tools'''), locales/adapters were missing, and binaries/models could be written into site-packages; no CLI way to pick the target project.

Changes:

  • Package tools.stale_detector, adapters/, locales/ (include + package-data json).
  • Gate _get_ext_dir() on __mscodebase_ext__.marker: extension/dev keep their root; installed pip/uvx falls back to get_data_root() (%LOCALAPPDATA%/mscodebase) instead of writing into site-packages.
  • Add --project-path/--project-dir CLI -> MSCODEBASE_PROJECT_PATH env, prioritised above CWD with trust_self_index; legacy PROJECT_PATH stays behind CWD (multi-window isolation kept).
  • Drop a debug side-effect that wrote C:\temp\mscb_MAIN.txt on import.
  • Add tests for the new priority override; sync memories (KNOWN_ISSUES/AGENT_DIARY).

Verification:

  • Independent QA review of the diff (A-E: PASS) + full test run by sub-agents.
  • pytest: 1562 passed / 0 failed (+4 new tests on the priority override).
  • Live-Smoke from a clean venv wheel with --project-path: tools-ok, tool_count=48, locale en (78 keys), project root resolves.
  • All 5 pre-commit checks green.

Closes #16 (extends the codebase hub fix work).

Make MSCodeBase publishable as a PyPI/uvx package and keep user data
out of site-packages.

- Package tools.stale_detector, adapters/ and locales/ (include +
  package-data json) so the server starts from an installed wheel
  (fixes ModuleNotFoundError: No module named 'tools').
- Gate _get_ext_dir() on the __mscodebase_ext__.marker: extension/dev
  resolve to their root, installed pip/uvx falls back to get_data_root()
  (%LOCALAPPDATA%/mscodebase) instead of writing binaries/models into
  site-packages.
- Add --project-path/--project-dir CLI -> MSCODEBASE_PROJECT_PATH env,
  prioritised ABOVE CWD with trust_self_index in resolve_project_root();
  legacy PROJECT_PATH stays behind CWD (multi-window isolation kept).
- Drop a debug side-effect that wrote C:\temp\mscb_MAIN.txt on import.
- Add tests for the new priority override; sync KNOWN_ISSUES/AGENT_DIARY.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fb8137fc-e9c0-4e09-a88e-23c67eaf28a7


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ManSio
ManSio merged commit 957cd0f into main Aug 28, 2026
12 of 13 checks passed
@ManSio
ManSio deleted the feat/pypi-packaging branch August 28, 2026 14:35
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