feat: manage.py cross-platform product manager #18

Merged
pyr0ball merged 1 commit from feature/manage-py into main 2026-04-02 23:04:59 -07:00
Owner

Summary

Closes #6

  • circuitforge_core.manage module — replaces bash-only manage.sh
  • Docker mode: wraps docker compose (v2 plugin) or docker-compose (v1 fallback); auto-detected when Docker is available and a compose file exists
  • Native mode: PID-file process management via platformdirs paths; cross-platform kill (SIGTERM/SIGKILL on Unix, taskkill /F on Windows); polling log tail (no tail -f)
  • manage.toml: product config — app name, URL, compose file, native service list
  • install-shims command: writes manage.sh + manage.ps1 into the product directory
  • python -m circuitforge_core.manage entry point
  • cf-manage console script

Test plan

  • pytest tests/test_manage/ — 36 tests (config 6, docker_mode 9, native_mode 21)
  • Full suite: 279 passed
  • python -m circuitforge_core.manage --help from any product dir
  • python -m circuitforge_core.manage install-shims generates shims
## Summary Closes #6 - `circuitforge_core.manage` module — replaces bash-only `manage.sh` - **Docker mode**: wraps `docker compose` (v2 plugin) or `docker-compose` (v1 fallback); auto-detected when Docker is available and a compose file exists - **Native mode**: PID-file process management via `platformdirs` paths; cross-platform kill (SIGTERM/SIGKILL on Unix, `taskkill /F` on Windows); polling log tail (no `tail -f`) - **`manage.toml`**: product config — app name, URL, compose file, native service list - **`install-shims`** command: writes `manage.sh` + `manage.ps1` into the product directory - **`python -m circuitforge_core.manage`** entry point - **`cf-manage`** console script ## Test plan - [ ] `pytest tests/test_manage/` — 36 tests (config 6, docker_mode 9, native_mode 21) - [ ] Full suite: 279 passed - [ ] `python -m circuitforge_core.manage --help` from any product dir - [ ] `python -m circuitforge_core.manage install-shims` generates shims
pyr0ball added 1 commit 2026-04-02 23:04:49 -07:00
- circuitforge_core.manage module — replaces bash-only manage.sh
  - config.py: ManageConfig from manage.toml (TOML via tomllib/tomli)
    app name, default_url, docker compose_file/project, native services
    Falls back to directory name when no manage.toml present
  - docker_mode.py: DockerManager wrapping 'docker compose' (v2 plugin)
    or 'docker-compose' (v1 fallback); docker_available() probe
    Commands: start, stop, restart, status, logs, build
  - native_mode.py: NativeManager with PID file process management
    platformdirs for platform-appropriate PID/log paths
    Windows-compatible log tailing (polling, no tail -f)
    Cross-platform kill: SIGTERM→SIGKILL on Unix, taskkill /F on Windows
  - cli.py: typer CLI — start/stop/restart/status/logs/build/open/install-shims
    Mode auto-detection: Docker available + compose file → docker; else native
    --mode docker|native|auto override
  - templates/manage.sh: bash shim (conda, venv, python3 detection)
  - templates/manage.ps1: PowerShell shim (same detection, Windows)
  - templates/manage.toml.example: annotated config template
  - __main__.py: python -m circuitforge_core.manage entry point

- pyproject.toml: manage extras group (platformdirs, typer)
  cf-manage console script; version bumped to 0.5.0

- 36 tests: config (6), docker_mode (9), native_mode (21)
pyr0ball merged commit 7397e227e2 into main 2026-04-02 23:04:59 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Circuit-Forge/circuitforge-core#18
No description provided.