importlib_metadata
importlib_metadata copied to clipboard
Backport of the importlib.metadata module
Motivated by #486. This PR just provides more realistic type annotations[^1] to improve the type checking soundness of the package. It does not solve #486: all the limitations are still...
When 3rd-party `MetaPathFinder` are implemented using `importlib.metadata`, the return types in `importlib_metadata` are not respected, which causes the API to behave in an unexpected way (with unexpected errors). This is...
In GitLab by [@sinoroc](https://gitlab.com/sinoroc) on Feb 23, 2020, 18:34 In the case of a project with a `src`-style directory structure that is installed in _develop_ or _editable_ mode, it is...
I've been asked to implement a meta path hook to provide metadata - see https://github.com/pfmoore/editables/issues/23. I *think* that what I need to do is write a custom `DistributionFinder` subclass which...
Backport of https://github.com/python/cpython/pull/108585. The first commit parameterizes the test example with `parameterized` rather than `hypothesis`, and omits the Hypothesis strategy. The second commit switches back to Hypothesis and includes the...
This should fix #455. I slightly modified the patch suggested by @jaraco in https://github.com/python/importlib_metadata/issues/455#issuecomment-1837571288 so that we don't have to call `self.locate_file('').resolve()` for `name` in `text.splitlines()`, and fixed one type...
In my code, I have type hints which refer to `importlib.metadata`. The corresponding docs at https://docs.python.org/3/library/importlib.metadata.html point to the docs of `importlib_metadata` for the API reference and do not explicitly...
Cross-posting from https://github.com/pypa/setuptools/issues/4170, since I'm not sure which is the right repo to fix this in, or whether both repos have something to consider here: tl;dr: When setuptools does an...
I'm running tests for `importlib_metadata 6.9.0` and I noticed that the following test fails: ``` ____________________ DiscoveryTests.test_package_discovery _____________________ self = def test_package_discovery(self): dists = list(distributions()) > assert all(isinstance(dist, Distribution) for...
> Should `Distribution` objects expose a method to resolve paths? Yes, that is one solution. There is already `.locate_file()` which is not far off, except that its implementation in `PathDistribution`...