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

Replace setuptools/pkg_resources with importlib(.|_)metadata #384

Closed
bollwyvl opened this issue May 22, 2023 · 2 comments · Fixed by #385
Closed

Replace setuptools/pkg_resources with importlib(.|_)metadata #384

bollwyvl opened this issue May 22, 2023 · 2 comments · Fixed by #385
Assignees
Milestone

Comments

@bollwyvl
Copy link
Contributor

Warnings about pkg_resources are getting increasingly loud downstream (e.g. in tests). It's likely time to consider moving to the stdlib importlib.resources, or the backport on not-broken-by-default systems, and removing the setuptools runtime dependency.

Proposed changes:

# pyproject.toml
dependencies = [
  # - "setuptools>=39.0.0",
  "importlib_metadata>=4.8.3;python_version<\"3.10\"",
  # ...
]
# pylsp/config/config.py

# ...

# See compatibility note on `group` keyword in https://docs.python.org/3/library/importlib.metadata.html#entry-points
if sys.version_info < (3, 10):  # pragma: no cover
    from importlib_metadata import entry_points
else:  # pragma: no cover
    from importlib.metadata import entry_points

# ...
    # - for entry_point in pkg_resources.iter_entry_points(PYLSP):
    for entry_point in entry_points(group=PYLSP):
@ccordoba12
Copy link
Member

Looks good to me @bollwyvl. Please go ahead with a PR for it.

@bollwyvl
Copy link
Contributor Author

#385 is up 🚀 ... sheepishly haven't tested locally 😊

@ccordoba12 ccordoba12 added this to the v1.7.4 milestone Jun 29, 2023
@ccordoba12 ccordoba12 modified the milestones: v1.7.4, v1.8.0 Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants