Comments (12)
In GitLab by @warsaw on May 23, 2018, 21:03
Do you think it should live on the loader or on the finder? I was thinking the latter, but given that importlib.resources
uses the loader, maybe that makes more sense for consistency.
We definitely need an extensibility layer a la importlib.resources
because currently, the implementation is only compatible with file system distributions (i.e. not zips). See this issue for some related discussion.
I think we should do this before the first release.
from importlib_metadata.
In GitLab by @jaraco on Jul 22, 2018, 18:57
Do you think it should live on the loader or on the finder?
I hadn't thought about it much before today. And I'm not sure even after thinking about it for over an hour that I have more insight than I did before. I think the crux of the question is - does a finder have enough context to determine if the metadata is present? It seems to me since a PathFinder is relevant for both SourceFileLoader and ZipFileLoader, but package metadata is going to need to be loaded differently based on those two loaders. That leads me to think that it's the loader that will be the designator for how metadata is loaded.
Plus, that's how it was done in pkg_resources.
@warsaw, What is it about finders that leads you to think they would be the key designator?
from importlib_metadata.
In GitLab by @jaraco on Jul 22, 2018, 19:25
The more I think about it, the less I think the finder/loader mechanism is the right approach. The resolution of the Distribution needs to happen at a layer even before finders. Just like how pkg_resources would allow for get_provider(moduleOrReq)
(ref), this package needs to present a way to solicit new distribution finders, such that when a package is "installed" through something like pyinstaller, it doesn't matter how the module was installed/found/loaded - what matters is how to load metadata for that module's Distribution (e.g. it doesn't matter how pkg_resources
was loaded but where setuptools==40.0.0
has metadata), which is independent of how the modules are found/loaded.
pkg_resources
managed this lookup with the working_set
and the require
logic (which would traverse the system for installed Distributions).
On a related note, I think what this implies is that the Distribution.from_name is the one (and only) place that another installer would need to register its hook.
Hmm. Okay, now I think I see why the finder might be the right place... because it's visible and searchable before any finding or loading is done.
from importlib_metadata.
In GitLab by @jaraco on Sep 3, 2018, 22:10
mentioned in commit 8b53276
from importlib_metadata.
In GitLab by @jaraco on Sep 3, 2018, 22:10
mentioned in commit 74e40e2
from importlib_metadata.
In GitLab by @jaraco on Sep 3, 2018, 22:10
mentioned in commit ad4636b
from importlib_metadata.
In GitLab by @jaraco on Sep 3, 2018, 22:19
mentioned in merge request !2
from importlib_metadata.
In GitLab by @warsaw on Sep 4, 2018, 21:37
mentioned in merge request !3
from importlib_metadata.
In GitLab by @jaraco on Sep 8, 2018, 02:55
closed via merge request !2
from importlib_metadata.
In GitLab by @jaraco on Sep 8, 2018, 02:55
closed via commit ad4636b
from importlib_metadata.
In GitLab by @jaraco on Sep 8, 2018, 02:55
closed via commit 8b53276
from importlib_metadata.
In GitLab by @jaraco on Sep 8, 2018, 02:55
mentioned in commit 08f79d7
from importlib_metadata.
Related Issues (20)
- Raise if multiple `dist-info` folders for same dist exist HOT 3
- Create a Github Security Policy file HOT 3
- PathDistribution normalized name ignores name components after first "-" HOT 6
- Provide a 'diagnose' routine to help users inspect broken environments HOT 1
- ContextualVersionConflict error on jupyter notebook HOT 1
- pypy test has started failing HOT 12
- Rely on zipfile.Path (where viable) HOT 1
- Backport docs changes HOT 1
- Invalid annotation in `SimplePath` protocol HOT 2
- Change build backend to flit-core? HOT 1
- 6.8.0: pytest is failing in tests/test_api.py::APITests::test_prefix_not_matched` unit HOT 3
- PackageNotFoundError No package metadata was found for <myproject> HOT 1
- Question: parsing package names & versions from METADATA file instead of dist-info directory HOT 1
- Provide a helper for "is distribution present" HOT 2
- Mypy tests failing on Windows only HOT 1
- 6.9.0: `DiscoveryTests.test_package_discovery` fails HOT 6
- distributions() finds two packages for editable installs HOT 2
- MetadataPathFinder has `find_distributions` as a classmethod in CPython HOT 1
- Intersphinx mapping for stdlib version
- API incompatibility with `importlib.metadata` (or at least the API is not type-safe?)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from importlib_metadata.