Skip to content

17 skill scripts fail with NameError: name 'skill_name' is not defined #15

Description

@baltasarblanco

Problem

Seventeen scripts under skills/*/scripts/ reference an undefined variable
skill_name in their human-readable output branch. Since summary is the
default for --format, they fail on a plain invocation:

$ python3 skills/sympy/scripts/demo.py
===========================================================
$ echo $?
1
# stderr: Error: name 'skill_name' is not defined

$ python3 skills/sympy/scripts/demo.py --format json
{ "status": "success", ... }

It also fails through the executor whenever parameters has no format:

SkillExecutor().execute_skill(
    skill_name="sympy",
    skill_metadata={"executables": ["skills/sympy/scripts/demo.py"], "type": "script"},
    parameters={"example": "basic"}, timeout=30)
# {"status": "error", "error": "Script failed: Error: name 'skill_name' is not defined\n"}

Affected

skills/{anndata,astropy,cirq,dask,pennylane,plotly,polars,qiskit,qutip,scanpy,seaborn,sympy}/scripts/demo.py
and skills/{clinvar-database,ena-database,geo-database,gwas-database,hmdb-database}/scripts/query.py.

The five query.py files are working database clients, not placeholder demos.

Proposed fix

Define SKILL_NAME from the skill directory name, one line per file, plus a
smoke test over skills/*/scripts/*.py that fails on the undefined name.
Happy to send the PR if that works for you.

Side note

skills/CONTRIBUTING.md:62 says the executor injects --format json when
not provided, but core/skill_executor.py does not appear to do this.
Should the doc or the code change? Happy to file it separately.

Environment

Python 3.12, Linux, main at ab9aba130200e0a7dd4c76dca5cf945169f8c44a.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions