[Python-Dev] PEP 396, Module Version Numbers (original) (raw)
Barry Warsaw barry at python.org
Tue Apr 12 20:40:24 CEST 2011
- Previous message: [Python-Dev] PEP 396, Module Version Numbers
- Next message: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Apr 10, 2011, at 08:52 AM, Ben Finney wrote:
Nitpick: Please call these “version strings”. A version string is hardly ever just one number, and not in the general case anyway.
The PEP title does say version numbers (plural), and that seems more general than using 'strings' here.
Emily maintains a package consisting of programs and modules in several languages that inter-operate; several are Python, but some are Unix shell, Perl, and there are some C modules. Emily decides the simplest API for all these modules to get the package version string is a single text file named
version
at the root of the project tree. All the programs and modules, including thesetup.py
file, simply read the contents ofversion
to get the version string.This is an often-overlooked case, I think. The unspoken assumption is often that
setup.py
is a suitable place for the overall version string, but this is not the case when that string must be read by non-Python programs.
I'm not certain that the additional story informs any recommendations made by the PEP. In the case where the version number is kept in some external file, then you'd likely see something like this in setup.py:
setup(version=open('version.txt').read())
or this in foo/init.py:
version = open('version.txt').read()
The details aren't that important, but the fact that the version is kept in an external file doesn't change any of the recommendations the PEP is already making.
Cheers, -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/63ca90eb/attachment.pgp>
- Previous message: [Python-Dev] PEP 396, Module Version Numbers
- Next message: [Python-Dev] PEP 399: Pure Python/C Accelerator Module Compatibiilty Requirements
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]