Skip to content
Snippets Groups Projects
Commit e720af7a authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Merge branch 'version_number' into 'master'

Added version number to pystencils

See merge request !197
parents f19bd423 74044905
1 merge request!197Added version number to pystencils
Pipeline #29599 passed with stages
in 9 minutes and 43 seconds
......@@ -21,6 +21,18 @@ try:
except ImportError:
pass
def _get_release_file():
import os.path
file_path = os.path.abspath(os.path.dirname(__file__))
return os.path.join(file_path, '..', 'RELEASE-VERSION')
try:
__version__ = open(_get_release_file(), 'r').read()
except IOError:
__version__ = 'development'
__all__ = ['Field', 'FieldType', 'fields',
'TypedSymbol',
'make_slice',
......
import pystencils as ps
from pathlib import Path
def test_version_string():
file_path = Path(__file__).parent
release_version = file_path.parent.absolute() / 'RELEASE-VERSION'
if release_version.exists ():
with open(release_version, "r") as f:
version = f.read()
assert ps.__version__ == version
else:
assert ps.__version__ == "development"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment