-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
According to https://setuptools.pypa.io/en/latest/pkg_resources.html, pkg_resources
is deprecated in favour of importlib.metadata
. Unfortunately, though, the semantics of the entry_points()
function changed in Python 3.10. So once support for Pythons 3.8 and 3.9 is dropped in python-lsp-black
, this could be migrated to the preferred importlib.metadata
tools. (One could have a conditional for Python >= 3.10 in the meantime, but that would be ugly.)
Here is a patch that should work on Python 3.10+:
--- a/tests/test_plugin.py
+++ b/tests/test_plugin.py
@@ -2,10 +2,10 @@
import types
from pathlib import Path
from unittest.mock import Mock
+from importlib.metadata import entry_points
# Third-party imports
import black
-import pkg_resources
import pytest
# Python LSP imports
@@ -321,8 +321,7 @@
def test_entry_point():
- distribution = pkg_resources.get_distribution("python-lsp-black")
- entry_point = distribution.get_entry_info("pylsp", "black")
+ (entry_point,) = entry_points(group="pylsp", name="black")
assert entry_point is not None
Metadata
Metadata
Assignees
Labels
No labels