Skip to content
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

Update ruff rules to ignore unused imports in __init__.py files #177

Merged
merged 3 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading