Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linting throws an error if hyphens appear in the name #3089

Closed
adamrtalbot opened this issue Jul 31, 2024 · 5 comments
Closed

Linting throws an error if hyphens appear in the name #3089

adamrtalbot opened this issue Jul 31, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@adamrtalbot
Copy link
Contributor

adamrtalbot commented Jul 31, 2024

Description of the bug

When linting a pipeline with a hyphen in the name nf-core pipelines lint throws an error. It shouldn't do this because I can call my pipeline whatever the heck I want.

Command used and terminal output

adamtalbot@vm-adamtalbot:~/wgs-pipeline$ nf-core pipelines lint


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

    nf-core/tools version 2.14.2.dev0 - https://nf-co.re


INFO     Testing pipeline: .                                                                                                                                                                                                                                                                                                                                                                                  
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/adamtalbot/.local/bin/nf-core:8 in <module>                                                │
│                                                                                                  │
│   5 from nf_core.__main__ import run_nf_core                                                     │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(run_nf_core())                                                                  │
│   9                                                                                              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/__main__.py:180 in run_nf_core      │
│                                                                                                  │
│    177 │   │   │   log.debug(f"Could not check latest version: {e}")                             │
│    178 │   │   stderr.print("\n")                                                                │
│    179 │   # Launch the click cli                                                                │
│ ❱  180 │   nf_core_cli(auto_envvar_prefix="NFCORE")                                              │
│    181                                                                                           │
│    182                                                                                           │
│    183 @tui(                                                                                     │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/rich_click/rich_command.py:367 in __call__  │
│                                                                                                  │
│   364 │   │   # Include this here because I run into a false warning                             │
│   365 │   │   # in the PyCharm IDE otherwise; for some reason PyCharm doesn't                    │
│   366 │   │   # seem to think RichGroups are callable. (No issues with Mypy, though.)            │
│ ❱ 367 │   │   return super().__call__(*args, **kwargs)                                           │
│   368                                                                                            │
│   369                                                                                            │
│   370 class RichCommandCollection(CommandCollection, RichGroup):                                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1157 in __call__              │
│                                                                                                  │
│   1154 │                                                                                         │
│   1155 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1156 │   │   """Alias for :meth:`main`."""                                                     │
│ ❱ 1157 │   │   return self.main(*args, **kwargs)                                                 │
│   1158                                                                                           │
│   1159                                                                                           │
│   1160 class Command(BaseCommand):                                                               │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/rich_click/rich_command.py:152 in main      │
│                                                                                                  │
│   149 │   │   try:                                                                               │
│   150 │   │   │   try:                                                                           │
│   151 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                   │
│ ❱ 152 │   │   │   │   │   rv = self.invoke(ctx)                                                  │
│   153 │   │   │   │   │   if not standalone_mode:                                                │
│   154 │   │   │   │   │   │   return rv                                                          │
│   155 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!                                │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1688 in invoke                │
│                                                                                                  │
│   1685 │   │   │   │   super().invoke(ctx)                                                       │
│   1686 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1687 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1688 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1689 │   │                                                                                     │
│   1690 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1691 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1688 in invoke                │
│                                                                                                  │
│   1685 │   │   │   │   super().invoke(ctx)                                                       │
│   1686 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1687 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1688 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1689 │   │                                                                                     │
│   1690 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1691 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1434 in invoke                │
│                                                                                                  │
│   1431 │   │   │   echo(style(message, fg="red"), err=True)                                      │
│   1432 │   │                                                                                     │
│   1433 │   │   if self.callback is not None:                                                     │
│ ❱ 1434 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                │
│   1435 │                                                                                         │
│   1436 │   def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]:  │
│   1437 │   │   """Return a list of completions for the incomplete value. Looks                   │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:783 in invoke                 │
│                                                                                                  │
│    780 │   │                                                                                     │
│    781 │   │   with augment_usage_errors(__self):                                                │
│    782 │   │   │   with ctx:                                                                     │
│ ❱  783 │   │   │   │   return __callback(*args, **kwargs)                                        │
│    784 │                                                                                         │
│    785 │   def forward(                                                                          │
│    786 │   │   __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any  # noqa: B902             │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/decorators.py:33 in new_func          │
│                                                                                                  │
│    30 │   """                                                                                    │
│    31 │                                                                                          │
│    32 │   def new_func(*args: "P.args", **kwargs: "P.kwargs") -> "R":                            │
│ ❱  33 │   │   return f(get_current_context(), *args, **kwargs)                                   │
│    34 │                                                                                          │
│    35 │   return update_wrapper(new_func, f)                                                     │
│    36                                                                                            │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/__main__.py:348 in                  │
│ command_pipelines_lint                                                                           │
│                                                                                                  │
│    345 │   """                                                                                   │
│    346 │   Check pipeline code against nf-core guidelines.                                       │
│    347 │   """                                                                                   │
│ ❱  348 │   pipelines_lint(ctx, dir, release, fix, key, show_passed, fail_ignored, fail_warned,   │
│    349                                                                                           │
│    350                                                                                           │
│    351 # nf-core pipelines download                                                              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/commands_pipelines.py:133 in        │
│ pipelines_lint                                                                                   │
│                                                                                                  │
│   130 │                                                                                          │
│   131 │   # Run the lint tests!                                                                  │
│   132 │   try:                                                                                   │
│ ❱ 133 │   │   lint_obj, module_lint_obj, subworkflow_lint_obj = run_linting(                     │
│   134 │   │   │   dir,                                                                           │
│   135 │   │   │   release,                                                                       │
│   136 │   │   │   fix,                                                                           │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/__init__.py:603 in   │
│ run_linting                                                                                      │
│                                                                                                  │
│   600 │                                                                                          │
│   601 │   # Run the pipeline linting tests                                                       │
│   602 │   try:                                                                                   │
│ ❱ 603 │   │   lint_obj._lint_pipeline()                                                          │
│   604 │   except AssertionError as e:                                                            │
│   605 │   │   log.critical(f"Critical error: {e}")                                               │
│   606 │   │   log.info("Stopping tests...")                                                      │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/__init__.py:228 in   │
│ _lint_pipeline                                                                                   │
│                                                                                                  │
│   225 │   │   │   │   │   continue                                                               │
│   226 │   │   │   │   self.progress_bar.update(lint_progress, advance=1, test_name=test_name)    │
│   227 │   │   │   │   log.debug(f"Running lint test: {test_name}")                               │
│ ❱ 228 │   │   │   │   test_results = getattr(self, test_name)()                                  │
│   229 │   │   │   │   for test in test_results.get("passed", []):                                │
│   230 │   │   │   │   │   self.passed.append((test_name, test))                                  │
│   231 │   │   │   │   for test in test_results.get("ignored", []):                               │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/files_unchanged.py:1 │
│ 30 in files_unchanged                                                                            │
│                                                                                                  │
│   127 │   │   yaml.dump(template_yaml, fh, default_flow_style=False)                             │
│   128 │                                                                                          │
│   129 │   test_pipeline_dir = os.path.join(tmp_dir, f"{prefix}-{short_name}")                    │
│ ❱ 130 │   create_obj = nf_core.pipelines.create.create.PipelineCreate(                           │
│   131 │   │   None, None, None, no_git=True, outdir=test_pipeline_dir, template_config=templat   │
│   132 │   )                                                                                      │
│   133 │   create_obj.init_pipeline()                                                             │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/create.py:74 in    │
│ __init__                                                                                         │
│                                                                                                  │
│    71 │   │   │   template_config and (isinstance(template_config, str) or isinstance(template   │
│    72 │   │   ):                                                                                 │
│    73 │   │   │   # Obtain a CreateConfig object from the template yaml file                     │
│ ❱  74 │   │   │   self.config = self.check_template_yaml_info(template_config, name, descripti   │
│    75 │   │   │   self.update_config(organisation, version, force, outdir)                       │
│    76 │   │   else:                                                                              │
│    77 │   │   │   raise UserWarning("The template configuration was not provided.")              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/create.py:138 in   │
│ check_template_yaml_info                                                                         │
│                                                                                                  │
│   135 │   │   │   try:                                                                           │
│   136 │   │   │   │   with open(template_yaml) as f:                                             │
│   137 │   │   │   │   │   template_yaml = yaml.safe_load(f)                                      │
│ ❱ 138 │   │   │   │   │   config = CreateConfig(**template_yaml)                                 │
│   139 │   │   │   except FileNotFoundError:                                                      │
│   140 │   │   │   │   raise UserWarning(f"Template YAML file '{template_yaml}' not found.")      │
│   141                                                                                            │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/utils.py:53 in     │
│ __init__                                                                                         │
│                                                                                                  │
│    50 │                                                                                          │
│    51 │   def __init__(self, /, **data: Any) -> None:                                            │
│    52 │   │   """Custom init method to allow using a context on the model initialization."""     │
│ ❱  53 │   │   self.__pydantic_validator__.validate_python(                                       │
│    54 │   │   │   data,                                                                          │
│    55 │   │   │   self_instance=self,                                                            │
│    56 │   │   │   context=_init_context_var.get(),                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValidationError: 1 validation error for CreateConfig
name
  Value error, Must not contain special characters. Only '-' or '_' are allowed. [type=value_error, input_value='wgs-pipeline', input_type=str]


### System information

Using dev build on commit 930ece572bf23b68c7a7c5259e918a878ba6499e
@adamrtalbot adamrtalbot added the bug Something isn't working label Jul 31, 2024
@mashehu
Copy link
Contributor

mashehu commented Jul 31, 2024

what pipeline name did you try?

@mirpedrol
Copy link
Member

Hi @adamrtalbot, hyphens are allowed in custom pipelines, how did you create your pipeline? I tested this behaviour and lining passes for me.
I opened #3094 to also allow numbers, for instance myorg-this-isap1pe_ did work when I tested that PR.

@adamrtalbot
Copy link
Contributor Author

what pipeline name did you try?

wgs-pipeline

Still seeing the error with 930ece5

adamtalbot@vm-adamtalbot:~/wgs-pipeline$ nf-core --verbose pipelines lint


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

    nf-core/tools version 2.14.2.dev0 - https://nf-co.re


DEBUG    Popen(['git', 'cat-file', '--batch-check'], cwd=/home/adamtalbot/wgs-pipeline, stdin=<valid stream>, shell=False, universal_newlines=False)                                                                                                                                                                            cmd.py:1253
DEBUG    Using config file: .nf-core.yml                                                                                                                                                                                                                                                                                          utils.py:1060
DEBUG    Got '.' as path                                                                                                                                                                                                                                                                                                           utils.py:244
DEBUG    Found a config cache, loading: /home/adamtalbot/.nextflow/nf-core/wf-config-cache-ba141f72800c1acee446fad4d.json                                                                                                                                                                                                          utils.py:278
DEBUG    Popen(['git', 'version'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                                                          cmd.py:1253
DEBUG    Popen(['git', 'fetch', '-v', '--progress', '--', 'origin'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                        cmd.py:1253
DEBUG    Popen(['git', 'checkout', 'master'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                                               cmd.py:1253
DEBUG    Popen(['git', 'merge', 'origin/master'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                                           cmd.py:1253
DEBUG    Using config file: /home/adamtalbot/.config/nfcore/nf-core/modules/.nf-core.yml                                                                                                                                                                                                                                          utils.py:1060
DEBUG    Using config file: .nf-core.yml                                                                                                                                                                                                                                                                                          utils.py:1060
DEBUG    The following files were modified by prettier:                                                                                                                                                                                                                                                                        lint_utils.py:88
                                                                                                                                                                                                                                                                                                                                               
         modules.json                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                               
DEBUG    Got '.' as path                                                                                                                                                                                                                                                                                                           utils.py:244
DEBUG    Found a config cache, loading: /home/adamtalbot/.nextflow/nf-core/wf-config-cache-ba141f72800c1acee446fad4d.json                                                                                                                                                                                                          utils.py:278
DEBUG    Registry set to quay.io                                                                                                                                                                                                                                                                                                __init__.py:141
DEBUG    Popen(['git', 'checkout', 'master'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                                               cmd.py:1253
DEBUG    Popen(['git', 'merge', 'origin/master'], cwd=/home/adamtalbot/.config/nfcore/nf-core/modules, stdin=None, shell=False, universal_newlines=False)                                                                                                                                                                           cmd.py:1253
DEBUG    Using config file: /home/adamtalbot/.config/nfcore/nf-core/modules/.nf-core.yml                                                                                                                                                                                                                                          utils.py:1060
DEBUG    Using config file: .nf-core.yml                                                                                                                                                                                                                                                                                          utils.py:1060
DEBUG    The following files were modified by prettier:                                                                                                                                                                                                                                                                        lint_utils.py:88
                                                                                                                                                                                                                                                                                                                                               
         modules.json                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                               
DEBUG    Got '.' as path                                                                                                                                                                                                                                                                                                           utils.py:244
DEBUG    Found a config cache, loading: /home/adamtalbot/.nextflow/nf-core/wf-config-cache-ba141f72800c1acee446fad4d.json                                                                                                                                                                                                          utils.py:278
DEBUG    Registry set to quay.io                                                                                                                                                                                                                                                                                                __init__.py:141
DEBUG    Using config file: .nf-core.yml                                                                                                                                                                                                                                                                                          utils.py:1060
DEBUG    Using config file: .nf-core.yml                                                                                                                                                                                                                                                                                          utils.py:1060
INFO     Testing pipeline: .                                                                                                                                                                                                                                                                                                    __init__.py:164
DEBUG    Running lint test: files_exist                                                                                                                                                                                                                                                                                         __init__.py:227
DEBUG    Found plugins in nextflow.config with value nf-validation                                                                                                                                                                                                                                                           files_exist.py:252
DEBUG    Running lint test: nextflow_config                                                                                                                                                                                                                                                                                     __init__.py:227
DEBUG    JSON file loaded: nextflow_schema.json                                                                                                                                                                                                                                                                                   schema.py:119
DEBUG    Running lint test: files_unchanged                                                                                                                                                                                                                                                                                     __init__.py:227
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/adamtalbot/.local/bin/nf-core:8 in <module>                                                │
│                                                                                                  │
│   5 from nf_core.__main__ import run_nf_core                                                     │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(run_nf_core())                                                                  │
│   9                                                                                              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/__main__.py:180 in run_nf_core      │
│                                                                                                  │
│    177 │   │   │   log.debug(f"Could not check latest version: {e}")                             │
│    178 │   │   stderr.print("\n")                                                                │
│    179 │   # Launch the click cli                                                                │
│ ❱  180 │   nf_core_cli(auto_envvar_prefix="NFCORE")                                              │
│    181                                                                                           │
│    182                                                                                           │
│    183 @tui(                                                                                     │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/rich_click/rich_command.py:367 in __call__  │
│                                                                                                  │
│   364 │   │   # Include this here because I run into a false warning                             │
│   365 │   │   # in the PyCharm IDE otherwise; for some reason PyCharm doesn't                    │
│   366 │   │   # seem to think RichGroups are callable. (No issues with Mypy, though.)            │
│ ❱ 367 │   │   return super().__call__(*args, **kwargs)                                           │
│   368                                                                                            │
│   369                                                                                            │
│   370 class RichCommandCollection(CommandCollection, RichGroup):                                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1157 in __call__              │
│                                                                                                  │
│   1154 │                                                                                         │
│   1155 │   def __call__(self, *args: t.Any, **kwargs: t.Any) -> t.Any:                           │
│   1156 │   │   """Alias for :meth:`main`."""                                                     │
│ ❱ 1157 │   │   return self.main(*args, **kwargs)                                                 │
│   1158                                                                                           │
│   1159                                                                                           │
│   1160 class Command(BaseCommand):                                                               │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/rich_click/rich_command.py:152 in main      │
│                                                                                                  │
│   149 │   │   try:                                                                               │
│   150 │   │   │   try:                                                                           │
│   151 │   │   │   │   with self.make_context(prog_name, args, **extra) as ctx:                   │
│ ❱ 152 │   │   │   │   │   rv = self.invoke(ctx)                                                  │
│   153 │   │   │   │   │   if not standalone_mode:                                                │
│   154 │   │   │   │   │   │   return rv                                                          │
│   155 │   │   │   │   │   # it's not safe to `ctx.exit(rv)` here!                                │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1688 in invoke                │
│                                                                                                  │
│   1685 │   │   │   │   super().invoke(ctx)                                                       │
│   1686 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1687 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1688 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1689 │   │                                                                                     │
│   1690 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1691 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1688 in invoke                │
│                                                                                                  │
│   1685 │   │   │   │   super().invoke(ctx)                                                       │
│   1686 │   │   │   │   sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)                    │
│   1687 │   │   │   │   with sub_ctx:                                                             │
│ ❱ 1688 │   │   │   │   │   return _process_result(sub_ctx.command.invoke(sub_ctx))               │
│   1689 │   │                                                                                     │
│   1690 │   │   # In chain mode we create the contexts step by step, but after the                │
│   1691 │   │   # base command has been invoked.  Because at that point we do not                 │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:1434 in invoke                │
│                                                                                                  │
│   1431 │   │   │   echo(style(message, fg="red"), err=True)                                      │
│   1432 │   │                                                                                     │
│   1433 │   │   if self.callback is not None:                                                     │
│ ❱ 1434 │   │   │   return ctx.invoke(self.callback, **ctx.params)                                │
│   1435 │                                                                                         │
│   1436 │   def shell_complete(self, ctx: Context, incomplete: str) -> t.List["CompletionItem"]:  │
│   1437 │   │   """Return a list of completions for the incomplete value. Looks                   │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/core.py:783 in invoke                 │
│                                                                                                  │
│    780 │   │                                                                                     │
│    781 │   │   with augment_usage_errors(__self):                                                │
│    782 │   │   │   with ctx:                                                                     │
│ ❱  783 │   │   │   │   return __callback(*args, **kwargs)                                        │
│    784 │                                                                                         │
│    785 │   def forward(                                                                          │
│    786 │   │   __self, __cmd: "Command", *args: t.Any, **kwargs: t.Any  # noqa: B902             │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/click/decorators.py:33 in new_func          │
│                                                                                                  │
│    30 │   """                                                                                    │
│    31 │                                                                                          │
│    32 │   def new_func(*args: "P.args", **kwargs: "P.kwargs") -> "R":                            │
│ ❱  33 │   │   return f(get_current_context(), *args, **kwargs)                                   │
│    34 │                                                                                          │
│    35 │   return update_wrapper(new_func, f)                                                     │
│    36                                                                                            │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/__main__.py:348 in                  │
│ command_pipelines_lint                                                                           │
│                                                                                                  │
│    345 │   """                                                                                   │
│    346 │   Check pipeline code against nf-core guidelines.                                       │
│    347 │   """                                                                                   │
│ ❱  348 │   pipelines_lint(ctx, dir, release, fix, key, show_passed, fail_ignored, fail_warned,   │
│    349                                                                                           │
│    350                                                                                           │
│    351 # nf-core pipelines download                                                              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/commands_pipelines.py:133 in        │
│ pipelines_lint                                                                                   │
│                                                                                                  │
│   130 │                                                                                          │
│   131 │   # Run the lint tests!                                                                  │
│   132 │   try:                                                                                   │
│ ❱ 133 │   │   lint_obj, module_lint_obj, subworkflow_lint_obj = run_linting(                     │
│   134 │   │   │   dir,                                                                           │
│   135 │   │   │   release,                                                                       │
│   136 │   │   │   fix,                                                                           │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/__init__.py:603 in   │
│ run_linting                                                                                      │
│                                                                                                  │
│   600 │                                                                                          │
│   601 │   # Run the pipeline linting tests                                                       │
│   602 │   try:                                                                                   │
│ ❱ 603 │   │   lint_obj._lint_pipeline()                                                          │
│   604 │   except AssertionError as e:                                                            │
│   605 │   │   log.critical(f"Critical error: {e}")                                               │
│   606 │   │   log.info("Stopping tests...")                                                      │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/__init__.py:228 in   │
│ _lint_pipeline                                                                                   │
│                                                                                                  │
│   225 │   │   │   │   │   continue                                                               │
│   226 │   │   │   │   self.progress_bar.update(lint_progress, advance=1, test_name=test_name)    │
│   227 │   │   │   │   log.debug(f"Running lint test: {test_name}")                               │
│ ❱ 228 │   │   │   │   test_results = getattr(self, test_name)()                                  │
│   229 │   │   │   │   for test in test_results.get("passed", []):                                │
│   230 │   │   │   │   │   self.passed.append((test_name, test))                                  │
│   231 │   │   │   │   for test in test_results.get("ignored", []):                               │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/lint/files_unchanged.py:1 │
│ 30 in files_unchanged                                                                            │
│                                                                                                  │
│   127 │   │   yaml.dump(template_yaml, fh, default_flow_style=False)                             │
│   128 │                                                                                          │
│   129 │   test_pipeline_dir = os.path.join(tmp_dir, f"{prefix}-{short_name}")                    │
│ ❱ 130 │   create_obj = nf_core.pipelines.create.create.PipelineCreate(                           │
│   131 │   │   None, None, None, no_git=True, outdir=test_pipeline_dir, template_config=templat   │
│   132 │   )                                                                                      │
│   133 │   create_obj.init_pipeline()                                                             │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/create.py:74 in    │
│ __init__                                                                                         │
│                                                                                                  │
│    71 │   │   │   template_config and (isinstance(template_config, str) or isinstance(template   │
│    72 │   │   ):                                                                                 │
│    73 │   │   │   # Obtain a CreateConfig object from the template yaml file                     │
│ ❱  74 │   │   │   self.config = self.check_template_yaml_info(template_config, name, descripti   │
│    75 │   │   │   self.update_config(organisation, version, force, outdir)                       │
│    76 │   │   else:                                                                              │
│    77 │   │   │   raise UserWarning("The template configuration was not provided.")              │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/create.py:145 in   │
│ check_template_yaml_info                                                                         │
│                                                                                                  │
│   142 │   │   │   try:                                                                           │
│   143 │   │   │   │   with open(template_yaml) as f:                                             │
│   144 │   │   │   │   │   template_yaml = yaml.safe_load(f)                                      │
│ ❱ 145 │   │   │   │   │   config = CreateConfig(**template_yaml)                                 │
│   146 │   │   │   except FileNotFoundError:                                                      │
│   147 │   │   │   │   raise UserWarning(f"Template YAML file '{template_yaml}' not found.")      │
│   148                                                                                            │
│                                                                                                  │
│ /home/adamtalbot/.local/lib/python3.10/site-packages/nf_core/pipelines/create/utils.py:53 in     │
│ __init__                                                                                         │
│                                                                                                  │
│    50 │                                                                                          │
│    51 │   def __init__(self, /, **data: Any) -> None:                                            │
│    52 │   │   """Custom init method to allow using a context on the model initialization."""     │
│ ❱  53 │   │   self.__pydantic_validator__.validate_python(                                       │
│    54 │   │   │   data,                                                                          │
│    55 │   │   │   self_instance=self,                                                            │
│    56 │   │   │   context=_init_context_var.get(),                                               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ValidationError: 1 validation error for CreateConfig
name
  Value error, Must not contain special characters. Only '-' or '_' are allowed. [type=value_error, input_value='wgs-pipeline', input_type=str]
    For further information visit https://errors.pydantic.dev/2.8/v/value_error

@adamrtalbot
Copy link
Contributor Author

Hmm might not be hyphens, let me try something.

@adamrtalbot
Copy link
Contributor Author

Blegh, my bad. Solved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants