Skip to content

Toil and toil-vg both want the --config option #5419

@adamnovak

Description

@adamnovak

I'm trying to update the old toil-vg workflow to current Toil, and I am getting errors like this because of a duplicate --config option:

Traceback (most recent call last):
  File "/Users/anovak/workspace/vg/.env/bin/toil-vg", line 7, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/anovak/workspace/vg/.env/lib/python3.12/site-packages/toil_vg/vg_toil.py", line 434, in main
    args = parse_args(sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/anovak/workspace/vg/.env/lib/python3.12/site-packages/toil_vg/vg_toil.py", line 81, in parse_args
    pipeline_subparser(parser_run)
  File "/Users/anovak/workspace/vg/.env/lib/python3.12/site-packages/toil_vg/vg_toil.py", line 169, in pipeline_subparser
    add_common_vg_parse_args(parser_run)
  File "/Users/anovak/workspace/vg/.env/lib/python3.12/site-packages/toil_vg/vg_common.py", line 85, in add_common_vg_parse_args
    parser.add_argument('--config', default=None, type=str,
  File "/Users/anovak/workspace/vg/.env/lib/python3.12/site-packages/configargparse.py", line 1403, in add_argument
    action = self.original_add_argument_method(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1500, in add_argument
    return self._add_action(action)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1885, in _add_action
    self._optionals._add_action(action)
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1705, in _add_action
    action = super(_ArgumentGroup, self)._add_action(action)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1514, in _add_action
    self._check_conflict(action)
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1654, in _check_conflict
    conflict_handler(action, confl_optionals)
  File "/opt/homebrew/Cellar/python@3.12/3.12.11/Frameworks/Python.framework/Versions/3.12/lib/python3.12/argparse.py", line 1663, in _handle_conflict_error
    raise ArgumentError(action, message % conflict_string)
argparse.ArgumentError: argument --config: conflicting option string: --config

Toil added ConfigArgParse and its --config option after the workflow was already using a --config option itself.

We should let the workflow rename Toil's config option out of the way. (We might actually want an option namespacing system for all of Toil's options, somehow.)

┆Issue is synchronized with this Jira Story
┆Issue Number: TOIL-1795

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions