Repository navigation
Report program name as cwltool when invoked as cwl-runner (#1535) - #2290
Conversation
|
Good question — I checked the three:
To avoid that, I scoped the override to the actual entry-point name: |
0e4e371 to
f05eab4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2290 +/- ##
=======================================
Coverage 85.18% 85.18%
=======================================
Files 46 46
Lines 8595 8595
Branches 2012 2012
=======================================
Hits 7322 7322
Misses 807 807
Partials 466 466 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Checking back in — the pushed change should address the Toil/Calrissian/Arvados question (scoped the override to |
f05eab4 to
2a748ed
Compare
…kflow-language#1535) argparse defaults prog to os.path.basename(sys.argv[0]), so running cwltool through its cwl-runner entry point made --help and error messages say "usage: cwl-runner ...". Set prog="cwltool" explicitly so the reference implementation is always identified consistently, regardless of which entry point was used. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…guage#1535) Per review feedback: an unconditional prog="cwltool" would leak into downstream tools that reuse cwltool.argparser.arg_parser() as their base parser (e.g. Calrissian), changing their --help/usage program name. Scope the override to the actual invocation name: set prog="cwltool" only when invoked as the generic "cwl-runner" alias, otherwise leave it None so argparse's basename default is preserved. Toil and Arvados are unaffected either way (they build their own parsers). Added a test asserting a downstream invocation name is preserved.
2a748ed to
73baa89
Compare
|
@arimu1 Please don't do that after a maintainer has approved a PR; you should let them handle it from there. |
|
@arimu1 I can re-run just the failed CI; but if you push a new commit then all of the CI has to run again, which is a waste of time and resources |
Summary
Fixes #1535.
cwltoolis installed with acwl-runnerconsole-script entry point. Becauseargparsedefaultsprogtoos.path.basename(sys.argv[0]), invoking it through that alias made the help and error output identify the program ascwl-runner:Change
Set
prog="cwltool"explicitly on the top-levelArgumentParserincwltool/argparser.py, so the reference implementation is always identified consistently no matter which entry point launched it:This also applies to the usage line printed on argument errors.
Tests
Added
test_argparser_prog_is_cwltooltotests/test_toolargparse.py, which patchessys.argv[0]tocwl-runnerand assertsarg_parser().prog == "cwltool". Fulltest_toolargparse.pypasses (18);black/flake8/isortclean.This change was produced with the assistance of Claude Code (model: Claude Opus). It was reviewed by a human before submission.