This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年01月10日 17:45 by tarek, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| get_metadata.diff | tarek, 2009年01月14日 21:02 | |||
| Messages (14) | |||
|---|---|---|---|
| msg79562 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月10日 17:45 | |
Let's add a "get_metadata" API in Distutils that would return
in a dictionary the content of the .egg-info file introduced into Python
2.5.
>>> from distutils import get_metadata
>>> get_metadata('ThePackage')
{..}
(Working on a prototype)
|
|||
| msg79612 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月11日 19:07 | |
It looks like the best way to do this is to: - make distutils.dist.DistributionMetadata also read existing egg-info files - add get_metadata in pkgutil instead of distutils, and make it use distutils.dist.DistributionMetadata |
|||
| msg79636 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月11日 23:52 | |
heres a first simple draft, that works on .egg-info files, (the Description extractor needs to rework, but this patch is enough to discuss the feature) |
|||
| msg79676 - (view) | Author: Ray (rayterrill) | Date: 2009年01月12日 14:28 | |
The patch didn't install correctly using 'patch', but I manually merged the changes into my environment (Ubuntu 8.10 running 2.5.2) - I'll upload the diff rejections if they'll be helpful. After installing, I attempted to use the new code to determine the version number, and am receiving 'None' as my result. After looking through the code, I believe its looking for a '.egg-info' file, but my custom package doesn't have one (it was installed using 'easy_install' - easy_install -z <package_name>), so it looks like that info is instead stored in EGG_INFO/PKG-INFO within the egg itself. Here's a dir dump of my installed egg: my_package-1.0-py2.5.egg/ |-- EGG-INFO | |-- PKG-INFO | |-- SOURCES.txt | |-- dependency_links.txt | |-- top_level.txt | `-- zip-safe |-- my_package.py `-- my_package.pyc |
|||
| msg79677 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月12日 14:34 | |
yes the patch doesn't treat the eggs installed with easy_install yet, just plain distutils I'll let you know when EGG_INFO/PKG-INFO is ready (should be in the coming days) |
|||
| msg79679 - (view) | Author: Ray (rayterrill) | Date: 2009年01月12日 14:53 | |
I've tested it out using the straight distutils installation, and it works great! |
|||
| msg79718 - (view) | Author: Andi Albrecht (aalbrecht) * | Date: 2009年01月13日 05:15 | |
Is it intended that when reading PKG-INFO files the PEP 314 attributes (provides, requires, obsoletes) are only set if version is exactly "1.1"? I'd expected that those attributes are available regardless of the metadata version of the parsed file (with None as default for PKG-INFO files < 1.1). |
|||
| msg79876 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月14日 21:04 | |
I have improved the patch (uploaded here) (some cases are not done yet, still work in progress) Ray, it should work with egg generated by setuptools now, (zipped as well) Andi, right ! -> fixed in the current patch |
|||
| msg80421 - (view) | Author: Ray (rayterrill) | Date: 2009年01月23日 21:38 | |
any chance of getting a patch that would work in 2.4? |
|||
| msg80439 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年01月24日 09:20 | |
Well since Python 2.4 doesn't have the egg-info feature, that is another story. |
|||
| msg80465 - (view) | Author: Ray (rayterrill) | Date: 2009年01月24日 17:05 | |
There wouldn't be an easy way to read the distutils setup.py info at all in 2.4? i suppose i could write something specific for our environment. On 1/24/09, Tarek Ziadé <report@bugs.python.org> wrote: > > Tarek Ziadé <ziade.tarek@gmail.com> added the comment: > > Well since Python 2.4 doesn't have the egg-info feature, that is another > story. > > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue4908> > _______________________________________ > |
|||
| msg94616 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2009年10月28日 09:19 | |
This patch will be applied for the part that makes DistributionMetadata load files. The other part is waiting for PEP 376. |
|||
| msg102697 - (view) | Author: Tarek Ziadé (tarek) * (Python committer) | Date: 2010年04月09日 08:15 | |
Work done in pkgutil, in the Distutils2 project, see PEP 376 for API names. |
|||
| msg114513 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2010年08月21日 16:56 | |
Reversing the duplicate relation with #8250 since this report has more messages. Not reopening though, since the work is done. Kudos to Josip! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:44 | admin | set | github: 49158 |
| 2010年08月21日 16:58:39 | eric.araujo | set | resolution: duplicate -> fixed title: Implement PEP 376 -> Implement pkgutil APIs as described in PEP 376 superseder: Implement pkgutil APIs as described in PEP 376 -> versions: + Python 2.6, Python 2.5, Python 3.1 |
| 2010年08月21日 16:56:53 | eric.araujo | set | messages: + msg114513 |
| 2010年08月21日 16:51:07 | eric.araujo | link | issue8250 superseder |
| 2010年05月26日 16:32:00 | alexis | set | nosy:
+ alexis |
| 2010年05月09日 21:38:06 | tarek | set | status: open -> closed stage: resolved |
| 2010年05月09日 21:36:22 | tarek | set | resolution: accepted -> duplicate superseder: Implement pkgutil APIs as described in PEP 376 |
| 2010年05月01日 01:33:21 | meatballhat | set | nosy:
+ meatballhat |
| 2010年04月09日 08:15:59 | tarek | set | nosy:
aalbrecht, flub, tarek, eric.araujo, rayterrill messages: + msg102697 components: + Distutils2, - Distutils title: adding a get_metadata in distutils -> Implement PEP 376 |
| 2010年04月09日 00:16:40 | eric.araujo | set | nosy:
+ eric.araujo |
| 2009年10月28日 09:19:58 | tarek | set | priority: normal resolution: accepted messages: + msg94616 versions: + Python 3.2, - Python 3.1 |
| 2009年01月30日 13:18:46 | flub | set | nosy: + flub |
| 2009年01月24日 17:05:47 | rayterrill | set | messages: + msg80465 |
| 2009年01月24日 09:20:09 | tarek | set | messages: + msg80439 |
| 2009年01月23日 21:38:50 | rayterrill | set | messages: + msg80421 |
| 2009年01月14日 21:04:09 | tarek | set | messages: + msg79876 |
| 2009年01月14日 21:02:28 | tarek | set | files: - get_metadata.diff |
| 2009年01月14日 21:02:14 | tarek | set | files: + get_metadata.diff |
| 2009年01月13日 05:15:16 | aalbrecht | set | nosy:
+ aalbrecht messages: + msg79718 |
| 2009年01月12日 14:53:56 | rayterrill | set | messages: + msg79679 |
| 2009年01月12日 14:34:41 | tarek | set | messages: + msg79677 |
| 2009年01月12日 14:28:57 | rayterrill | set | messages: + msg79676 |
| 2009年01月11日 23:52:47 | tarek | set | files:
+ get_metadata.diff keywords: + patch messages: + msg79636 |
| 2009年01月11日 19:07:47 | tarek | set | messages: + msg79612 |
| 2009年01月10日 21:36:50 | rayterrill | set | nosy: + rayterrill |
| 2009年01月10日 17:45:04 | tarek | create | |