Replace pkg_resources version lookup#142
Draft
Mirochill wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the PR
Fixes #141.
This replaces the top-level
pkg_resourcesversion lookup withimportlib.metadata, which is available in the standard library for the project's supported Python versions. ThePackageNotFoundErrorfallback keeps the previous behavior for source trees that are not installed as a package.The same replacement is applied to the remaining first-party
pkg_resourcesusages intests/simple_jump_process.pyandnotebooks/Stochasticity.ipynb, so the repository no longer importspkg_resourcesdirectly.Checks
This is an itemised checklist for the QA process within UKHSA and represents the bare minimum a QA should be.
To the reviewer: Check the boxes once you have completed the checks below.
This is a basic form of Smoke Testing
Data and security
Sensible
Documentation
How this PR addresses the contribution requirements
pkg_resourcesis no longer available with newer setuptools releases, and this import currently happens at package import time.Stochasticity.ipynbnotebook import snippet was updated to avoidpkg_resources.git diff --checkgit diff --cached --checkgit diff --check HEAD~1..HEADrg -n pkg_resources|get_distribution|DistributionNotFound .