Skip to content

Fix wrong structure on version module failure tuple#3923

Merged
dialvarezs merged 2 commits intonf-core:devfrom
dialvarezs:fix-version-failure-tuple
Nov 24, 2025
Merged

Fix wrong structure on version module failure tuple#3923
dialvarezs merged 2 commits intonf-core:devfrom
dialvarezs:fix-version-failure-tuple

Conversation

@dialvarezs
Copy link
Copy Markdown
Member

@dialvarezs dialvarezs commented Nov 23, 2025

I found this issue when creating a new module, and changing the name of the input from versions_xxx to versions, which resulted in nf-core module lint throwing this exception:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/dxh/.local/bin/nf-core:10 in <module>                                                      │
│                                                                                                  │
│    7 │   │   sys.argv[0] = sys.argv[0][:-11]                                                     │
│    8 │   elif sys.argv[0].endswith(".exe"):                                                      │
│    9 │   │   sys.argv[0] = sys.argv[0][:-4]                                                      │
│ ❱ 10 │   sys.exit(run_nf_core())                                                                 │
│   11                                                                                             │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/__main__.py:130   │
│ in run_nf_core                                                                                   │
│                                                                                                  │
│    127 │   │   │   log.debug(f"Could not check latest version: {e}")                             │
│    128 │   │   stderr.print("\n")                                                                │
│    129 │   # Launch the click cli                                                                │
│ ❱  130 │   nf_core_cli(auto_envvar_prefix="NFCORE")                                              │
│    131                                                                                           │
│    132                                                                                           │
│    133 @tui(command="interface", help="Launch the nf-core interface")                            │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/rich_click/rich_command.p │
│ y:402 in __call__                                                                                │
│                                                                                                  │
│   399 │   │   # Include this here because I run into a false warning                             │
│   400 │   │   # in the PyCharm IDE otherwise; for some reason PyCharm doesn't                    │
│   401 │   │   # seem to think RichGroups are callable. (No issues with Mypy, though.)            │
│ ❱ 402 │   │   return super().__call__(*args, **kwargs)                                           │
│   403 │                                                                                          │
│   404 │   @overload                                                                              │
│   405 │   def command(self, __func: Callable[..., Any]) -> RichCommand: ...                      │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/core.py:1485 in     │
│ __call__                                                                                         │
│                                                                                                  │
│   1482 │                                                                                         │
│   1483 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1484 │   │   """Alias for :meth:`main`."""                                                     │
│ ❱ 1485 │   │   return self.main(*args, **kwargs)                                                 │
│   1486                                                                                           │
│   1487                                                                                           │
│   1488 class _FakeSubclassCheck(type):                                                           │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/rich_click/rich_command.p │
│ y:216 in main                                                                                    │
│                                                                                                  │
│   213 │   │   try:                                                                               │
│   214 │   │   │   try:                                                                           │
│   215 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                   │
│ ❱ 216 │   │   │   │   │   rv = self.invoke(ctx)                                                  │
│   217 │   │   │   │   │   if not standalone_mode:                                                │
│   218 │   │   │   │   │   │   return rv                                                          │
│   219 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!                                │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/core.py:1873 in     │
│ invoke                                                                                           │
│                                                                                                  │
│   1870 │   │   │   │   super().invoke(ctx)                                                       │
│   1871 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1872 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1873 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1874 │   │                                                                                     │
│   1875 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1876 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/core.py:1873 in     │
│ invoke                                                                                           │
│                                                                                                  │
│   1870 │   │   │   │   super().invoke(ctx)                                                       │
│   1871 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1872 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1873 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1874 │   │                                                                                     │
│   1875 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1876 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/core.py:1269 in     │
│ invoke                                                                                           │
│                                                                                                  │
│   1266 │   │   │   echo(style(message, fg="red"), err=True)                                      │
│   1267 │   │                                                                                     │
│   1268 │   │   if self.callback is not None:                                                     │
│ ❱ 1269 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                │
│   1270 │                                                                                         │
│   1271 │   def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]:      │
│   1272 │   │   """Return a list of completions for the incomplete value. Looks                   │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/core.py:824 in      │
│ invoke                                                                                           │
│                                                                                                  │
│    821 │   │                                                                                     │
│    822 │   │   with augment_usage_errors(self):                                                  │
│    823 │   │   │   with ctx:                                                                     │
│ ❱  824 │   │   │   │   return callback(*args, **kwargs)                                          │
│    825 │                                                                                         │
│    826 │   def forward(self, cmd: Command, /, *args: t.Any, **kwargs: t.Any) -> t.Any:           │
│    827 │   │   """Similar to :meth:`invoke` but fills in default keyword                         │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/click/decorators.py:34 in │
│ new_func                                                                                         │
│                                                                                                  │
│    31 │   """                                                                                    │
│    32 │                                                                                          │
│    33 │   def new_func(*args: P.args, **kwargs: P.kwargs) -> R:                                  │
│ ❱  34 │   │   return f(get_current_context(), *args, **kwargs)                                   │
│    35 │                                                                                          │
│    36 │   return update_wrapper(new_func, f)                                                     │
│    37                                                                                            │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/__main__.py:1321  │
│ in command_modules_lint                                                                          │
│                                                                                                  │
│   1318 │   """                                                                                   │
│   1319 │   Lint one or more modules in a directory.                                              │
│   1320 │   """                                                                                   │
│ ❱ 1321 │   modules_lint(ctx, tool, directory, registry, key, all, fail_warned, local, passed, s  │
│   1322                                                                                           │
│   1323                                                                                           │
│   1324 # nf-core modules info                                                                    │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/commands_modules. │
│ py:288 in modules_lint                                                                           │
│                                                                                                  │
│   285 │   │   │   no_pull=ctx.obj["modules_repo_no_pull"],                                       │
│   286 │   │   │   hide_progress=ctx.obj["hide_progress"],                                        │
│   287 │   │   )                                                                                  │
│ ❱ 288 │   │   module_lint.lint(                                                                  │
│   289 │   │   │   module=tool,                                                                   │
│   290 │   │   │   registry=registry,                                                             │
│   291 │   │   │   key=key,                                                                       │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/modules/lint/__in │
│ it__.py:173 in lint                                                                              │
│                                                                                                  │
│   170 │   │                                                                                      │
│   171 │   │   # Lint nf-core modules                                                             │
│   172 │   │   if not local and len(remote_modules) > 0:                                          │
│ ❱ 173 │   │   │   self.lint_modules(remote_modules, registry=registry, local=False, fix_versio   │
│   174 │   │                                                                                      │
│   175 │   │   if print_results:                                                                  │
│   176 │   │   │   self._print_results(show_passed=show_passed, sort_by=sort_by)                  │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/modules/lint/__in │
│ it__.py:209 in lint_modules                                                                      │
│                                                                                                  │
│   206 │   │   │                                                                                  │
│   207 │   │   │   for mod in modules:                                                            │
│   208 │   │   │   │   progress_bar.update(lint_progress, advance=1, test_name=mod.component_na   │
│ ❱ 209 │   │   │   │   self.lint_module(mod, progress_bar, local=local, fix_version=fix_version   │
│   210 │                                                                                          │
│   211 │   def lint_module(                                                                       │
│   212 │   │   self,                                                                              │
│                                                                                                  │
│ /home/dxh/.local/share/uv/tools/nf-core/lib64/python3.13/site-packages/nf_core/modules/lint/__in │
│ it__.py:288 in lint_module                                                                       │
│                                                                                                  │
│   285 │   │   │   else:                                                                          │
│   286 │   │   │   │   self.failed += warned                                                      │
│   287 │   │   │                                                                                  │
│ ❱ 288 │   │   │   self.failed += [LintResult(mod, *m) for m in mod.failed]                       │
│   289 │                                                                                          │
│   290 │   def update_meta_yml_file(self, mod):                                                   │
│   291 │   │   """                                                                                │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: LintResult.__init__() missing 1 required positional argument: 'file_path'

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@dialvarezs dialvarezs changed the base branch from main to dev November 23, 2025 00:40
@nf-core nf-core deleted a comment from github-actions Bot Nov 23, 2025
Copy link
Copy Markdown
Member

@mirpedrol mirpedrol left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@dialvarezs dialvarezs merged commit 586ed96 into nf-core:dev Nov 24, 2025
114 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants