Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RWTH.nb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RWTHjupyter
RWTH.nb
Commits
369d6d11
Commit
369d6d11
authored
4 years ago
by
Jens Schneider
Browse files
Options
Downloads
Patches
Plain Diff
Another try to check for the current branch during installation
parent
ed9bf255
No related branches found
No related tags found
1 merge request
!10
- major changes in feedback
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
setup.py
+7
-4
7 additions, 4 deletions
setup.py
with
7 additions
and
4 deletions
setup.py
+
7
−
4
View file @
369d6d11
...
...
@@ -22,10 +22,13 @@ def get_version():
try
:
git_describe
=
subprocess
.
check_output
([
"
git
"
,
"
describe
"
,
"
--tags
"
])
git_describe
=
git_describe
.
decode
(
"
utf-8
"
).
strip
()
git_branch
=
subprocess
.
check_output
([
"
git
"
,
"
branch
"
,
"
--show-current
"
])
git_branch
=
git_branch
.
decode
(
"
utf-8
"
).
strip
()
f
=
open
(
'
version.txt
'
,
'
w
'
)
f
.
write
(
git_describe
)
f
.
write
lines
([
git_describe
,
"
\n
"
,
git_branch
]
)
f
.
close
()
# and do it one more for packaging if possible
# f = open('src/rwth-nb/version.txt','w')
# f.write(git_describe)
...
...
@@ -33,6 +36,7 @@ def get_version():
except
:
f
=
open
(
'
version.txt
'
,
'
r
'
)
git_describe
=
f
.
readline
()
git_branch
=
f
.
readline
()
f
.
close
()
# check whether
...
...
@@ -41,7 +45,6 @@ def get_version():
version
=
git_describe
split_describe
=
git_describe
.
split
(
'
-
'
)
git_branch
=
subprocess
.
check_output
([
"
git
"
,
"
branch
"
,
"
--show-current
"
])
if
(
len
(
split_describe
)
>
1
and
git_branch
==
"
master
"
):
raise
Exception
(
"
I do not want to build this package since you did not tag your current state of work.
"
)
...
...
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