Skip to content

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

Closed

Description

@bollwyvl

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):

Activity

  1. ccordoba12 commented on May 22, 2023

    @ccordoba12
    Member

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

  2. bollwyvl commented on May 22, 2023

    @bollwyvl
    ContributorAuthor

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

  3. added this to the v1.7.4 milestone on Jun 29, 2023
  4. modified the milestones: v1.7.4, v1.8.0 on Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions