Skip to content

Commit fd8ec23

Browse files
committed
Added Python2/Python3 scripts for running tests
1 parent bc8052a commit fd8ec23

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

scripts/PythonQwt-tests-py3

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env python3
2+
from qwt import tests
3+
tests.run()

scripts/PythonQwt-tests-py3.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@echo off
2+
python "%~dpn0" %*

setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,15 @@
4949
CLASSIFIERS += ['Development Status :: 3 - Alpha']
5050
else:
5151
CLASSIFIERS += ['Development Status :: 5 - Production/Stable']
52-
if os.name == 'nt':
53-
SCRIPTS = ['PythonQwt-tests', 'PythonQwt-tests.bat']
54-
else:
55-
SCRIPTS = ['PythonQwt-tests']
56-
SCRIPTS = [osp.join('scripts', fname) for fname in SCRIPTS]
52+
53+
54+
def _create_script_list(basename):
55+
scripts = ['%s-py%d' % (basename, sys.version_info.major)]
56+
if os.name == 'nt':
57+
scripts.append('%s.bat' % scripts[0])
58+
return [osp.join('scripts', name) for name in scripts]
59+
60+
SCRIPTS = _create_script_list('PythonQwt-tests')
5761

5862

5963
def get_package_data(name, extlist):

0 commit comments

Comments
 (0)