Skip to content

Commit

Permalink
Merge pull request #1475 from p-l-/fix-py39
Browse files Browse the repository at this point in the history
Fix IVRE w/ Python 3.9 (at least)
  • Loading branch information
p-l- committed Jan 16, 2023
2 parents f7066f0 + f3d592f commit 5f67435
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/mongodb.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of IVRE.
# Copyright 2011 - 2022 Pierre LALET <pierre@droids-corp.org>
# Copyright 2011 - 2023 Pierre LALET <pierre@droids-corp.org>
#
# IVRE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
Expand All @@ -25,7 +25,7 @@ jobs:
fail-fast: false
matrix:
# https://docs.mongodb.com/drivers/pymongo/#compatibility
python-version: ['3.7', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
mongodb-version: ['3.6', '5.0']

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tinydb.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of IVRE.
# Copyright 2011 - 2022 Pierre LALET <pierre@droids-corp.org>
# Copyright 2011 - 2023 Pierre LALET <pierre@droids-corp.org>
#
# IVRE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
Expand All @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.11']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

steps:

Expand Down
7 changes: 6 additions & 1 deletion ivre/tools/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ def list_plugins() -> Optional[Dict[str, List[Tuple[str, Optional[str]]]]]:
return None
modules: Dict[str, Set[str]] = {}
for category in ["view"]:
for entry_point in entry_points(group=f"ivre.plugins.{category}"):
group = f"ivre.plugins.{category}"
try:
my_entry_points = entry_points(group=group)
except TypeError:
my_entry_points = entry_points().get(group, []) # type: ignore
for entry_point in my_entry_points:
modules.setdefault(category, set()).add(entry_point.module)
return {
category: sorted((module, get_version(module)) for module in sorted(modules))
Expand Down
6 changes: 5 additions & 1 deletion ivre/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@


def load_plugins():
for entry_point in entry_points(group="ivre.plugins.view"):
try:
my_entry_points = entry_points(group="ivre.plugins.view")
except TypeError:
my_entry_points = entry_points().get("ivre.plugins.view", [])
for entry_point in my_entry_points:
if entry_point.name.startswith("_install_"):
entry_point.load()(globals())

Expand Down

0 comments on commit 5f67435

Please sign in to comment.