Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
pystencils
Commits
4030bd8d
Commit
4030bd8d
authored
4 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Added test case for version number
parent
8eb74b7b
No related branches found
No related tags found
1 merge request
!197
Added version number to pystencils
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/__init__.py
+3
-3
3 additions, 3 deletions
pystencils/__init__.py
pystencils_tests/test_version_string.py
+12
-0
12 additions, 0 deletions
pystencils_tests/test_version_string.py
with
15 additions
and
3 deletions
pystencils/__init__.py
+
3
−
3
View file @
4030bd8d
...
@@ -22,16 +22,16 @@ except ImportError:
...
@@ -22,16 +22,16 @@ except ImportError:
pass
pass
def
_get_
file_path
():
def
_get_
release_file
():
import
os.path
import
os.path
file_path
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
file_path
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
return
os
.
path
.
join
(
file_path
,
'
..
'
,
'
RELEASE-VERSION
'
)
return
os
.
path
.
join
(
file_path
,
'
..
'
,
'
RELEASE-VERSION
'
)
try
:
try
:
__version__
=
open
(
_get_
file_path
(),
'
r
'
).
read
()
__version__
=
open
(
_get_
release_file
(),
'
r
'
).
read
()
except
IOError
:
except
IOError
:
__version__
=
'
Please install pystencils with setup.py
'
__version__
=
'
development
'
__all__
=
[
'
Field
'
,
'
FieldType
'
,
'
fields
'
,
__all__
=
[
'
Field
'
,
'
FieldType
'
,
'
fields
'
,
'
TypedSymbol
'
,
'
TypedSymbol
'
,
...
...
This diff is collapsed.
Click to expand it.
pystencils_tests/test_version_string.py
0 → 100644
+
12
−
0
View file @
4030bd8d
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
:
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