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

Rewrite modules create repo type check. #1391

Merged
merged 9 commits into from
Mar 2, 2022
Merged

Conversation

ewels
Copy link
Member

@ewels ewels commented Feb 1, 2022

As discussed on Slack, it's a fairly frequent problem for users to struggle with creating modules due to:

  • not running in the root repo directory
  • the automatic detection of repo type not working (eg. custom repos for modules)
  • the automatic detection breaking / not working (eg. when we added a main.nf to nf-core/modules)

Here I've introduced more explicit declaration of the repo type:

  • Use .nf-core.yml file if we can find it, with repository_type key
  • Traverse parent directories to look for this file, reset target directory if found (so that we can run from a nested directory)
  • Add command line --repo-type flag to specify repo type if no .nf-core.yml file available

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

ewels added 2 commits February 1, 2022 14:00
* Use .nf-core.yml file if we can find it, with 'repository_type' key
* Traverse parent directories to look for this file, reset target directory if found
* Add flag to specify if no .nf-core.yml file available
@ewels ewels requested review from grst and drpatelh February 1, 2022 13:39
Copy link
Member

@grst grst left a comment

Choose a reason for hiding this comment

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

Do we also need to update the pipeline template to add the repository_type flag?

We will definitely need to add this to the modules repo I think.

nf_core/modules/create.py Outdated Show resolved Hide resolved
nf_core/modules/create.py Outdated Show resolved Hide resolved
nf_core/modules/create.py Outdated Show resolved Hide resolved
@ewels
Copy link
Member Author

ewels commented Feb 1, 2022

@grst I did the pipeline template in this PR already: #1391

Yeah I was going to do nf-core/modules after this is merged, but I can make the PR now.

@ewels
Copy link
Member Author

ewels commented Feb 1, 2022

oof, tests were failing because the repo type check function had been copied + pasted at some point, so there were two copies of it with the same name. Condensed to one, hopefully should all work now 🤞🏻

@codecov

This comment has been minimized.

@ewels ewels merged commit 389729c into nf-core:dev Mar 2, 2022
@ewels ewels deleted the modules-create-type branch March 2, 2022 09:33
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