Skip to content

refactor: migrate ECC workspace paths to pathlib#131

Draft
Emin017 wants to merge 16 commits into
mainfrom
emin/refactor-workspace-pathlib
Draft

refactor: migrate ECC workspace paths to pathlib#131
Emin017 wants to merge 16 commits into
mainfrom
emin/refactor-workspace-pathlib

Conversation

@Emin017

@Emin017 Emin017 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Move ECC runtime filesystem paths toward pathlib.Path / Path | None internally.
  • Preserve string-based contracts at CLI, JSON, subprocess, and native binding boundaries.
  • Fix boundary regressions found during the migration, including None path serialization and normalized workspace create responses.

Scope

Select the areas touched by this PR:

  • CLI - command behavior, Typer command surface, output formats, or workspace commands.
  • Flow/runtime - workspace lifecycle, EngineFlow, step execution, logs, metrics, or artifacts.
  • EDA integration - Yosys, ECC-Tools, DreamPlace, KLayout, PDKs, or native/runtime wrappers.
  • Build/package - Bazel, Nix, PyInstaller, wheels, uv.lock, or release artifacts.
  • CI/release - GitHub Actions, version checks, changelog, or release automation.
  • Tests/docs only

What Changed

  • Store and pass workspace, PDK, parameter, home, checklist, JSON helper, and step builder filesystem values as Path objects internally.
  • Keep public APIs such as create_workspace(), load_workspace(), and get_pdk() string-compatible, normalizing paths at the boundary.
  • Convert paths back to strings before JSON writes, CLI/service responses, subprocess calls, and ECC native binding calls.
  • Preserve existing workspace JSON schemas and artifact filenames.
  • Add behavior-focused tests for Path storage, public string compatibility, JSON serialization, native/subprocess stringification, missing Sizer/DreamPlace inputs, and normalized
    workspace create responses.
  • Remove signature-only assertion tests so coverage checks runtime behavior instead of annotation text.

Validation

List the commands you ran. Mark checks that are not applicable as N/A.

  • uv run pytest test/
  • Focused pytest:
  • uv run ruff check chipcompiler test
  • uv run ruff format --check chipcompiler test
  • bazel build //:build_ecc_cli_bundle
  • PyInstaller smoke: ecc --help, ecc --version, ecc version --json
  • Nix smoke: nix run .#cli -- --help
  • Manual flow smoke:
  • Other:

Skipped checks and reason:

Runtime And Packaging Impact

  • No runtime or packaging impact
  • CLI output or machine-readable contract changed
  • Workspace layout, flow state, or artifact paths changed
  • Native toolchain or wrapper behavior changed
  • ecc-tools or ecc-dreamplace dependency changed
  • PyInstaller, Nix, Bazel, or release artifact changed

Notes:

Checklist

  • I kept the change scoped to ECC.
  • I updated docs or user-facing CLI text where behavior changed.
  • I included lockfile or version metadata updates when dependencies changed.
  • I documented any submodule updates and why they are needed.
  • I did not include local caches, virtual environments, or generated build outputs.
  • I explained skipped validation and remaining risk.

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