Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
d62d4e8a
Commit
d62d4e8a
authored
Jul 31, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include git commit in runtests version info.
parent
a7a08a67
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
runtests.py
runtests.py
+31
-2
No files found.
runtests.py
View file @
d62d4e8a
...
@@ -1236,6 +1236,36 @@ def check_thread_termination(ignore_seen=True):
...
@@ -1236,6 +1236,36 @@ def check_thread_termination(ignore_seen=True):
sys.stderr.write('...%s
\
n
' % repr(t))
sys.stderr.write('...%s
\
n
' % repr(t))
raise PendingThreadsError("
left
-
over
threads
found
after
running
test
")
raise PendingThreadsError("
left
-
over
threads
found
after
running
test
")
def subprocess_output(cmd):
try:
try:
import subprocess
except:
return os.popen4(cmd)[1].read()
else:
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT).communicate()[0]
except OSError:
return ''
def get_version():
from Cython.Compiler.Version import version as cython_version
full_version = cython_version
top = os.path.dirname(os.path.abspath(__file__))
if os.path.exists(os.path.join(top, '.git')):
try:
old_dir = os.getcwd()
os.chdir(top)
head_commit = subprocess_output(['git', 'rev-parse', 'HEAD']).strip()
version_commit = subprocess_output(['git', 'rev-parse', cython_version]).strip()
diff = subprocess_output(['git', 'diff', '--stat']).strip()
if head_commit != version_commit:
full_version += "
" + head_commit
if diff:
full_version += ' + uncommitted changes'
finally:
os.chdir(old_dir)
return full_version
def main():
def main():
DISTDIR = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))
DISTDIR = os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]))
...
@@ -1389,8 +1419,7 @@ def main():
...
@@ -1389,8 +1419,7 @@ def main():
sys
.
stderr
.
write
(
"Python %s
\
n
"
%
sys
.
version
)
sys
.
stderr
.
write
(
"Python %s
\
n
"
%
sys
.
version
)
sys
.
stderr
.
write
(
"
\
n
"
)
sys
.
stderr
.
write
(
"
\
n
"
)
if
WITH_CYTHON
:
if
WITH_CYTHON
:
from
Cython.Compiler.Version
import
version
sys
.
stderr
.
write
(
"Running tests against Cython %s
\
n
"
%
get_version
())
sys
.
stderr
.
write
(
"Running tests against Cython %s
\
n
"
%
version
)
else
:
else
:
sys
.
stderr
.
write
(
"Running tests without Cython.
\
n
"
)
sys
.
stderr
.
write
(
"Running tests without Cython.
\
n
"
)
...
...
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