summaryrefslogtreecommitdiff
path: root/scripts/internal/winmake.py
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2018-01-01 22:04:16 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2018-01-01 22:04:16 +0100
commit9806c4801cba4c239425226d9db8c5a7f8beb902 (patch)
tree3e7feba9e15c9f08ecfdf4d9714d8dd37311d576 /scripts/internal/winmake.py
parentc604a55694cc70d54f7abea628d41d99842944cc (diff)
parenta86c6f65c123442802c44d27e45b5e014a62fe3b (diff)
downloadpsutil-1102-proc-bitness.tar.gz
merge from master1102-proc-bitness
Diffstat (limited to 'scripts/internal/winmake.py')
-rwxr-xr-xscripts/internal/winmake.py67
1 files changed, 33 insertions, 34 deletions
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py
index 138a0b0c..548f7a8e 100755
--- a/scripts/internal/winmake.py
+++ b/scripts/internal/winmake.py
@@ -174,6 +174,12 @@ def recursive_rm(*patterns):
safe_rmtree(os.path.join(root, dir))
+def test_setup():
+ os.environ['PYTHONWARNINGS'] = 'all'
+ os.environ['PSUTIL_TESTING'] = '1'
+ os.environ['PSUTIL_DEBUG'] = '1'
+
+
# ===================================================================
# commands
# ===================================================================
@@ -205,13 +211,6 @@ def build():
@cmd
-def build_exe():
- """Create exe file."""
- build()
- sh("%s setup.py bdist_wininst" % PYTHON)
-
-
-@cmd
def build_wheel():
"""Create wheel file."""
build()
@@ -328,15 +327,15 @@ def flake8():
py_files = py_files.decode()
py_files = [x for x in py_files.split() if x.endswith('.py')]
py_files = ' '.join(py_files)
- sh("%s -Wa -m flake8 %s" % (PYTHON, py_files), nolog=True)
+ sh("%s -m flake8 %s" % (PYTHON, py_files), nolog=True)
@cmd
def test():
"""Run tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa %s" % (PYTHON, TSCRIPT))
+ test_setup()
+ sh("%s %s" % (PYTHON, TSCRIPT))
@cmd
@@ -344,8 +343,8 @@ def coverage():
"""Run coverage tests."""
# Note: coverage options are controlled by .coveragerc file
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m coverage run %s" % (PYTHON, TSCRIPT))
+ test_setup()
+ sh("%s -m coverage run %s" % (PYTHON, TSCRIPT))
sh("%s -m coverage report" % PYTHON)
sh("%s -m coverage html" % PYTHON)
sh("%s -m webbrowser -t htmlcov/index.html" % PYTHON)
@@ -355,56 +354,56 @@ def coverage():
def test_process():
"""Run process tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_process" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_process" % PYTHON)
@cmd
def test_system():
"""Run system tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_system" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_system" % PYTHON)
@cmd
def test_platform():
"""Run windows only tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_windows" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_windows" % PYTHON)
@cmd
def test_misc():
"""Run misc tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_misc" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_misc" % PYTHON)
@cmd
def test_unicode():
"""Run unicode tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_unicode" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_unicode" % PYTHON)
@cmd
def test_connections():
"""Run connections tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_connections" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_connections" % PYTHON)
@cmd
def test_contracts():
"""Run contracts tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v psutil.tests.test_contracts" % PYTHON)
+ test_setup()
+ sh("%s -m unittest -v psutil.tests.test_contracts" % PYTHON)
@cmd
@@ -416,8 +415,8 @@ def test_by_name():
except IndexError:
sys.exit('second arg missing')
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa -m unittest -v %s" % (PYTHON, name))
+ test_setup()
+ sh("%s -m unittest -v %s" % (PYTHON, name))
@cmd
@@ -429,16 +428,16 @@ def test_script():
except IndexError:
sys.exit('second arg missing')
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa %s" % (PYTHON, name))
+ test_setup()
+ sh("%s %s" % (PYTHON, name))
@cmd
def test_memleaks():
"""Run memory leaks tests"""
install()
- os.environ['PSUTIL_TESTING'] = '1'
- sh("%s -Wa psutil\\tests\\test_memory_leaks.py" % PYTHON)
+ test_setup()
+ sh("%s psutil\\tests\\test_memory_leaks.py" % PYTHON)
@cmd
@@ -467,8 +466,8 @@ def set_python(s):
# try to look for a python installation
orig = s
s = s.replace('.', '')
- vers = ('26', '27', '33', '34', '35', '36', '37',
- '26-64', '27-64', '33-64', '34-64', '35-64', '36-64', '37-64')
+ vers = ('26', '27', '34', '35', '36', '37',
+ '26-64', '27-64', '34-64', '35-64', '36-64', '37-64')
for v in vers:
if s == v:
path = 'C:\\python%s\python.exe' % s