fdf
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled

This commit is contained in:
nose
2025-12-24 03:34:12 -08:00
parent 2f8680ac3d
commit 0076667701

View File

@@ -286,6 +286,43 @@ if [[ "$NOINSTALL" != "true" ]]; then # If not explicitly requested, suggest ed
echo "Verifying installed CLI import..." echo "Verifying installed CLI import..."
if "$VENV_PY" -c 'import importlib; importlib.import_module("medeia_macina.cli_entry")' >/dev/null 2>&1; then if "$VENV_PY" -c 'import importlib; importlib.import_module("medeia_macina.cli_entry")' >/dev/null 2>&1; then
echo "OK: 'medeia_macina.cli_entry' is importable in the venv." echo "OK: 'medeia_macina.cli_entry' is importable in the venv."
# Additional compatibility check: top-level 'CLI' module may be required by
# older entrypoints or direct imports when running from a development checkout.
if ! "$VENV_PY" -c 'import importlib,sys; importlib.import_module("CLI")' >/dev/null 2>&1; then
echo "Note: top-level 'CLI' module not importable; some entrypoints expect it." >&2
# If this appears to be a development checkout, offer to install editable mode
if [[ -d "$REPO/.git" ]] || git -C "$REPO" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
if [[ "$EDITABLE" == "true" ]]; then
echo "Installing project in editable mode to provide top-level 'CLI'..."
"$VENV_PY" -m pip install -e "$REPO" || { echo "Editable install failed" >&2; exit 6; }
else
if [[ "$QUIET" != "true" && -t 0 ]]; then
read -p "Top-level 'CLI' not importable; install project in editable mode now? (Y/n) " devans2
if [[ -z "$devans2" || "$devans2" == "y" || "$devans2" == "Y" ]]; then
"$VENV_PY" -m pip install -e "$REPO" || { echo "Editable install failed" >&2; exit 6; }
else
echo "Continuing without editable install; 'mm' may not work as expected." >&2
fi
else
echo "Top-level 'CLI' not found and not interactive; re-run bootstrap with --editable or run: $VENV_PY -m pip install -e ." >&2
exit 6
fi
fi
# Re-check after editable install
if "$VENV_PY" -c 'import importlib; importlib.import_module("CLI")' >/dev/null 2>&1; then
echo "Success: top-level 'CLI' now importable." >&2
else
echo "ERROR: top-level 'CLI' still not importable after editable install; aborting." >&2
exit 6
fi
else
echo "Note: not a development checkout (no .git) — if you need top-level 'CLI' run: $VENV_PY -m pip install -e ." >&2
fi
fi
else else
echo "WARNING: Could not import 'medeia_macina.cli_entry' from the venv." >&2 echo "WARNING: Could not import 'medeia_macina.cli_entry' from the venv." >&2
# Check if legacy top-level module is present; if so, inform the user to prefer the packaged entrypoint # Check if legacy top-level module is present; if so, inform the user to prefer the packaged entrypoint