Skip to content

Use importlib.resources rather than setuptools.pkg_resources #275

Open
@jmrgibson

Description

@jmrgibson

Could we change this package to use https://docs.python.org/3/library/importlib.html#importlib.resources.read_text? instead of pkg_resources from setuptools?

I see the following advantages

  1. pip installing setuptools doesn't play nice with tools like https://github.com/jazzband/pip-tools
  2. pkg_resources doesn't work with pyoxidizer https://pyoxidizer.readthedocs.io/en/stable/,
  3. importlib is part of the std library, meaning we have one less dependency (we can't always assume setuptools is going to be available, especially with things like pyinstaller, pyoxidize, etc)

The readme says we need python3.6 or newer, so we should be fine for compatibility, as importlib was added in 3.1.

I'll put up a PR shortly, its a pretty minimal change

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureChanges related to project infrastructure ( CI/CD, deploy mechanism, etc. )proposalThis issue/PR is meant to gather feedback on an idea/change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions