nf-core / nf-core/tools

stack trace using nf-core modules test

Open
#4,273 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

Description of the bug

Attempting to test a module with nf-core modules test results in a stack trace.

Command used and terminal output
% nf-core modules test krakenuniq/build


                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\ 
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 4.0.2 - https://nf-co.re


╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/bin/nf-core:10 in   │
│ <module>                                                                                         │
│                                                                                                  │
│    7                                                                                             │
│    8 if __name__ == '__main__':                                                                  │
│    9 │   sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])                       │
│ ❱ 10 │   sys.exit(run_nf_core())                                                                 │
│   11                                                                                             │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/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")                            │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/rich_click/rich_command.py: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: ...                      │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/click/core.py:1442 in __call__                                                         │
│                                                                                                  │
│   1439 │                                                                                         │
│   1440 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1441 │   │   """Alias for :meth:`main`."""                                                     │
│ ❱ 1442 │   │   return self.main(*args, **kwargs)                                                 │
│   1443                                                                                           │
│   1444                                                                                           │
│   1445 class _FakeSubclassCheck(type):                                                           │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/rich_click/rich_command.py: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!                                │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/click/core.py:1830 in invoke                                                           │
│                                                                                                  │
│   1827 │   │   │   │   super().invoke(ctx)                                                       │
│   1828 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1829 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1830 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1831 │   │                                                                                     │
│   1832 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1833 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/click/core.py:1830 in invoke                                                           │
│                                                                                                  │
│   1827 │   │   │   │   super().invoke(ctx)                                                       │
│   1828 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1829 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1830 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1831 │   │                                                                                     │
│   1832 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1833 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/click/core.py:1226 in invoke                                                           │
│                                                                                                  │
│   1223 │   │   │   echo(style(message, fg="red"), err=True)                                      │
│   1224 │   │                                                                                     │
│   1225 │   │   if self.callback is not None:                                                     │
│ ❱ 1226 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                │
│   1227 │                                                                                         │
│   1228 │   def shell_complete(self, ctx: Context, incomplete: str) -> list[CompletionItem]:      │
│   1229 │   │   """Return a list of completions for the incomplete value. Looks                   │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/click/core.py:794 in invoke                                                            │
│                                                                                                  │
│    791 │   │                                                                                     │
│    792 │   │   with augment_usage_errors(self):                                                  │
│    793 │   │   │   with ctx:                                                                     │
│ ❱  794 │   │   │   │   return callback(*args, **kwargs)                                          │
│    795 │                                                                                         │
│    796 │   def forward(self, cmd: Command, /, *args: t.Any, **kwargs: t.Any) -> t.Any:           │
│    797 │   │   """Similar to :meth:`invoke` but fills in default keyword                         │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/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                                                                                            │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/nf_core/__main__.py:1292 in command_modules_test                                       │
│                                                                                                  │
│   1289 │   """                                                                                   │
│   1290 │   if verbose:                                                                           │
│   1291 │   │   ctx.obj["verbose"] = verbose                                                      │
│ ❱ 1292 │   modules_test(ctx, tool, directory, no_prompts, update, once, profile)                 │
│   1293                                                                                           │
│   1294                                                                                           │
│   1295 # nf-core modules lint                                                                    │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/nf_core/commands_modules.py:231 in modules_test                                        │
│                                                                                                  │
│   228 │   │   │   verbose=ctx.obj["verbose"],                                                    │
│   229 │   │   │   profile=profile,                                                               │
│   230 │   │   )                                                                                  │
│ ❱ 231 │   │   module_tester.run()                                                                │
│   232 │   except (UserWarning, LookupError) as e:                                                │
│   233 │   │   log.critical(e)                                                                    │
│   234 │   │   sys.exit(1)                                                                        │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/nf_core/components/components_test.py:90 in run                                        │
│                                                                                                  │
│    87 │                                                                                          │
│    88 │   def run(self) -> None:                                                                 │
│    89 │   │   """Run build steps"""                                                              │
│ ❱  90 │   │   self.check_inputs()                                                                │
│    91 │   │   os.environ["NFT_DIFF"] = "pdiff"  # set nf-test differ to pdiff to get a better    │
│    92 │   │   os.environ["NFT_DIFF_ARGS"] = (                                                    │
│    93 │   │   │   "--line-numbers --expand-tabs=2"  # taken from https://code.askimed.com/nf-t   │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/nf_core/components/components_test.py:150 in check_inputs                              │
│                                                                                                  │
│   147 │   │   │   │   │   "message": "Choose container software to run the test with",           │
│   148 │   │   │   │   │   "choices": ["Docker", "Singularity", "Conda"],                         │
│   149 │   │   │   │   }                                                                          │
│ ❱ 150 │   │   │   │   answer = questionary.unsafe_prompt([question], style=nf_core.utils.nfcor   │
│   151 │   │   │   │   profile = answer["profile"].lower()                                        │
│   152 │   │   │   │   os.environ["PROFILE"] = profile                                            │
│   153                                                                                            │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/questionary/prompt.py:221 in unsafe_prompt                                             │
│                                                                                                  │
│   218 │   │   if missing_args:                                                                   │
│   219 │   │   │   raise PromptParameterException(missing_args[0])                                │
│   220 │   │                                                                                      │
│ ❱ 221 │   │   question = create_question_func(**_kwargs)                                         │
│   222 │   │                                                                                      │
│   223 │   │   answer = question.unsafe_ask(patch_stdout)                                         │
│   224                                                                                            │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/questionary/prompts/select.py:185 in select                                            │
│                                                                                                  │
│   182 │   │                                                                                      │
│   183 │   │   return tokens                                                                      │
│   184 │                                                                                          │
│ ❱ 185 │   layout = common.create_inquirer_layout(ic, get_prompt_tokens, **kwargs)                │
│   186 │                                                                                          │
│   187 │   bindings = KeyBindings()                                                               │
│   188                                                                                            │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/questionary/prompts/common.py:513 in create_inquirer_layout                            │
│                                                                                                  │
│   510 │   ps: PromptSession = PromptSession(                                                     │
│   511 │   │   get_prompt_tokens, reserve_space_for_menu=0, **kwargs                              │
│   512 │   )                                                                                      │
│ ❱ 513 │   _fix_unecessary_blank_lines(ps)                                                        │
│   514 │                                                                                          │
│   515 │   validation_prompt: PromptSession = PromptSession(                                      │
│   516 │   │   bottom_toolbar=lambda: ic.error_message, **kwargs                                  │
│                                                                                                  │
│ /Users/mahpa906/Documents/Projects/nf-core-modules-mahesh/.pixi/envs/default/lib/python3.13/site │
│ -packages/questionary/prompts/common.py:493 in _fix_unecessary_blank_lines                       │
│                                                                                                  │
│   490 │   default_container = ps.layout.container                                                │
│   491 │                                                                                          │
│   492 │   default_buffer_window = (                                                              │
│ ❱ 493 │   │   default_container.get_children()[0].content.get_children()[1].content  # type: i   │
│   494 │   )                                                                                      │
│   495 │                                                                                          │
│   496 │   assert isinstance(default_buffer_window, Window)                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'VSplit' object has no attribute 'content'
System information

Pixi version: 0.68.0
Nextflow version: 26.04.0
Hardware: MacBookPro18,2
Executor: local (default)
OS: Darwin 25.4.0
nf-core/tools: 4.0.2
Python version: 3.13.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at nf_core/main.py, particularly command_modules_test around the traceback location, and reproduce the failure with nf-core modules test krakenuniq/build. Trace the command handling to identify why it emits a stack trace; done means the command completes or reports the problem without an unhandled traceback.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.