[melbourne-pug] python package versions

Brian May brian at microcomaustralia.com.au
Thu Mar 6 01:16:05 CET 2014


Hello,

What is considered current best practise for version numbers in python
modules?

PEP-8 says you should define a module.__version__ string.

Django doesn't do this, it defines a module.VERSION array and a
module.get_version function instead.

Also, I end up with the version string in many places, and forget to update
some on new releases. Such as:

* module/__init__.py
* setup.py
* docs/*/conf.py for every sphinx document.
* debian/changelog

So rather then try to invent my own solution, just wondered what is
considered best practise.

Thanks


Notes:

[1] Some documents recommend setup.py should do:

from module import __version__
version = __version__

or

import module
version = module.__version__

However, that means all dependencies required by __init__.py must also be
loaded, which can be a lot of overhead just to get the version number (e.g.
if Django is required).


[2] Also, on a separate thread, can somebody point me to a document that
describes the difference between the two forms of import in as described in
[1]? It seems that they are different.
-- 
Brian May <brian at microcomaustralia.com.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/melbourne-pug/attachments/20140306/9f093d6c/attachment.html>


More information about the melbourne-pug mailing list