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.
Problem
Seventeen scripts under
skills/*/scripts/reference an undefined variableskill_namein their human-readable output branch. Sincesummaryis thedefault for
--format, they fail on a plain invocation:It also fails through the executor whenever
parametershas noformat:Affected
skills/{anndata,astropy,cirq,dask,pennylane,plotly,polars,qiskit,qutip,scanpy,seaborn,sympy}/scripts/demo.pyand
skills/{clinvar-database,ena-database,geo-database,gwas-database,hmdb-database}/scripts/query.py.The five
query.pyfiles are working database clients, not placeholder demos.Proposed fix
Define
SKILL_NAMEfrom the skill directory name, one line per file, plus asmoke test over
skills/*/scripts/*.pythat fails on the undefined name.Happy to send the PR if that works for you.
Side note
skills/CONTRIBUTING.md:62says the executor injects--format jsonwhennot provided, but
core/skill_executor.pydoes not appear to do this.Should the doc or the code change? Happy to file it separately.
Environment
Python 3.12, Linux,
mainatab9aba130200e0a7dd4c76dca5cf945169f8c44a.