-
Notifications
You must be signed in to change notification settings - Fork 192
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
add mypy to pre-commit config, fix mypy errors #2545
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d2c5400
add mypy to pre-commit config, fix mypy errors
mashehu b442d50
use same naming for modules and subworkflo commands
mashehu ed8efbc
update github checkout and setup-python
mashehu 6d7ab36
Merge branch 'dev' of github.com:nf-core/tools into add-mypy-to-pre-c…
mashehu ae505c4
switch to self-hosted 🤞🏻
mashehu 1ad27a7
Revert "switch to self-hosted 🤞🏻"
mashehu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[mypy] | ||
warn_unused_configs = True | ||
ignore_missing_imports = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,7 +151,7 @@ def nf_core_cli(ctx, verbose, hide_progress, log_file): | |
|
||
|
||
# nf-core list | ||
@nf_core_cli.command() | ||
@nf_core_cli.command("list") | ||
@click.argument("keywords", required=False, nargs=-1, metavar="<filter keywords>") | ||
@click.option( | ||
"-s", | ||
|
@@ -162,7 +162,7 @@ def nf_core_cli(ctx, verbose, hide_progress, log_file): | |
) | ||
@click.option("--json", is_flag=True, default=False, help="Print full output as JSON") | ||
@click.option("--show-archived", is_flag=True, default=False, help="Print archived workflows") | ||
def list(keywords, sort, json, show_archived): | ||
def list_pipelines(keywords, sort, json, show_archived): | ||
""" | ||
List available nf-core pipelines with local info. | ||
|
||
|
@@ -553,21 +553,21 @@ def subworkflows(ctx, git_remote, branch, no_pull): | |
|
||
|
||
# nf-core modules list subcommands | ||
@modules.group() | ||
@modules.group("list") | ||
@click.pass_context | ||
def list(ctx): | ||
def modules_list(ctx): | ||
""" | ||
List modules in a local pipeline or remote repository. | ||
""" | ||
pass | ||
|
||
|
||
# nf-core modules list remote | ||
@list.command() | ||
@modules_list.command("remote") | ||
@click.pass_context | ||
@click.argument("keywords", required=False, nargs=-1, metavar="<filter keywords>") | ||
@click.option("-j", "--json", is_flag=True, help="Print as JSON to stdout") | ||
def remote(ctx, keywords, json): | ||
def modules_list_remote(ctx, keywords, json): | ||
""" | ||
List modules in a remote GitHub repo [dim i](e.g [link=https://github.com/nf-core/modules]nf-core/modules[/])[/]. | ||
""" | ||
|
@@ -588,7 +588,7 @@ def remote(ctx, keywords, json): | |
|
||
|
||
# nf-core modules list local | ||
@list.command() | ||
@modules_list.command("local") | ||
@click.pass_context | ||
@click.argument("keywords", required=False, nargs=-1, metavar="<filter keywords>") | ||
@click.option("-j", "--json", is_flag=True, help="Print as JSON to stdout") | ||
|
@@ -599,7 +599,7 @@ def remote(ctx, keywords, json): | |
default=".", | ||
help=r"Pipeline directory. [dim]\[default: Current working directory][/]", | ||
) | ||
def local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | ||
def modules_list_local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we do these changes for subworkflows too? |
||
""" | ||
List modules installed locally in a pipeline | ||
""" | ||
|
@@ -620,7 +620,7 @@ def local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | |
|
||
|
||
# nf-core modules install | ||
@modules.command() | ||
@modules.command("install") | ||
@click.pass_context | ||
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>") | ||
@click.option( | ||
|
@@ -633,7 +633,7 @@ def local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | |
@click.option("-p", "--prompt", is_flag=True, default=False, help="Prompt for the version of the module") | ||
@click.option("-f", "--force", is_flag=True, default=False, help="Force reinstallation of module if it already exists") | ||
@click.option("-s", "--sha", type=str, metavar="<commit sha>", help="Install module at commit SHA") | ||
def install(ctx, tool, dir, prompt, force, sha): | ||
def modules_install(ctx, tool, dir, prompt, force, sha): | ||
""" | ||
Install DSL2 modules within a pipeline. | ||
|
||
|
@@ -660,7 +660,7 @@ def install(ctx, tool, dir, prompt, force, sha): | |
|
||
|
||
# nf-core modules update | ||
@modules.command() | ||
@modules.command("update") | ||
@click.pass_context | ||
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>") | ||
@click.option( | ||
|
@@ -699,7 +699,7 @@ def install(ctx, tool, dir, prompt, force, sha): | |
default=False, | ||
help="Automatically update all linked modules and subworkflows without asking for confirmation", | ||
) | ||
def update(ctx, tool, directory, force, prompt, sha, install_all, preview, save_diff, update_deps): | ||
def modules_update(ctx, tool, directory, force, prompt, sha, install_all, preview, save_diff, update_deps): | ||
""" | ||
Update DSL2 modules within a pipeline. | ||
|
||
|
@@ -767,7 +767,7 @@ def patch(ctx, tool, dir, remove): | |
|
||
|
||
# nf-core modules remove | ||
@modules.command() | ||
@modules.command("remove") | ||
@click.pass_context | ||
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>") | ||
@click.option( | ||
|
@@ -777,7 +777,7 @@ def patch(ctx, tool, dir, remove): | |
default=".", | ||
help=r"Pipeline directory. [dim]\[default: current working directory][/]", | ||
) | ||
def remove(ctx, dir, tool): | ||
def modules_remove(ctx, dir, tool): | ||
""" | ||
Remove a module from a pipeline. | ||
""" | ||
|
@@ -887,7 +887,7 @@ def test_module(ctx, tool, dir, no_prompts, update, once): | |
|
||
|
||
# nf-core modules lint | ||
@modules.command() | ||
@modules.command("lint") | ||
@click.pass_context | ||
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>") | ||
@click.option("-d", "--dir", type=click.Path(exists=True), default=".", metavar="<pipeline/modules directory>") | ||
|
@@ -912,9 +912,7 @@ def test_module(ctx, tool, dir, no_prompts, update, once): | |
show_default=True, | ||
) | ||
@click.option("--fix-version", is_flag=True, help="Fix the module version if a newer version is available") | ||
def lint( | ||
ctx, tool, dir, registry, key, all, fail_warned, local, passed, sort_by, fix_version | ||
): # pylint: disable=redefined-outer-name | ||
def modules_lint(ctx, tool, dir, registry, key, all, fail_warned, local, passed, sort_by, fix_version): | ||
""" | ||
Lint one or more modules in a directory. | ||
|
||
|
@@ -959,7 +957,7 @@ def lint( | |
|
||
|
||
# nf-core modules info | ||
@modules.command() | ||
@modules.command("info") | ||
@click.pass_context | ||
@click.argument("tool", type=str, required=False, metavar="<tool> or <tool/subtool>") | ||
@click.option( | ||
|
@@ -969,7 +967,7 @@ def lint( | |
default=".", | ||
help=r"Pipeline directory. [dim]\[default: Current working directory][/]", | ||
) | ||
def info(ctx, tool, dir): | ||
def modules_info(ctx, tool, dir): | ||
""" | ||
Show developer usage information about a given module. | ||
|
||
|
@@ -1095,17 +1093,17 @@ def test_subworkflow(ctx, subworkflow, dir, no_prompts, update, once): | |
|
||
|
||
# nf-core subworkflows list subcommands | ||
@subworkflows.group() | ||
@subworkflows.group("list") | ||
@click.pass_context | ||
def list(ctx): | ||
def subworkflows_list(ctx): | ||
""" | ||
List subworkflows in a local pipeline or remote repository. | ||
""" | ||
pass | ||
|
||
|
||
# nf-core subworkflows list remote | ||
@list.command() | ||
@subworkflows_list.command("remote") | ||
@click.pass_context | ||
@click.argument("keywords", required=False, nargs=-1, metavar="<filter keywords>") | ||
@click.option("-j", "--json", is_flag=True, help="Print as JSON to stdout") | ||
|
@@ -1131,7 +1129,7 @@ def remote(ctx, keywords, json): | |
|
||
|
||
# nf-core subworkflows list local | ||
@list.command() | ||
@subworkflows_list.command("local") | ||
@click.pass_context | ||
@click.argument("keywords", required=False, nargs=-1, metavar="<filter keywords>") | ||
@click.option("-j", "--json", is_flag=True, help="Print as JSON to stdout") | ||
|
@@ -1163,7 +1161,7 @@ def local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | |
|
||
|
||
# nf-core subworkflows lint | ||
@subworkflows.command() | ||
@subworkflows.command("lint") | ||
@click.pass_context | ||
@click.argument("subworkflow", type=str, required=False, metavar="subworkflow name") | ||
@click.option("-d", "--dir", type=click.Path(exists=True), default=".", metavar="<pipeline/modules directory>") | ||
|
@@ -1187,9 +1185,7 @@ def local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin | |
help="Sort lint output by subworkflow or test name.", | ||
show_default=True, | ||
) | ||
def lint( | ||
ctx, subworkflow, dir, registry, key, all, fail_warned, local, passed, sort_by | ||
): # pylint: disable=redefined-outer-name | ||
def subworkflows_lint(ctx, subworkflow, dir, registry, key, all, fail_warned, local, passed, sort_by): | ||
""" | ||
Lint one or more subworkflows in a directory. | ||
|
||
|
@@ -1496,11 +1492,11 @@ def build(dir, no_prompts, web_only, url): | |
|
||
|
||
# nf-core schema lint | ||
@schema.command() | ||
@schema.command("lint") | ||
@click.argument( | ||
"schema_path", type=click.Path(exists=True), default="nextflow_schema.json", metavar="<pipeline schema>" | ||
) | ||
def lint(schema_path): | ||
def schema_lint(schema_path): | ||
""" | ||
Check that a given pipeline schema is valid. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ types-PyYAML | |
types-requests | ||
types-jsonschema | ||
types-Markdown | ||
types-setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we have this in
pyproject.toml
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it felt like it didn't pick it up correctly. let me check again