diff --git a/nf_core/__main__.py b/nf_core/__main__.py index 1568c66cbd..bac3f3ebea 100755 --- a/nf_core/__main__.py +++ b/nf_core/__main__.py @@ -2,9 +2,7 @@ """ nf-core: Helper tools for use with nf-core Nextflow pipelines. """ import logging import os -import re import sys -from email.policy import default import rich.console import rich.logging diff --git a/nf_core/bump_version.py b/nf_core/bump_version.py index 277a49300b..53766678b0 100644 --- a/nf_core/bump_version.py +++ b/nf_core/bump_version.py @@ -6,7 +6,6 @@ import logging import os import re -import sys import rich.console diff --git a/nf_core/launch.py b/nf_core/launch.py index 45d4cb3efc..064eee7306 100644 --- a/nf_core/launch.py +++ b/nf_core/launch.py @@ -12,7 +12,6 @@ import webbrowser import questionary -import requests from rich.console import Console from rich.markdown import Markdown from rich.prompt import Confirm diff --git a/nf_core/licences.py b/nf_core/licences.py index bc001f32d2..2fa208481f 100644 --- a/nf_core/licences.py +++ b/nf_core/licences.py @@ -6,7 +6,6 @@ import json import logging import os -import re import requests import rich.console diff --git a/nf_core/lint/actions_schema_validation.py b/nf_core/lint/actions_schema_validation.py index 103e545a43..8197ec2362 100644 --- a/nf_core/lint/actions_schema_validation.py +++ b/nf_core/lint/actions_schema_validation.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import glob -import json import logging import os diff --git a/nf_core/lint/modules_json.py b/nf_core/lint/modules_json.py index 1152acac9e..43c1f93c9f 100644 --- a/nf_core/lint/modules_json.py +++ b/nf_core/lint/modules_json.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -from logging import warn - from nf_core.modules.modules_command import ModuleCommand from nf_core.modules.modules_json import ModulesJson diff --git a/nf_core/lint/schema_description.py b/nf_core/lint/schema_description.py index ccf78f3c62..3a670e5f70 100644 --- a/nf_core/lint/schema_description.py +++ b/nf_core/lint/schema_description.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -from logging import warn - import nf_core.schema diff --git a/nf_core/lint/schema_lint.py b/nf_core/lint/schema_lint.py index d2d6afef7e..f7c1b11048 100644 --- a/nf_core/lint/schema_lint.py +++ b/nf_core/lint/schema_lint.py @@ -2,8 +2,6 @@ import logging -import jsonschema - import nf_core.schema diff --git a/nf_core/modules/bump_versions.py b/nf_core/modules/bump_versions.py index 72f4a1ac52..0d7826009e 100644 --- a/nf_core/modules/bump_versions.py +++ b/nf_core/modules/bump_versions.py @@ -7,7 +7,6 @@ from __future__ import print_function import logging -import os import re import questionary diff --git a/nf_core/modules/info.py b/nf_core/modules/info.py index 3a374e72fd..83ed2a0882 100644 --- a/nf_core/modules/info.py +++ b/nf_core/modules/info.py @@ -2,7 +2,6 @@ import os import questionary -import requests import yaml from rich import box from rich.console import Group @@ -15,7 +14,7 @@ from .module_utils import get_repo_type from .modules_command import ModuleCommand -from .modules_repo import NF_CORE_MODULES_REMOTE, ModulesRepo +from .modules_repo import NF_CORE_MODULES_REMOTE log = logging.getLogger(__name__) diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index ee069743b2..4f9dc2ad3b 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -7,7 +7,6 @@ import re import requests -from galaxy.tool_util.deps.mulled.util import build_target import nf_core import nf_core.modules.module_utils diff --git a/nf_core/modules/lint/meta_yml.py b/nf_core/modules/lint/meta_yml.py index 87597efbd5..620d6c8982 100644 --- a/nf_core/modules/lint/meta_yml.py +++ b/nf_core/modules/lint/meta_yml.py @@ -1,7 +1,5 @@ #!/usr/bin/env python -from operator import imod - import yaml diff --git a/nf_core/modules/lint/module_changes.py b/nf_core/modules/lint/module_changes.py index 2ee89102aa..3be9d0a638 100644 --- a/nf_core/modules/lint/module_changes.py +++ b/nf_core/modules/lint/module_changes.py @@ -3,9 +3,6 @@ """ import os -import requests -import rich - def module_changes(module_lint_object, module): """ diff --git a/nf_core/modules/lint/module_version.py b/nf_core/modules/lint/module_version.py index ed834a4792..a5886f6022 100644 --- a/nf_core/modules/lint/module_version.py +++ b/nf_core/modules/lint/module_version.py @@ -3,13 +3,8 @@ Verify that a module has a correct entry in the modules.json file """ -import json import logging import os -import re -import sys - -import questionary import nf_core import nf_core.modules.module_utils diff --git a/nf_core/refgenie.py b/nf_core/refgenie.py index d9275b6cfd..3cf0858d18 100644 --- a/nf_core/refgenie.py +++ b/nf_core/refgenie.py @@ -9,14 +9,14 @@ from pathlib import Path from textwrap import dedent -# import refgenconf -from warnings import warn - import rich -from rich.logging import RichHandler +import rich.traceback import nf_core.utils +# import refgenconf + + # Set up logging log = logging.getLogger(__name__) log.setLevel(logging.INFO) @@ -53,7 +53,7 @@ def _print_nf_config(rgc): pth = rgc.seek(genome, asset) # Catch general exception instead of refgencof exception --> no refgenconf import needed except Exception as e: - log.warn(f"{genome}/{asset} is incomplete, ignoring...") + log.warning(f"{genome}/{asset} is incomplete, ignoring...") else: genomes_str += f' {asset.ljust(20, " ")} = "{pth}"\n' genomes_str += " }\n" @@ -150,7 +150,7 @@ def update_config(rgc): fh.write(refgenie_genomes) log.info(f"Updated nf-core genomes config: {refgenie_genomes_config_file}") except FileNotFoundError as e: - log.warn(f"Could not write to {refgenie_genomes_config_file}") + log.warning(f"Could not write to {refgenie_genomes_config_file}") return False # Add include statement to NXF_HOME/config diff --git a/tests/lint/files_exist.py b/tests/lint/files_exist.py index 1fc03b0154..02686e9add 100644 --- a/tests/lint/files_exist.py +++ b/tests/lint/files_exist.py @@ -2,8 +2,6 @@ import os -import yaml - import nf_core.lint diff --git a/tests/lint/files_unchanged.py b/tests/lint/files_unchanged.py index 41949cb37a..84aec50c26 100644 --- a/tests/lint/files_unchanged.py +++ b/tests/lint/files_unchanged.py @@ -1,8 +1,4 @@ import os -import shutil -import tempfile - -import pytest import nf_core.lint diff --git a/tests/lint/merge_markers.py b/tests/lint/merge_markers.py index 23d5f52a0d..6ea2882417 100644 --- a/tests/lint/merge_markers.py +++ b/tests/lint/merge_markers.py @@ -2,8 +2,6 @@ import os -import yaml - import nf_core.lint diff --git a/tests/lint/modules_json.py b/tests/lint/modules_json.py index 2ed33d9015..f025daa7f1 100644 --- a/tests/lint/modules_json.py +++ b/tests/lint/modules_json.py @@ -1,6 +1,3 @@ -import nf_core.lint - - def test_modules_json_pass(self): self.lint_obj._load() results = self.lint_obj.modules_json() diff --git a/tests/lint/nextflow_config.py b/tests/lint/nextflow_config.py index 68e746a5c3..f53765dce9 100644 --- a/tests/lint/nextflow_config.py +++ b/tests/lint/nextflow_config.py @@ -1,10 +1,3 @@ -import os -import shutil -import tempfile -import unittest - -import pytest - import nf_core.create import nf_core.lint diff --git a/tests/modules/lint.py b/tests/modules/lint.py index bcd3571838..0f60377d5e 100644 --- a/tests/modules/lint.py +++ b/tests/modules/lint.py @@ -1,5 +1,3 @@ -import json - import nf_core.modules diff --git a/tests/test_cli.py b/tests/test_cli.py index be1c300a1a..a98fe8a407 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,7 +2,6 @@ """ Tests covering the command-line code. """ -import unittest from unittest import mock from click.testing import CliRunner diff --git a/tests/test_launch.py b/tests/test_launch.py index f3b1d469be..cee4365d2e 100644 --- a/tests/test_launch.py +++ b/tests/test_launch.py @@ -4,7 +4,6 @@ import json import os -import shutil import tempfile import unittest from unittest import mock diff --git a/tests/test_licenses.py b/tests/test_licenses.py index 0cbead8482..a2dde1639b 100644 --- a/tests/test_licenses.py +++ b/tests/test_licenses.py @@ -1,16 +1,16 @@ #!/usr/bin/env python """Some tests covering the pipeline creation sub command. """ -import json -import os -import tempfile -import unittest - -import pytest -from rich.console import Console - -import nf_core.create -import nf_core.licences +# import json +# import os +# import tempfile +# import unittest +# +# import pytest +# from rich.console import Console +# +# import nf_core.create +# import nf_core.licences # TODO nf-core: Assess and strip out if no longer required for DSL2 diff --git a/tests/test_lint.py b/tests/test_lint.py index b7275c8c4b..a23f0212c7 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -5,13 +5,9 @@ import json import os import shutil -import subprocess import tempfile import unittest -from unittest import mock -import pytest -import requests import yaml import nf_core.create diff --git a/tests/test_refgenie.py b/tests/test_refgenie.py index f406cd362e..9314b44eef 100644 --- a/tests/test_refgenie.py +++ b/tests/test_refgenie.py @@ -8,8 +8,6 @@ import tempfile import unittest -import nf_core.refgenie - class TestRefgenie(unittest.TestCase): """Class for refgenie tests""" diff --git a/tests/test_schema.py b/tests/test_schema.py index c605c37b2f..87ff9fb682 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -9,7 +9,6 @@ import unittest from unittest import mock -import click import pytest import requests import yaml