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

No informative error when missing param in manifest when nf-core schema build #2876

Closed
toniher opened this issue Mar 19, 2024 · 1 comment
Closed
Assignees
Labels
bug Something isn't working

Comments

@toniher
Copy link

toniher commented Mar 19, 2024

Description of the bug

If the maninfest in nextflow.config is missing name parameter (likely description as well), nf-core schema build fails not very informatively...

│ /home/toniher/.pyenv/versions/3.11.8/envs/fa-nf/lib/python3.11/site-packages/nf_core/schema.py:5 │
│ 89 in make_skeleton_schema                                                                       │
│                                                                                                  │
│   586 │   │   )                                                                                  │
│   587 │   │   schema_template = env.get_template("nextflow_schema.json")                         │
│   588 │   │   template_vars = {                                                                  │
│ ❱ 589 │   │   │   "name": self.pipeline_manifest.get("name", Path(self.schema_filename).parent   │
│   590 │   │   │   "description": self.pipeline_manifest.get("description", "").strip("'"),       │
│   591 │   │   }                                                                                  │
│   592 │   │   self.schema = json.loads(schema_template.render(template_vars))                    │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'PosixPath' object has no attribute 'strip'

Command used and terminal output

nf-core schema build

System information

  • Linux (Ubuntu 23.10)
  • nf-core 2.13.1
  • Python 3.11.8
@toniher toniher added the bug Something isn't working label Mar 19, 2024
@awgymer
Copy link
Contributor

awgymer commented Mar 19, 2024

Untested code go brrrrr...

This is fixed easily enough by converting the path object to a string first. Wondering if we need some kind of indication we are using a fallback value for the workflow name though 🤔

Seems like we've had this logic for some time though so might be fine.

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

2 participants