Added version number to pystencils
Pystencils should have a __version__
attribute
Merge request reports
Activity
added feature label
Before the installation. As soons as setup.py is imported (e.g. by pip install ...). You want the attribute after having installed pystencils right? You can also execute that generates RELEASE-VERSION if it does not exist yet. As a submodule it should be possible to run get_version_from_git when RELEASE-VERSION does not exist.
You can also call
doc/get_version_from_git
Or you can use pyscaffold. It does all this nasty python stuff.
>>> walberla_app.__version__ '0.0.post0.dev59+gd9bf01e.dirty'
Edited by Stephan SeitzIt should only export stuff inYou can explictly import os then or__all__
.__import__('os')
or import with underscore alias.Edited by Stephan SeitzYes, that's right if you import pystencils with
from pystencils import *
. But if I writeimport pystencils
, thenpystencils.os
is available.But I don`t even know if this is problematic.
Edited by Markus HolzerBetter: you could write a local function and import in that function.
Edited by Stephan Seitz21 21 except ImportError: 22 22 pass 23 23 24 def get_file_path(): 25 import os.path 26 file_path = os.path.abspath(os.path.dirname(__file__)) 27 return os.path.join(file_path, '../RELEASE-VERSION') bitte an unsere Windows user denken (obwohl es glaube ich auch auf Windows mit '/' geht. nur dirname funktioniert normalerweise, weil das aus dem selben Kontext wie die Pythonversion ausgeführt wird. Sogar sicherer als abspath.
Edited by Stephan Seitz'..', 'RELEASE-VERSION')
Ich hatte mal die Situation, dass abspath nicht funktioniert hat weil dirname '.' war. abspath war dann empty string.
Edited by Stephan Seitzchanged this line in version 4 of the diff
21 21 except ImportError: 22 22 pass 23 23 24 def get_file_path(): changed this line in version 4 of the diff
@holzer Sorry I forgot about this one. Can it be merged?
added 17 commits
-
311b9b26...f19bd423 - 16 commits from branch
pycodegen:master
- 8eb74b7b - Merge i10git.cs.fau.de:pycodegen/pystencils into version_number
-
311b9b26...f19bd423 - 16 commits from branch