Skip to content

Python: drop a console script whose callable does not exist - #10169

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
lxcxjxhx:fix/lab-lightning-script
Nov 9, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 1 commit into
microsoft:mainfrom
lxcxjxhx:fix/lab-lightning-script

Conversation

@lxcxjxhx

Copy link
Copy Markdown
Contributor

Motivation & Context

python/packages/lab/pyproject.toml declares two console scripts:

[project.scripts]
gaia_viewer = "agent_framework_lab_gaia:viewer_main"
lightning = "agent_framework_lab_lightning:main"

The lightning target does not exist. lightning/agent_framework_lab_lightning/__init__.py defines one public name, AgentFrameworkTracer (__all__ = ["AgentFrameworkTracer"]), so installing agent-framework-lab[lightning] produces a lightning executable that fails on import instead of running. The two main() functions in the package live in lightning/samples/train_tau2_agent.py and lightning/samples/train_math_agent.py; neither is importable as agent_framework_lab_lightning:main.

The sibling entry is fine: viewer_main is defined in gaia/agent_framework_lab_gaia/ and re-exported from its __init__.py (line 8, listed in __all__ on line 25).

Description & Review Guide

  • What are the major changes? Deletes one line: the lightning console script. Nothing else moves — no import, no package, no __init__.
  • What is the impact of these changes? pip install "agent-framework-lab[lightning]" no longer advertises a command that cannot start. The lightning extra and the agent_framework_lab_lightning package itself are untouched; library users import AgentFrameworkTracer exactly as before.
  • What do you want reviewers to focus on? Whether a lightning CLI is planned. If it is, the fix should be a real main() in agent_framework_lab_lightning rather than removing the entry — say so and I will implement it instead. A command that raises ImportError the first time a user types it is the worse of the two states, which is why this PR takes the removal path.

Evidence gathered before touching anything (run on the parent commit):

$ python - <<'PY'
import ast, tomllib, pathlib
py = tomllib.loads(pathlib.Path("python/packages/lab/pyproject.toml").read_text())
pkg = pathlib.Path("python/packages/lab/lightning/agent_framework_lab_lightning/__init__.py")
names = {n.name for n in ast.parse(pkg.read_text()).body
         if isinstance(n, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef))}
print(py["project"]["scripts"])                       # {... , 'lightning': 'agent_framework_lab_lightning:main'}
print("main" in names)                                # False
PY
$ grep -rn "def main" python/packages/lab/lightning/agent_framework_lab_lightning/
(no matches; the only main() functions are under lightning/samples/, which has no __init__.py
 and is not listed in [tool.setuptools] packages)
$ grep -rn "lightning" .github/workflows/*.yml
(no CI job invokes the command)

Related Issue

N/A - trivial change. One deleted line, no design decision, and the alternative (implementing the CLI) is called out above rather than silently chosen.

AI Assistance

  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: the console-script target was found with a static check that resolves module:attr entries in pyproject.toml against the modules' top-level bindings; the absence of main, the sibling script's validity, and the lack of any workflow or docs reference were then confirmed by hand with the commands above. The description was written from those results.

Contribution Checklist

  • The code builds clean without any errors or warnings — the file parses (tomllib.load) and the resulting [project.scripts] is {'gaia_viewer': ...}.
  • All unit tests pass, and I have added new tests where possible — no test added: packaging metadata only, and no test exercises the console script.
  • The PR follows the Contribution Guidelines.
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change exception.
  • This is not a breaking change — the deleted command never worked.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the change removing the broken lightning console-script registration.

No open issues 🎉

What changed in this PR

Removes the broken lightning console-script entry from the Python lab package because its target callable does not exist.

Changes:

  • Stops generating a lightning executable that fails on import.
  • Leaves gaia_viewer, the lightning extra, and the AgentFrameworkTracer library API unchanged.
File Description
python/​packages/​lab/​pyproject.toml Deletes the invalid agent_framework_lab_lightning:main console-script registration.

Review effort: Balanced

Merged via the queue into microsoft:main with commit 15721f4 Nov 9, 2026
67 of 68 checks passed

This branch was previously deployed

1 inactive deployment
github-app-auth — 6970a55b Deployed Nov 7, 2026 by lxcxjxhx via team_check #8941
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lab Usage: [Issues, PRs], Target: lab packages python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants