[Python-Dev] PEP 396, Module Version Numbers

Ben Finney ben+python at benfinney.id.au
Mon Apr 11 01:51:36 CEST 2011


"P.J. Eby" <pje at telecommunity.com> writes:

> At 03:24 PM 4/10/2011 +0000, exarkun at twistedmatrix.com wrote:
> >On 04:02 am, pje at telecommunity.com wrote:
> >>At 08:52 AM 4/10/2011 +1000, Ben Finney wrote:
> >>>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.

[…]

> Anyway, I was merely addressing the technical question of how to get
> information from the tools that already exist, rather than advocating
> any solutions.

Thanks for the reply, that capability wasn't really evident to me (like
just about everything Setuptools).

> I was replying to the part above about "setup.py ...  must be read by
> non-Python programs".
>
> In other words, I thought the question was, "given a not-yet-installed
> source package, how can we find the version number without writing
> Python code".

No, that's not the intention of that use case; the non-Python programs
will obviously continue to need access to the package version string
even after the package is installed.

That's why the fictional Emily has decided to keep the version string in
a plain-text ``version`` file for that purpose.

-- 
 \     “We are all agreed that your theory is crazy. The question that |
  `\      divides us is whether it is crazy enough to have a chance of |
_o__)            being correct.” —Niels Bohr (to Wolfgang Pauli), 1958 |
Ben Finney



More information about the Python-Dev mailing list