You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
According to https://setuptools.pypa.io/en/latest/pkg_resources.html,
pkg_resources
is deprecated in favour ofimportlib.metadata
. Unfortunately, though, the semantics of theentry_points()
function changed in Python 3.10. So once support for Pythons 3.8 and 3.9 is dropped inpython-lsp-black
, this could be migrated to the preferredimportlib.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+:
The text was updated successfully, but these errors were encountered: