• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cpmpercussion / impsy / 26320111824

23 May 2026 01:42AM UTC coverage: 83.706% (+0.2%) from 83.545%
26320111824

push

github

web-flow
Make webui workspace paths workspace-relative; bundle default template (#85)

The webui used to derive LOGS_DIR / MODEL_DIR / DATASET_DIR / CONFIGS_DIR
from the impsy package's parent directory. That worked for source-tree
clones but pointed into site-packages for pip-installed users — uploads
went to the wrong place, lists were empty, and the auto-create config
silently failed because configs/ was never shipped.

Workspace resolution is now layered:

1. Explicit override via `impsy webui --workdir <dir>` (also passable as
   the `IMPSY_WORKDIR` env var, handy for Docker).
2. Source-tree root when the package has a sibling `pyproject.toml`
   (preserves the dev experience for git clones).
3. Otherwise the current working directory — the right default for a
   pip user running `impsy webui` in their workspace.

`set_workspace()` is exposed for tests and for the CLI to call after
parsing `--workdir`, and refreshes the module-level path globals so
existing imports (`MODEL_DIR`, `CONFIG_FILE`, etc.) keep working.

Also bundles a default config template as `impsy/data/default.toml`
(verified to ship inside the wheel) and reads it via
`importlib.resources`, replacing the broken `CONFIGS_DIR / default.toml`
lookup. The webui's auto-create-on-first-run and the /config/create-default
POST handler now both write the bundled template into the workspace's
config.toml.

Five new tests cover: template packaging, workspace switching, env-var
override, CWD fallback for installed-package layout, and the bundled
config write.

Closes #81.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>

30 of 40 new or added lines in 1 file covered. (75.0%)

1 existing line in 1 file now uncovered.

1536 of 1835 relevant lines covered (83.71%)

2.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.62
/impsy/web_interface.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc