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

Disuse pkg_resources in favor of importlib.metadata #1061

Merged
merged 1 commit into from Sep 3, 2022

Conversation

dairiki
Copy link
Contributor

@dairiki dairiki commented Sep 2, 2022

Pkg_resources is deprecated. Importlib.metadata is the new standard way of dealing with distribution metadata: entry points, versions, etc.

This PR eliminates our usage of pkg_resources in favor of importlib.metadata (or importlib_metadata for python < 3.10 — in this PR we use importlib.metadata.packages_distributions() which is only available in 3.10.)

Issue(s) Resolved

This would have sort of fixed the issue noted in #1058 having to do with the misspelling of a dependency. (The real problem there was the misspelling; however, using the same distribution grokking machinery as python itself uses helps minimize weirdness due to differences in behavior between the import system and the introspection system.)

Related Issues / Links

Description of Changes

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)

Copy link
Contributor

@yagebu yagebu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@yagebu yagebu merged commit ca054a8 into lektor:master Sep 3, 2022
@dairiki dairiki deleted the feature.disuse-pkg_resources branch September 3, 2022 17:04
dairiki added a commit to dairiki/lektor that referenced this pull request Apr 16, 2023
@dairiki dairiki mentioned this pull request Apr 16, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants