From d2c5400877b2458a9c7faeef183f553cd64f05d9 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 28 Nov 2023 14:17:14 +0100 Subject: [PATCH 1/5] add mypy to pre-commit config, fix mypy errors --- .pre-commit-config.yaml | 10 +++++ docs/api/_src/conf.py | 5 ++- mypy.ini | 1 + nf_core/__main__.py | 56 +++++++++++++-------------- nf_core/params_file.py | 2 +- nf_core/subworkflows/lint/__init__.py | 12 +++--- pyproject.toml | 5 --- requirements-dev.txt | 1 + tests/test_lint.py | 20 +++++----- 9 files changed, 58 insertions(+), 54 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b7aeeb5bc9..578d17f769 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,3 +11,13 @@ repos: rev: "v2.7.1" hooks: - id: prettier + - repo: https://github.com/pre-commit/mirrors-mypy + rev: "v1.7.1" # Use the sha / tag you want to point at + hooks: + - id: mypy + additional_dependencies: + - types-PyYAML + - types-requests + - types-jsonschema + - types-Markdown + - types-setuptools diff --git a/docs/api/_src/conf.py b/docs/api/_src/conf.py index 4d8ae661d5..27eaf9bcb3 100644 --- a/docs/api/_src/conf.py +++ b/docs/api/_src/conf.py @@ -14,6 +14,7 @@ # import os import sys +from typing import Dict sys.path.insert(0, os.path.abspath("../../../nf_core")) import nf_core @@ -58,7 +59,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language: str = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -113,7 +114,7 @@ # -- Options for LaTeX output ------------------------------------------------ -latex_elements = { +latex_elements: Dict[str, str] = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', diff --git a/mypy.ini b/mypy.ini index f869fa7e47..c48aa5884b 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,2 +1,3 @@ [mypy] warn_unused_configs = True +ignore_missing_imports = true diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 232f1bf116..ec5ddeeaa8 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -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="") @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,9 +553,9 @@ 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. """ @@ -563,11 +563,11 @@ def list(ctx): # nf-core modules list remote -@list.command() +@modules_list.command("remote") @click.pass_context @click.argument("keywords", required=False, nargs=-1, metavar="") @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="") @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 """ 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=" or ") @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="", 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=" or ") @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=" or ") @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=" or ") @click.option("-d", "--dir", type=click.Path(exists=True), default=".", metavar="") @@ -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=" or ") @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,9 +1093,9 @@ 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. """ @@ -1105,7 +1103,7 @@ def list(ctx): # nf-core subworkflows list remote -@list.command() +@subworkflows_list.command("remote") @click.pass_context @click.argument("keywords", required=False, nargs=-1, metavar="") @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="") @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="") @@ -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="" ) -def lint(schema_path): +def schema_lint(schema_path): """ Check that a given pipeline schema is valid. diff --git a/nf_core/params_file.py b/nf_core/params_file.py index 39986b95c2..5c50c53fb9 100644 --- a/nf_core/params_file.py +++ b/nf_core/params_file.py @@ -89,7 +89,7 @@ def __init__( self, pipeline=None, revision=None, - ): + ) -> None: """Initialise the ParamFileBuilder class Args: diff --git a/nf_core/subworkflows/lint/__init__.py b/nf_core/subworkflows/lint/__init__.py index 44c7c21a37..ffba41f9da 100644 --- a/nf_core/subworkflows/lint/__init__.py +++ b/nf_core/subworkflows/lint/__init__.py @@ -29,12 +29,12 @@ class SubworkflowLint(ComponentLint): """ # Import lint functions - from .main_nf import main_nf - from .meta_yml import meta_yml - from .subworkflow_changes import subworkflow_changes - from .subworkflow_tests import subworkflow_tests - from .subworkflow_todos import subworkflow_todos - from .subworkflow_version import subworkflow_version + from .main_nf import main_nf # type: ignore[misc] + from .meta_yml import meta_yml # type: ignore[misc] + from .subworkflow_changes import subworkflow_changes # type: ignore[misc] + from .subworkflow_tests import subworkflow_tests # type: ignore[misc] + from .subworkflow_todos import subworkflow_todos # type: ignore[misc] + from .subworkflow_version import subworkflow_version # type: ignore[misc] def __init__( self, diff --git a/pyproject.toml b/pyproject.toml index f0702742fd..2380073107 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,8 +20,3 @@ norecursedirs = [ ".*", "build", "dist", "*.egg", "data", "__pycache__", ".githu profile = "black" known_first_party = ["nf_core"] multi_line_output = 3 - -[tool.mypy] -ignore_missing_imports = true -follow_imports = "skip" -disable_error_code = "no-redef" diff --git a/requirements-dev.txt b/requirements-dev.txt index 12183eb98c..3ef0593085 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,3 +11,4 @@ types-PyYAML types-requests types-jsonschema types-Markdown +types-setuptools diff --git a/tests/test_lint.py b/tests/test_lint.py index 67104e3ad0..69917b279d 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -178,44 +178,44 @@ def test_sphinx_md_files(self): ####################### # SPECIFIC LINT TESTS # ####################### - from .lint.actions_awsfulltest import ( + from .lint.actions_awsfulltest import ( # type: ignore[misc] test_actions_awsfulltest_fail, test_actions_awsfulltest_pass, test_actions_awsfulltest_warn, ) - from .lint.actions_awstest import ( + from .lint.actions_awstest import ( # type: ignore[misc] test_actions_awstest_fail, test_actions_awstest_pass, ) - from .lint.actions_ci import ( + from .lint.actions_ci import ( # type: ignore[misc] test_actions_ci_fail_wrong_nf, test_actions_ci_fail_wrong_trigger, test_actions_ci_pass, ) - from .lint.actions_schema_validation import ( + from .lint.actions_schema_validation import ( # type: ignore[misc] test_actions_schema_validation_fails_for_additional_property, test_actions_schema_validation_missing_jobs, test_actions_schema_validation_missing_on, ) - from .lint.files_exist import ( + from .lint.files_exist import ( # type: ignore[misc] test_files_exist_depreciated_file, test_files_exist_missing_config, test_files_exist_missing_main, test_files_exist_pass, ) - from .lint.files_unchanged import ( + from .lint.files_unchanged import ( # type: ignore[misc] test_files_unchanged_fail, test_files_unchanged_pass, ) - from .lint.merge_markers import test_merge_markers_found - from .lint.modules_json import test_modules_json_pass - from .lint.nextflow_config import ( + from .lint.merge_markers import test_merge_markers_found # type: ignore[misc] + from .lint.modules_json import test_modules_json_pass # type: ignore[misc] + from .lint.nextflow_config import ( # type: ignore[misc] test_nextflow_config_bad_name_fail, test_nextflow_config_dev_in_release_mode_failed, test_nextflow_config_example_pass, test_nextflow_config_missing_test_profile_failed, ) - from .lint.version_consistency import test_version_consistency + from .lint.version_consistency import test_version_consistency # type: ignore[misc] # TODO nf-core: Assess and strip out if no longer required for DSL2 From b442d50adc5ec9b87ca045eb23dca4be5b5d9212 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 28 Nov 2023 15:01:11 +0100 Subject: [PATCH 2/5] use same naming for modules and subworkflo commands --- nf_core/__main__.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nf_core/__main__.py b/nf_core/__main__.py index ec5ddeeaa8..43095bc194 100644 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -1107,7 +1107,7 @@ def subworkflows_list(ctx): @click.pass_context @click.argument("keywords", required=False, nargs=-1, metavar="") @click.option("-j", "--json", is_flag=True, help="Print as JSON to stdout") -def remote(ctx, keywords, json): +def subworkflows_list_remote(ctx, keywords, json): """ List subworkflows in a remote GitHub repo [dim i](e.g [link=https://github.com/nf-core/modules]nf-core/modules[/])[/]. """ @@ -1140,7 +1140,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 subworkflows_list_local(ctx, keywords, json, dir): # pylint: disable=redefined-builtin """ List subworkflows installed locally in a pipeline """ @@ -1229,7 +1229,7 @@ def subworkflows_lint(ctx, subworkflow, dir, registry, key, all, fail_warned, lo # nf-core subworkflows info -@subworkflows.command() +@subworkflows.command("info") @click.pass_context @click.argument("tool", type=str, required=False, metavar="subworkflow name") @click.option( @@ -1239,7 +1239,7 @@ def subworkflows_lint(ctx, subworkflow, dir, registry, key, all, fail_warned, lo default=".", help=r"Pipeline directory. [dim]\[default: Current working directory][/]", ) -def info(ctx, tool, dir): +def subworkflows_info(ctx, tool, dir): """ Show developer usage information about a given subworkflow. @@ -1268,7 +1268,7 @@ def info(ctx, tool, dir): # nf-core subworkflows install -@subworkflows.command() +@subworkflows.command("install") @click.pass_context @click.argument("subworkflow", type=str, required=False, metavar="subworkflow name") @click.option( @@ -1283,7 +1283,7 @@ def info(ctx, tool, dir): "-f", "--force", is_flag=True, default=False, help="Force reinstallation of subworkflow if it already exists" ) @click.option("-s", "--sha", type=str, metavar="", help="Install subworkflow at commit SHA") -def install(ctx, subworkflow, dir, prompt, force, sha): +def subworkflows_install(ctx, subworkflow, dir, prompt, force, sha): """ Install DSL2 subworkflow within a pipeline. @@ -1310,7 +1310,7 @@ def install(ctx, subworkflow, dir, prompt, force, sha): # nf-core subworkflows remove -@subworkflows.command() +@subworkflows.command("remove") @click.pass_context @click.argument("subworkflow", type=str, required=False, metavar="subworkflow name") @click.option( @@ -1320,7 +1320,7 @@ def install(ctx, subworkflow, dir, prompt, force, sha): default=".", help=r"Pipeline directory. [dim]\[default: current working directory][/]", ) -def remove(ctx, dir, subworkflow): +def subworkflows_remove(ctx, dir, subworkflow): """ Remove a subworkflow from a pipeline. """ @@ -1340,7 +1340,7 @@ def remove(ctx, dir, subworkflow): # nf-core subworkflows update -@subworkflows.command() +@subworkflows.command("update") @click.pass_context @click.argument("subworkflow", type=str, required=False, metavar="subworkflow name") @click.option( @@ -1378,7 +1378,7 @@ def remove(ctx, dir, subworkflow): default=False, help="Automatically update all linked modules and subworkflows without asking for confirmation", ) -def update(ctx, subworkflow, dir, force, prompt, sha, install_all, preview, save_diff, update_deps): +def subworkflows_update(ctx, subworkflow, dir, force, prompt, sha, install_all, preview, save_diff, update_deps): """ Update DSL2 subworkflow within a pipeline. @@ -1392,7 +1392,7 @@ def update(ctx, subworkflow, dir, force, prompt, sha, install_all, preview, save force, prompt, sha, - all, + install_all, preview, save_diff, update_deps, From ed8efbcea8e0b13d508c9229c82fc8412a3acc63 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 28 Nov 2023 15:53:34 +0100 Subject: [PATCH 3/5] update github checkout and setup-python --- .github/workflows/create-lint-wf.yml | 4 ++-- .../workflows/create-test-lint-wf-template.yml | 4 ++-- .github/workflows/create-test-wf.yml | 2 +- .github/workflows/deploy-pypi.yml | 2 +- .github/workflows/fix-linting.yml | 4 ++-- .github/workflows/lint-code.yml | 16 ++++++++-------- .github/workflows/push_dockerhub_dev.yml | 2 +- .github/workflows/push_dockerhub_release.yml | 2 +- .github/workflows/pytest.yml | 2 +- .github/workflows/rich-codex.yml | 2 +- .github/workflows/sync.yml | 4 ++-- .github/workflows/tools-api-docs-dev.yml | 2 +- .github/workflows/tools-api-docs-release.yml | 2 +- CHANGELOG.md | 1 + .../pipeline-template/.github/workflows/ci.yml | 2 +- .../.github/workflows/fix-linting.yml | 4 ++-- .../.github/workflows/linting.yml | 12 ++++++------ 17 files changed, 34 insertions(+), 33 deletions(-) diff --git a/.github/workflows/create-lint-wf.yml b/.github/workflows/create-lint-wf.yml index d5f377a486..51daec21b7 100644 --- a/.github/workflows/create-lint-wf.yml +++ b/.github/workflows/create-lint-wf.yml @@ -27,7 +27,7 @@ jobs: - "latest-everything" steps: # Get the repo code - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out source-code repository # Set up nf-core/tools @@ -48,7 +48,7 @@ jobs: version: ${{ matrix.NXF_VER }} # Install the Prettier linting tools - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier diff --git a/.github/workflows/create-test-lint-wf-template.yml b/.github/workflows/create-test-lint-wf-template.yml index 5ce9b41118..f1c6c4d149 100644 --- a/.github/workflows/create-test-lint-wf-template.yml +++ b/.github/workflows/create-test-lint-wf-template.yml @@ -33,7 +33,7 @@ jobs: - "template_skip_nf_core_configs.yml" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out source-code repository - name: Set up Python 3.12 @@ -52,7 +52,7 @@ jobs: version: latest-everything # Install the Prettier linting tools - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier diff --git a/.github/workflows/create-test-wf.yml b/.github/workflows/create-test-wf.yml index d96518d7c6..4f66adae6b 100644 --- a/.github/workflows/create-test-wf.yml +++ b/.github/workflows/create-test-wf.yml @@ -26,7 +26,7 @@ jobs: - "23.04.0" - "latest-everything" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out source-code repository - name: Set up Python 3.12 diff --git a/.github/workflows/deploy-pypi.yml b/.github/workflows/deploy-pypi.yml index 9b46f0731b..b847df9218 100644 --- a/.github/workflows/deploy-pypi.yml +++ b/.github/workflows/deploy-pypi.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out source-code repository - name: Set up Python 3.12 diff --git a/.github/workflows/fix-linting.yml b/.github/workflows/fix-linting.yml index f56cb927fc..a6cf149569 100644 --- a/.github/workflows/fix-linting.yml +++ b/.github/workflows/fix-linting.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: # Use the @nf-core-bot token to check out so we can push later - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.nf_core_bot_auth_token }} @@ -24,7 +24,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier @prettier/plugin-php diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index a951230a6a..baaaedcb4a 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -16,9 +16,9 @@ jobs: EditorConfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install editorconfig-checker run: npm install -g editorconfig-checker @@ -30,9 +30,9 @@ jobs: Prettier: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier @@ -43,7 +43,7 @@ jobs: PythonBlack: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check code lints with Black uses: psf/black@stable @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out source-code repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.12 uses: actions/setup-python@v4 @@ -89,8 +89,8 @@ jobs: static-type-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: 3.12 cache: "pip" diff --git a/.github/workflows/push_dockerhub_dev.yml b/.github/workflows/push_dockerhub_dev.yml index dea28cdd35..169a917d83 100644 --- a/.github/workflows/push_dockerhub_dev.yml +++ b/.github/workflows/push_dockerhub_dev.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build nfcore/tools:dev docker image run: docker build --no-cache . -t nfcore/tools:dev diff --git a/.github/workflows/push_dockerhub_release.yml b/.github/workflows/push_dockerhub_release.yml index 857b241022..49ce17dd84 100644 --- a/.github/workflows/push_dockerhub_release.yml +++ b/.github/workflows/push_dockerhub_release.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build nfcore/tools:latest docker image run: docker build --no-cache . -t nfcore/tools:latest diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 0fc7f3d094..be9942dd16 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -34,7 +34,7 @@ jobs: - runner: "ubuntu-20.04" python-version: "3.8" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out source-code repository - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/rich-codex.yml b/.github/workflows/rich-codex.yml index 54aaf240df..8368255390 100644 --- a/.github/workflows/rich-codex.yml +++ b/.github/workflows/rich-codex.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 5e7719973f..b8fb287944 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -36,10 +36,10 @@ jobs: matrix: ${{fromJson(needs.get-pipelines.outputs.matrix)}} fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out nf-core/tools - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 name: Check out nf-core/${{ matrix.pipeline }} with: repository: nf-core/${{ matrix.pipeline }} diff --git a/.github/workflows/tools-api-docs-dev.yml b/.github/workflows/tools-api-docs-dev.yml index 3a4725a944..7de8913e03 100644 --- a/.github/workflows/tools-api-docs-dev.yml +++ b/.github/workflows/tools-api-docs-dev.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Check out source-code repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.12 uses: actions/setup-python@v4 diff --git a/.github/workflows/tools-api-docs-release.yml b/.github/workflows/tools-api-docs-release.yml index 8a6eda1318..412784c233 100644 --- a/.github/workflows/tools-api-docs-release.yml +++ b/.github/workflows/tools-api-docs-release.yml @@ -19,7 +19,7 @@ jobs: - ${{ github.event.release.tag_name }} steps: - name: Check out source-code repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python 3.12 uses: actions/setup-python@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ae69fc7ab..0ab328866f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Change testing framework for modules and subworkflows from pytest to nf-test ([#2490](https://github.com/nf-core/tools/pull/2490)) - `bump_version` keeps now the indentation level of the updated version entries ([#2514](https://github.com/nf-core/tools/pull/2514)) - Run tests with Python 3.12 ([#2522](https://github.com/nf-core/tools/pull/2522)). +- Add mypy to pre-commit config for the tools repo ([#2545](https://github.com/nf-core/tools/pull/2545)) # [v2.10 - Nickel Ostrich](https://github.com/nf-core/tools/releases/tag/2.10) + [2023-09-25] diff --git a/nf_core/pipeline-template/.github/workflows/ci.yml b/nf_core/pipeline-template/.github/workflows/ci.yml index 521f3e664a..3edd49f09d 100644 --- a/nf_core/pipeline-template/.github/workflows/ci.yml +++ b/nf_core/pipeline-template/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - "latest-everything" steps: - name: Check out pipeline code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Nextflow uses: nf-core/setup-nextflow@v1 diff --git a/nf_core/pipeline-template/.github/workflows/fix-linting.yml b/nf_core/pipeline-template/.github/workflows/fix-linting.yml index f3dc3e50fe..31e8cd2b36 100644 --- a/nf_core/pipeline-template/.github/workflows/fix-linting.yml +++ b/nf_core/pipeline-template/.github/workflows/fix-linting.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: # Use the @nf-core-bot token to check out so we can push later - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.nf_core_bot_auth_token }} @@ -24,7 +24,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier @prettier/plugin-php diff --git a/nf_core/pipeline-template/.github/workflows/linting.yml b/nf_core/pipeline-template/.github/workflows/linting.yml index edce89065f..64d1851f2e 100644 --- a/nf_core/pipeline-template/.github/workflows/linting.yml +++ b/nf_core/pipeline-template/.github/workflows/linting.yml @@ -14,9 +14,9 @@ jobs: EditorConfig: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install editorconfig-checker run: npm install -g editorconfig-checker @@ -27,9 +27,9 @@ jobs: Prettier: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 - name: Install Prettier run: npm install -g prettier @@ -40,7 +40,7 @@ jobs: PythonBlack: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check code lints with Black uses: psf/black@stable @@ -71,7 +71,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out pipeline code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Nextflow uses: nf-core/setup-nextflow@v1 From ae505c46cd271582c50aa956bfbc9449222bcab4 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 28 Nov 2023 16:01:22 +0100 Subject: [PATCH 4/5] =?UTF-8?q?switch=20to=20self-hosted=20=F0=9F=A4=9E?= =?UTF-8?q?=F0=9F=8F=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 03d5bc65e5..b6edac5182 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -57,7 +57,7 @@ jobs: test: needs: setup if: ${{ needs.setup.outputs.run-tests == 'true' }} - runs-on: ${{ needs.setup.outputs.runner }} + runs-on: ["self-hosted"] steps: - uses: actions/checkout@v2 name: Check out source-code repository From 1ad27a7eb955a13dcc5dc53ab576be94c7429126 Mon Sep 17 00:00:00 2001 From: mashehu Date: Tue, 28 Nov 2023 16:05:26 +0100 Subject: [PATCH 5/5] =?UTF-8?q?Revert=20"switch=20to=20self-hosted=20?= =?UTF-8?q?=F0=9F=A4=9E=F0=9F=8F=BB"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ae505c46cd271582c50aa956bfbc9449222bcab4. --- .github/workflows/pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index b6edac5182..03d5bc65e5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -57,7 +57,7 @@ jobs: test: needs: setup if: ${{ needs.setup.outputs.run-tests == 'true' }} - runs-on: ["self-hosted"] + runs-on: ${{ needs.setup.outputs.runner }} steps: - uses: actions/checkout@v2 name: Check out source-code repository