[f2py] Version
Pearu Peterson
pearu@cens.ioc.ee
Mon, 4 Mar 2002 20:23:04 +0200 (EET)
On 4 Mar 2002, Lionel Maziere wrote:
> Scipy_distutils allows (as does standard distutils) a version to be
> specified to 'setup'.
> A module built by f2py has a __version__ attribute which is always
> '$Revision: $' (CVS way ?)
>
> Could the setup version attribute be used by f2py to set the extension
> module version ?
>
> Example :
>
> setup(name="foo", version="1.0", ...)
A setup.py file may define several extension modules, each having the same
version makes little sense. But what about using define_macros for
specifying the version? For example,
ext = Extension(name="foo",...,define_macros = [("foo_VERSION","1.0")])
(or maybe Extension.__init__ should have an extra keyword 'version'? But
that will diverse from standard distutils, unfortunately.)
It would be easy to me add hooks into f2py generated modules that
recognize
-Dfoo_VERSION=1.0
and use it for defining __version__ attribute. If foo_VERSION is
undefined, then the extension module will have no __version__ attribute.
What do you think? Would that be useful?
Pearu