Rewrite the logic to resolve package-relative paths so we can remove the "asset" library #247
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.
Currently we use the
asset
library in exactly one place to figure out the path to a file inside an installed module. Theasset
library is GPL licensed and brings with it a few more GPL dependencies. As pyhocon is Apache licensed, this causes issues for pyhocon users that cannot include software with strong copyleft licenses like the GPL.Also, it introduces a lot of transitive dependencies:
Without
asset
, this would be reduced toIn this PR I re-implemented the functionality of the
asset.load()
function so we can avoid using theasset
library in the first place.The implementation is really basic, because it relies on
imp.find_module
from the standard library. I would have preferred to useimportlib.util.find_spec
, but it's not available in Python 2.7. I also added a bunch of tests (the previous test was pretty much non-functional because it mocked the result ofasset.load
).Solves #234