AnalogJ/lexicon

RFE: Replace use of `pkg_resources` with `importlib.metadata`

kloczek opened this issue · 2 comments

See discussions:
astropy/astropy#11091
pypa/pip#7413

[tkloczko@devel-g2v lexicon-3.11.0]$ grep -r pkg_resources
lexicon/discovery.py:import pkg_resources
lexicon/discovery.py:        distribution = pkg_resources.get_distribution("dns-lexicon")
lexicon/discovery.py:    except pkg_resources.DistributionNotFound:
lexicon/discovery.py:        return pkg_resources.get_distribution("dns-lexicon").version
lexicon/discovery.py:    except pkg_resources.DistributionNotFound:
lexicon/discovery.py:    provider: str, distribution: pkg_resources.Distribution
lexicon/discovery.py:        requirements: List[pkg_resources.Requirement] = distribution.requires(
lexicon/discovery.py:    except pkg_resources.UnknownExtra:
lexicon/discovery.py:                    pkg_resources.get_distribution(requirement.name)  # type: ignore
lexicon/discovery.py:                    pkg_resources.get_distribution(requirement)
lexicon/discovery.py:        except (pkg_resources.DistributionNotFound, pkg_resources.VersionConflict):
t:| * 90642ca - (origin/fix-provider-disco-legacy, jamin/fix-provider-disco-legacy, giuse/fix-provider-disco-legacy) Support old versions of pkg_resources (2 years, 10 months ago) <Adrien Ferrand>

Just in case .. pkg_resources is part of setuptools and even if currently lexicon is using poetry still setuptools is needed.

Thanks a lot. I made the change.