Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
af908094
Commit
af908094
authored
4 years ago
by
Dariusz Kędzierski
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup and comments in GitRevisionProvider class
parent
f59714be
No related branches found
No related tags found
4 merge requests
!456
Release candidate v1 24
,
!230
Setup monitoring with pghero
,
!135
Enable postgres monitoring on CI server
,
!84
Upgrade of setup.py
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+8
-1
8 additions, 1 deletion
setup.py
with
8 additions
and
1 deletion
setup.py
+
8
−
1
View file @
af908094
...
...
@@ -12,10 +12,16 @@ assert sys.version_info[0] == 3 and sys.version_info[1] >= 6, "hive requires Pyt
VERSION
=
'
0.0.1
'
class
GitRevisionProvider
(
object
):
_GIT_REVISION
=
None
"""
Static class to provide version and git revision information
"""
@staticmethod
def
provide_git_revision
():
"""
Evaluate version and git revision and save it to a version file
Evaluation is based on VERSION variable and git describe if
.git directory is present in tree.
In case when .git is not available version and git_revision is taken
from get_distribution call
"""
if
os
.
path
.
exists
(
"
.git
"
):
from
subprocess
import
check_output
command
=
'
git describe --tags --long --dirty
'
...
...
@@ -33,6 +39,7 @@ class GitRevisionProvider(object):
@staticmethod
def
_save_version_file
(
hivemind_version
,
git_revision
):
"""
Helper method to save version.py with current version and git_revision
"""
with
open
(
"
hive/version.py
"
,
'
w
'
)
as
version_file
:
version_file
.
write
(
"
# generated by setup.py
\n
"
)
version_file
.
write
(
"
# contents will be overwritten
\n
"
)
...
...
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