Skip to content

Commit

Permalink
Cleanup the helper scripts
Browse files Browse the repository at this point in the history
* Remove from __future__ import print_function, because we
  no longer support Python2.
* Clean out unused parts of tools/scripts/scriptCommon.py
* Move appveyorMergeCoverageScript to Python3
* Update user reporting in *release scripts
* Cleanup module imports
  • Loading branch information
horenmar committed Nov 6, 2022
1 parent d1ef461 commit 297a175
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 49 deletions.
2 changes: 1 addition & 1 deletion tools/misc/appveyorMergeCoverageScript.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

import glob
import subprocess
Expand Down
2 changes: 0 additions & 2 deletions tools/scripts/approvalTests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function

import io
import os
import sys
Expand Down
2 changes: 0 additions & 2 deletions tools/scripts/approve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function

import os
import sys
import shutil
Expand Down
3 changes: 1 addition & 2 deletions tools/scripts/developBuild.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python3

from __future__ import print_function
import releaseCommon

v = releaseCommon.Version()
v.incrementBuildNumber()
releaseCommon.performUpdates(v)

print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
print( "Updated files to v{0}".format( v.getVersionString() ) )
2 changes: 0 additions & 2 deletions tools/scripts/extractFeaturesFromReleaseNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# to add the 'Introduced in Catch ...' snippets to the relevant pages.
#

from __future__ import print_function

import re


Expand Down
1 change: 0 additions & 1 deletion tools/scripts/fixWhitespace.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3

from __future__ import print_function
import os
from scriptCommon import catchPath

Expand Down
3 changes: 1 addition & 2 deletions tools/scripts/majorRelease.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python3

from __future__ import print_function
import releaseCommon

v = releaseCommon.Version()
v.incrementMajorVersion()
releaseCommon.performUpdates(v)

print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
print( "Updated files to v{0}".format( v.getVersionString() ) )
3 changes: 1 addition & 2 deletions tools/scripts/minorRelease.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python3

from __future__ import print_function
import releaseCommon

v = releaseCommon.Version()
v.incrementMinorVersion()
releaseCommon.performUpdates(v)

print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
print( "Updated files to v{0}".format( v.getVersionString() ) )
3 changes: 1 addition & 2 deletions tools/scripts/patchRelease.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python3

from __future__ import print_function
import releaseCommon

v = releaseCommon.Version()
v.incrementPatchNumber()
releaseCommon.performUpdates(v)

print( "Updated Version.hpp, README and Conan to v{0}".format( v.getVersionString() ) )
print( "Updated files to v{0}".format( v.getVersionString() ) )
4 changes: 0 additions & 4 deletions tools/scripts/releaseCommon.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from __future__ import print_function

import os
import sys
import re
import string
import glob
import fnmatch

from scriptCommon import catchPath
Expand Down
27 changes: 0 additions & 27 deletions tools/scripts/scriptCommon.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
import os
import sys
import subprocess


catchPath = os.path.dirname(os.path.dirname(os.path.realpath( os.path.dirname(sys.argv[0]))))

def getBuildExecutable():
if os.name == 'nt':
dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest.exe")
return dir
else:
dir = os.environ.get('CATCH_DEV_OUT_DIR', "cmake-build-debug/projects/SelfTest")
return dir


def runAndCapture( args ):
child = subprocess.Popen(" ".join( args ), shell=True, stdout=subprocess.PIPE)
lines = []
line = ""
while True:
out = child.stdout.read(1)
if out == '' and child.poll():
break
if out != '':
if out == '\n':
lines.append( line )
line = ""
else:
line = line + out
return lines
2 changes: 0 additions & 2 deletions tools/scripts/updateDocumentToC.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# https://github.com/rasbt/markdown-toclify
#

from __future__ import print_function

import argparse
import glob
import os
Expand Down

0 comments on commit 297a175

Please sign in to comment.