Skip to content

Commit

Permalink
fix: ignore no-untyped-call in importlib_metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Danyal-Faheem committed Jan 12, 2024
1 parent 67ebe8f commit 0eeafbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tutor/plugins/v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def __init__(self, entrypoint: EntryPoint) -> None:
super().__init__(entrypoint.name, entrypoint)

def _load_obj(self) -> None:
self.obj = self.loader.load()
self.obj = self.loader.load() # type: ignore[no-untyped-call]

def _version(self) -> t.Optional[str]:
if not self.loader.dist:
Expand All @@ -260,7 +260,7 @@ def _version(self) -> t.Optional[str]:

@classmethod
def discover_all(cls) -> None:
entrypoints = entry_points().select(group=cls.ENTRYPOINT)
entrypoints = entry_points().select(group=cls.ENTRYPOINT) # type: ignore[no-untyped-call]
for entrypoint in entrypoints:
try:
error: t.Optional[str] = None
Expand Down
8 changes: 4 additions & 4 deletions tutor/plugins/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
from glob import glob

from importlib_metadata import entry_points
from importlib_metadata import entry_points, EntryPoint

from tutor import hooks

Expand All @@ -26,7 +26,7 @@ def _discover_entrypoint_plugins() -> None:
"""
with hooks.Contexts.PLUGINS.enter():
if "TUTOR_IGNORE_ENTRYPOINT_PLUGINS" not in os.environ:
for entrypoint in entry_points().select(group='tutor.plugin.v1'):
for entrypoint in entry_points().select(group='tutor.plugin.v1'): # type: ignore[no-untyped-call]
discover_package(entrypoint)


Expand Down Expand Up @@ -56,7 +56,7 @@ def load(plugin_name: str) -> None:
spec.loader.exec_module(module)


def discover_package(entrypoint) -> None:
def discover_package(entrypoint: EntryPoint) -> None:
"""
Install a plugin from a python package.
"""
Expand All @@ -75,4 +75,4 @@ def discover_package(entrypoint) -> None:
@hooks.Actions.PLUGIN_LOADED.add()
def load(plugin_name: str) -> None:
if name == plugin_name:
entrypoint.load()
entrypoint.load() # type: ignore[no-untyped-call]

0 comments on commit 0eeafbc

Please sign in to comment.