Skip to content

Commit

Permalink
Migrate to importlib entrypoints instead of using pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-russell committed Apr 25, 2024
1 parent b482ff3 commit a88e61c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Binary file modified .coverage
Binary file not shown.
8 changes: 3 additions & 5 deletions clicz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import functools
import inspect
import sys
from importlib.metadata import entry_points

import pkg_resources
import yaml

COLORS = {
Expand Down Expand Up @@ -311,10 +311,8 @@ def get_invocation_args(parsed_args):

method.get_invocation_args = get_invocation_args

def load_plugins(
self,
):
plugins = pkg_resources.iter_entry_points(self.cli_module)
def load_plugins(self):
plugins = entry_points(group=self.cli_module)
for entry_point in plugins:
controller_module = entry_point.load()
controller = getattr(controller_module, "Controller")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "clicz"
version = "0.0.2"
version = "0.0.3"
description = ""
authors = ["Mo Balaa <balaa@fractalnetworks.co>"]
readme = "README.md"
Expand Down

0 comments on commit a88e61c

Please sign in to comment.