Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
9653c0e3
Commit
9653c0e3
authored
4 years ago
by
Markus Holzer
Committed by
Michael Kuron
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added version String to lbmpy
parent
fd16f1f4
No related branches found
No related tags found
1 merge request
!56
Added version String to lbmpy
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
lbmpy/__init__.py
+10
-0
10 additions, 0 deletions
lbmpy/__init__.py
lbmpy_tests/test_version_string.py
+12
-0
12 additions, 0 deletions
lbmpy_tests/test_version_string.py
with
23 additions
and
0 deletions
.gitignore
+
1
−
0
View file @
9653c0e3
...
@@ -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
This diff is collapsed.
Click to expand it.
lbmpy/__init__.py
+
10
−
0
View file @
9653c0e3
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
'
This diff is collapsed.
Click to expand it.
lbmpy_tests/test_version_string.py
0 → 100644
+
12
−
0
View file @
9653c0e3
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
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment