New submission from Éric Araujo <mer...@netwok.org>: The PEP 376 implementation in packaging.database has been called ugly and opaque. When discussing PEP 396 for example (that’s why I’m adding Barry and Antoine to nosy, for their feedback), get_distribution(name).metadata['Version'] did not seem to agree with everyone. (Note that there are shortcuts for two metadata fields: name and version also exist as get_distribution(name).name / .version.)
I’m not sure how we can make it less opaque, unless we force people to read documentation: PEP 376 proposes a database of installed distributions; packaging.database offers get_distribution, which returns an object with some attributes. I can’t have an outside view on this, so maybe you can explain what’s opaque and ugly so that we can try to improve it. I’ve found in distutils-sig archives from two or three years ago that people intended to offer a get_metadata function that would take a distribution name (i.e. pyOpenSSL, Babel, flufl.enum) and return a mapping object with the metadata read from the installed dist-info/METADATA file. Does that look better to you? ---------- assignee: tarek components: Distutils2 files: d2-get_metadata.diff keywords: patch messages: 145465 nosy: alexis, barry, eric.araujo, pitrou, tarek priority: normal severity: normal status: open title: Add get_metadata to packaging versions: 3rd party, Python 3.3 Added file: http://bugs.python.org/file23394/d2-get_metadata.diff _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13167> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com