Comments (16)
In GitLab by @jaraco on Sep 15, 2018, 11:47
I'm perfectly okay with those being private interfaces.
from importlib_metadata.
In GitLab by @jaraco on Sep 16, 2018, 03:08
Related to this concern, I opened up #15, which addresses this concern from a different angle. I think the resolution to that issue will provide a clearer answer to this proposal.
from importlib_metadata.
In GitLab by @jaraco on Sep 18, 2018, 12:54
I think we do. After removing the from_module
functionality per #15, I explored removing the distribution
function and its associated public functionality, but there was a test that made me reconsider. This test is demonstrating the value of being able to load arbitrary metadata from the package, perhaps even metadata that hasn't been defined today but will be subsequently.
I think it's fine not to advertise this functionality, and do primarily document the high-level interfaces, but I do think it's reasonable that an application would rely on this functionality. That leads me to believe we should document and support the interface.
from importlib_metadata.
In GitLab by @jaraco on Sep 18, 2018, 12:56
mentioned in merge request !20
from importlib_metadata.
In GitLab by @warsaw on Sep 18, 2018, 17:53
I think what's confusing is that we have conflicting definitions for "metadata". Is it the contents of the dist-info/METADATA
file specifically, or any file within dist-info
? E.g. is dist-info/top_level.txt
"package metadata" or something else?
What are the official PyPA definitions? There are too many PEPs for me to follow :(
We should align on the same definitions, and expose those as the APIs for this package. I'm thinking that "metadata" should be the contents of dist-info/METADATA
(or PKG-INFO
, but let's not go there :) and other files should be the "distribution information". Maybe that means we need a metadata()
function that returns the ConfigParser
instance, and information()
function that returns a named file in the dist-info
directory with convenience functions for things like entry_points.txt
.
I think that also means we should rename Distribution.load_metadata()
to Distribution.load_information()
. Once we expose information(filename)
in the high level API, then I do think we can mostly hide the Distribution
class. The one place we still won't be able to hide it is in the discussion about 3rd party extensions, since they have to implement the abstract method Distribution.load_metadata()
(or in the future? Distribution.load_information()
). That's okay though, we can mention the class in that section, tell authors to derived from it, and just implement that method. We don't need to go into tons of detail.
from importlib_metadata.
In GitLab by @jaraco on Sep 18, 2018, 18:49
What is metadata?
I've been assuming it's everything in dist-info (not just METADATA). I don't know what the PEPs say.
I'm thinking that "metadata" should be the contents of
dist-info/METADATA
Hmm. I'm okay with making that shift. And it does align the names, for clarity.
that means we need a ...
information()
function that returns a named file in thedist-info
directory
I'm not fond of "information". It feels too general. I'm thinking since they're file names and we're returning the text of those files, something like load_file_text()
or load_text_file()
or load_text()
or text()
. That also helps if some future packager puts binary data there (imagine load_binary('logo.png')
or load_binary('pubkey')
).
Can we defer this change for 0.6 so we can cut a release with the merged/pending changes?
from importlib_metadata.
In GitLab by @warsaw on Sep 19, 2018, 14:30
In importlib_resources
we have read_text() and read_binary(). While the APIs are different, I think it makes sense to be consistent with naming.
I don't know if this is true, but are all the text files inside dist_info/
guaranteed to be UTF-8? If so, then we don't need as complex an API here, but we can still call the functions read_text()
and if needed in the future, read_binary()
. Let's call YAGNI for now on the open_*()
alternatives.
from importlib_metadata.
In GitLab by @jaraco on Sep 19, 2018, 16:56
are all the text files inside
dist_info/
guaranteed to be UTF-8?
I don't know, but I'm happy to assume that's the case until we encounter a spec that indicates otherwise.
I like read_text()
.
from importlib_metadata.
In GitLab by @jaraco on Sep 20, 2018, 03:05
mentioned in commit 10080a4969f468fa5f77f9a8b178e0c60e0aa9f7
from importlib_metadata.
In GitLab by @jaraco on Sep 20, 2018, 03:08
mentioned in commit 3f211f033925023368357818532866e1976a7be4
from importlib_metadata.
In GitLab by @jaraco on Sep 20, 2018, 03:08
mentioned in commit ffa8373ae37285249913eb75bb6c5fdd69a5d1b5
from importlib_metadata.
In GitLab by @jaraco on Sep 20, 2018, 03:10
mentioned in merge request !23
from importlib_metadata.
In GitLab by @jaraco on Oct 7, 2018, 13:48
mentioned in commit 7f4cda8
from importlib_metadata.
In GitLab by @jaraco on Oct 7, 2018, 13:48
mentioned in commit 6f946ea
from importlib_metadata.
In GitLab by @jaraco on Oct 7, 2018, 13:57
closed via commit 7f4cda8
from importlib_metadata.
In GitLab by @jaraco on Oct 7, 2018, 13:57
closed via merge request !23
from importlib_metadata.
Related Issues (20)
- 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?)
- AttributeError changed to AssertionError for invalid identifiers
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.