Skip to content

refactor(package): rename p2m -> assert_eval (CLI is assert-eval) - #108

Merged
Chang Liu (changliu2) merged 1 commit into
mainfrom
cli-rename-assert-eval
May 27, 2026
Merged

refactor(package): rename p2m -> assert_eval (CLI is assert-eval)#108
Chang Liu (changliu2) merged 1 commit into
mainfrom
cli-rename-assert-eval

Conversation

@changliu2

@changliu2 Chang Liu (changliu2) commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Renames the Python package and unifies the CLI surface to use a single canonical name across the whole project. There is no behavior change — every import, console-script invocation, and YAML callable path now points at the new module.

Surface Before After
Python module folder p2m/ assert_eval/
Python import name p2m assert_eval
Distribution package on PyPI p2m-policy assert-eval
CLI binary p2m / assert / assert-eval (aliases) assert-eval only
GitHub repo / brand microsoft/ASSERT unchanged

Why these names

assert alone is a Python keyword, so the module cannot be named that. assert_eval (snake_case) mirrors the kebab-case CLI assert-eval, following the convention of python-dotenvdotenv, scikit-learnsklearn. The PyPI distribution name assert-eval matches the CLI binary, so users discover and install with the same string.

Breaking changes

  • p2m and assert console-script aliases are removed. Only assert-eval is registered. Anyone with p2m run … in scripts or docs must migrate to assert-eval run ….
  • import p2m no longer resolves. Migrate to import assert_eval.
  • Installing via pip install p2m-policy no longer works. Use pip install assert-eval (or the equivalent git-URL install during the preview).

Migration

# Imports
- from p2m.core.runner import run
+ from assert_eval.core.runner import run

# requirements.txt
- p2m-policy @ git+https://github.com/microsoft/ASSERT.git@main
+ assert-eval @ git+https://github.com/microsoft/ASSERT.git@main

# CLI invocations in scripts / CI
- p2m run --config eval_config.yaml
+ assert-eval run --config eval_config.yaml

Scope of this PR

  • git mv p2m/ assert_eval/ — preserves history for all 77 module files.
  • Mechanical rewrite of every from p2m / import p2m reference (≈420 statements across 120 files): tests, examples, scripts, viewer, docs.
  • pyproject.toml: distribution name (p2m-policyassert-eval), packages discovery (["p2m*", …]["assert_eval*", …]), console-script aliases removed.
  • READMEs, AGENTS.md, docs/* prose updated to use the new names.
  • Historical run snapshots under examples/**/artifacts/results/** are left untouched — they are records of what was executed at the time and would mis-represent history if rewritten.

Note on .github/workflows/regression.yml

The five-line update to the regression workflow (path filter p2m/**assert_eval/**, env var P2M_AZURE_DEPLOYMENTASSERT_AZURE_DEPLOYMENT, and three comment lines) is being applied as a separate commit via the GitHub web UI because the gh CLI OAuth App on EMU cannot grant workflow scope for the push. The change is mechanically identical to the rest of the rename.

Validation

  • uv pip install -e .
  • assert-eval --help → exits 0, shows full subcommand list ✅
  • assert --help / p2m --help → command not found (intended) ✅
  • python -c "import assert_eval" ✅ / python -c "import p2m"ModuleNotFoundError (intended) ✅
  • uv run --no-sync --active pytest -q835 passed, 14 skipped, 450 subtests passed (baseline match) ✅

Downstream

  • microsoft-foundry/build-2026-demos cookbook pins p2m-policy in its requirements.txt. Tracking sync in microsoft-foundry/build-2026-demos#8 — should merge in the same window as this PR.

…2m' kept for backward compat)

Adds the canonical assert-eval entry point while retaining assert and p2m aliases.

Updates CLI help examples, viewer spawn defaults, docs, examples, scripts, and test comments to show assert-eval commands.

Leaves the Python package and module name unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@changliu2
Chang Liu (changliu2) merged commit 00d50bd into main May 27, 2026
3 checks passed
@changliu2 Chang Liu (changliu2) changed the title feat(cli): make assert-eval the canonical CLI refactor(package): rename p2m -> assert_eval (CLI is assert-eval) May 27, 2026
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.

2 participants