Skip to content

Commit

Permalink
DROP: helper/plugin: ignore spec_from_loader() possibly returning None
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke authored and maringuu committed Oct 18, 2023
1 parent ecef321 commit dc6cd94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helperFunctions/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

if TYPE_CHECKING:
from types import ModuleType
from importlib.machinery import ModuleSpec

Check failure on line 14 in src/helperFunctions/plugin.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

src/helperFunctions/plugin.py:14:37: F401 `importlib.machinery.ModuleSpec` imported but unused

Check failure on line 14 in src/helperFunctions/plugin.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (F401)

src/helperFunctions/plugin.py:14:37: F401 `importlib.machinery.ModuleSpec` imported but unused

Check failure on line 14 in src/helperFunctions/plugin.py

View workflow job for this annotation

GitHub Actions / Flake8

src/helperFunctions/plugin.py#L14

'importlib.machinery.ModuleSpec' imported but unused (F401)


def discover_analysis_plugins() -> list[ModuleType]:
Expand All @@ -37,7 +38,7 @@ def _import_plugins(plugin_type) -> list[ModuleType]:
module_name = str(plugin_file).replace('/', '.')[len(src_dir + '/') : -len('.py')]

loader = SourceFileLoader(module_name, str(plugin_file))
spec = importlib.util.spec_from_loader(loader.name, loader)
spec = importlib.util.spec_from_loader(loader.name, loader) # type: ignore[assignment]

Check failure on line 41 in src/helperFunctions/plugin.py

View workflow job for this annotation

GitHub Actions / Flake8

src/helperFunctions/plugin.py#L41

At least two spaces before inline comment (E261)
plugin_module = importlib.util.module_from_spec(spec)

sys.modules[spec.name] = plugin_module
Expand Down

0 comments on commit dc6cd94

Please sign in to comment.