[Python-Dev] PEP 396, Module Version Numbers (original) (raw)
Barry Warsaw barry at python.org
Tue Apr 12 20:28:25 CEST 2011
- Previous message: [Python-Dev] PEP 396, Module Version Numbers
- Next message: [Python-Dev] PEP 396, Module Version Numbers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Apr 05, 2011, at 01:22 PM, Glenn Linderman wrote:
On 4/5/2011 11:52 AM, Barry Warsaw wrote:
DEFAULTVERSIONRE = re.compile(r'(?P\d+.\d(?:.\d+)?)') version = pkgutil.getdistribution('elle').metadata['version'] The RE as given won't match alpha, beta, rc, dev, and post suffixes that are discussed in POP 386.
It really wasn't intended to. I'm torn about even including this code sample in the PEP. I'm highly tempted to rip this out and hand-wave over the implementation of get_version(). It's not a critical part of the PEP and might just be distracting.
Are there issues for finding and loading multiple versions of the same module?
Out of scope for this PEP I think.
Should it be possible to determine a version before loading a module? If yes, the version module would have to be able to find a parse version strings in any of the many places this PEP suggests they could be... so that would be somewhat complex, but the complexity shouldn't be used to change the answer... but if the answer is yes, it might encourage fewer variant cases to be supported for acceptable version definition locations for this PEP.
I think the answer can be "yes", but only through distutils2/packaging APIs. If there's no metadata for a module available, then I don't have a problem saying the version information can't be determined without importing it.
-Barry
-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20110412/343a9be4/attachment.pgp>
- Previous message: [Python-Dev] PEP 396, Module Version Numbers
- Next message: [Python-Dev] PEP 396, Module Version Numbers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]