Skip to content

Commit

Permalink
Merge pull request #1706 from fabianegli/unused-imports
Browse files Browse the repository at this point in the history
Remove unused imports
  • Loading branch information
ErikDanielsson authored Jul 28, 2022
2 parents 3ddb12d + eb4e378 commit 3c22ebb
Show file tree
Hide file tree
Showing 27 changed files with 17 additions and 71 deletions.
2 changes: 0 additions & 2 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion nf_core/bump_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import logging
import os
import re
import sys

import rich.console

Expand Down
1 change: 0 additions & 1 deletion nf_core/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion nf_core/licences.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import json
import logging
import os
import re

import requests
import rich.console
Expand Down
1 change: 0 additions & 1 deletion nf_core/lint/actions_schema_validation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python

import glob
import json
import logging
import os

Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/modules_json.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/schema_description.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from logging import warn

import nf_core.schema


Expand Down
2 changes: 0 additions & 2 deletions nf_core/lint/schema_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import logging

import jsonschema

import nf_core.schema


Expand Down
1 change: 0 additions & 1 deletion nf_core/modules/bump_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from __future__ import print_function

import logging
import os
import re

import questionary
Expand Down
3 changes: 1 addition & 2 deletions nf_core/modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

import questionary
import requests
import yaml
from rich import box
from rich.console import Group
Expand All @@ -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__)

Expand Down
1 change: 0 additions & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions nf_core/modules/lint/meta_yml.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from operator import imod

import yaml


Expand Down
3 changes: 0 additions & 3 deletions nf_core/modules/lint/module_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"""
import os

import requests
import rich


def module_changes(module_lint_object, module):
"""
Expand Down
5 changes: 0 additions & 5 deletions nf_core/modules/lint/module_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions nf_core/refgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/lint/files_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import os

import yaml

import nf_core.lint


Expand Down
4 changes: 0 additions & 4 deletions tests/lint/files_unchanged.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import os
import shutil
import tempfile

import pytest

import nf_core.lint

Expand Down
2 changes: 0 additions & 2 deletions tests/lint/merge_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import os

import yaml

import nf_core.lint


Expand Down
3 changes: 0 additions & 3 deletions tests/lint/modules_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import nf_core.lint


def test_modules_json_pass(self):
self.lint_obj._load()
results = self.lint_obj.modules_json()
Expand Down
7 changes: 0 additions & 7 deletions tests/lint/nextflow_config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import os
import shutil
import tempfile
import unittest

import pytest

import nf_core.create
import nf_core.lint

Expand Down
2 changes: 0 additions & 2 deletions tests/modules/lint.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import json

import nf_core.modules


Expand Down
1 change: 0 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
""" Tests covering the command-line code.
"""

import unittest
from unittest import mock

from click.testing import CliRunner
Expand Down
1 change: 0 additions & 1 deletion tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import json
import os
import shutil
import tempfile
import unittest
from unittest import mock
Expand Down
20 changes: 10 additions & 10 deletions tests/test_licenses.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 0 additions & 4 deletions tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/test_refgenie.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import tempfile
import unittest

import nf_core.refgenie


class TestRefgenie(unittest.TestCase):
"""Class for refgenie tests"""
Expand Down
1 change: 0 additions & 1 deletion tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import unittest
from unittest import mock

import click
import pytest
import requests
import yaml
Expand Down

0 comments on commit 3c22ebb

Please sign in to comment.