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

Requires importlib_metadata>=4.6 for tests #1127

Merged
merged 1 commit into from
Jun 13, 2024
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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ test = [
"pytest-flakes",
"sympy",
"vcrpy>=1.6.1",
"importlib_metadata>=4.6; python_version<'3.10'",
]
dev = [
"doc8",
Expand Down
10 changes: 8 additions & 2 deletions tests/test_extensions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
from importlib.metadata import entry_points
from sys import version_info

if version_info >= (3, 10):
# 'group' keyword argument was introduced in 3.10
from importlib.metadata import entry_points
else:
from importlib_metadata import entry_points # type: ignore[assignment,no-redef,import-not-found]

from subliminal.extensions import (
RegistrableExtensionManager,
Expand Down Expand Up @@ -64,7 +70,7 @@ def test_registrable_extension_manager_unregister():


def test_provider_manager():
setup_names = {ep.name for ep in entry_points() if ep.group == provider_manager.namespace}
setup_names = {ep.name for ep in entry_points(group=provider_manager.namespace)}
internal_names = {
parse_entry_point(iep, provider_manager.namespace).name for iep in provider_manager.internal_extensions
}
Expand Down