Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itischler
lbmpy
Commits
d6bde7f7
Commit
d6bde7f7
authored
Jan 26, 2021
by
Michael Kuron
Browse files
Merge branch 'Add_Version_String' into 'master'
Added version String to lbmpy See merge request
pycodegen/lbmpy!56
parents
fd16f1f4
9653c0e3
Changes
3
Show whitespace changes
Inline
Side-by-side
.gitignore
View file @
d6bde7f7
...
@@ -14,3 +14,4 @@ _local_tmp
...
@@ -14,3 +14,4 @@ _local_tmp
/lbmpy_tests/db
/lbmpy_tests/db
doc/bibtex.json
doc/bibtex.json
/html_doc
/html_doc
RELEASE-VERSION
lbmpy/__init__.py
View file @
d6bde7f7
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'
lbmpy_tests/test_version_string.py
0 → 100644
View file @
d6bde7f7
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"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment