Skip to content

Commit

Permalink
Merge pull request #177 from NPLinker/update_ruff_rules
Browse files Browse the repository at this point in the history
Update ruff rules to ignore unused imports in `__init__.py` files
  • Loading branch information
CunliangGeng authored Nov 3, 2023
2 parents 82aa01a + 48e795e commit 4016a64
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ ignore = [

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "I"]
ignore-init-module-imports = true


[tool.ruff.isort]
known-first-party = ["nplinker"]
Expand Down
11 changes: 11 additions & 0 deletions src/nplinker/genomics/mibig/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import logging
from .mibig_downloader import download_and_extract_mibig_metadata
from .mibig_loader import MibigLoader
from .mibig_loader import parse_bgc_metadata_json
from .mibig_metadata import MibigMetadata


logging.getLogger(__name__).addHandler(logging.NullHandler())

__all__ = [
"download_and_extract_mibig_metadata",
"MibigLoader",
"MibigMetadata",
"parse_bgc_metadata_json",
]
14 changes: 5 additions & 9 deletions tests/genomics/test_bigscape_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,8 @@ def test_get_gcfs_without_mibig_only(self, loader):
assert isinstance(gcfs[0], GCF)

def test_parse_gcf(self, loader):
gcf_dict = BigscapeGCFLoader._parse_gcf(loader.cluster_file) # noqa
assert isinstance(gcf_dict, dict)
assert len(gcf_dict) == 114
gcf = gcf_dict["135"]
assert isinstance(gcf, GCF)
assert len(gcf.bgc_ids) == 4
assert gcf.bgc_ids == set(
("BGC0000145", "BGC0001041", "NC_009380.1.region004", "NZ_AZWK01000002.region002")
)
gcf_list = BigscapeGCFLoader._parse_gcf(loader.cluster_file) # noqa
assert isinstance(gcf_list, list)
assert len(gcf_list) == 114
for gcf in gcf_list:
assert isinstance(gcf, GCF)

0 comments on commit 4016a64

Please sign in to comment.