Files
palemoon27/python/psutil/make.bat
T
roytam1 98894236c9 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1171200 - Add means of checking if a document links to a manifest. r=billm (066ddad20)
- Bug 1167300 - Consolidate the performance tool directory, r=jsantell (c7dd7dc34)
- Bug 1167300 - Create a way to get strings from multiple localization files, r=jsantell (0973b8d3e)
- modules not in gre (914e4080e)
- Bug 1153011 - Remove zoom button from call tree. r=vporof (797b8f91d)
- Bug 1151973 - Inverted call tree should be ordered by 'self cost', not 'total cost', r=jsantell (f2800b272)
- more gre removal (27aed87a0)
- Bug 1144034 - Flamegraph text is barely readable on non-retina display, r=jsantell (cb19fd9f2)
- Bug 1151973 - Inverted call tree should be ordered by 'self cost', not 'total cost', r=jsantell (9c579599e)
- Bug 1167300 - Fix all performance tool imports to work with the new file locations, r=jsantell (70b2995c4)
- Bug 1167298 - Remove the ordinal property on categories, r=jsantell (00b3f5830)
- Bug 1167733 - Consolidate prefs access and usage in the new performance tool, r=jsantell (4dab15e7f)
- Bug 1167006 - part 3 fully revert merge from 780e1f999f54. (8aaa33c9c)
- Bug 1167961 - Task is incorrectly used in compatibility.js, r=jsantell (7291f68d1)
- Bug 1138641 - Updated remaining callsites to use newChannel2 in browser/devtools (r=vporof) (60ac4b2c8)
- Bug 1164130 - Correctly include RecordingUtils when importing older version 2 profiler data. r=vp (8169d0398)
- Bug 1167962 - Keep exports at bottom of modules, r=jsantell (7426919db)
- Bug 1167962 - Fix import in synthesizeProfileForTest, r=orange (cc7fab771)
- fix merge of later patch Bug 1167006 (c0b57b0e2)
- Bug 1157523 - Fix intermittent where markers are selected in the waterfall views when there is no recording selected. r=vp (35cec0bd1)
- Bug 1196253 - update in-tree psutil to 3.1.1. r=gps (80f243738)
2021-05-26 11:17:55 +08:00

202 lines
6.5 KiB
Batchfile

@echo off
rem ==========================================================================
rem Shortcuts for various tasks, emulating UNIX "make" on Windows.
rem It is primarly intended as a shortcut for compiling / installing
rem psutil ("make.bat build", "make.bat install") and running tests
rem ("make.bat test").
rem
rem This script is modeled after my Windows installation which uses:
rem - Visual studio 2008 for Python 2.6, 2.7, 3.2
rem - Visual studio 2010 for Python 3.3+
rem ...therefore it might not work on your Windows installation.
rem
rem By default C:\Python27\python.exe is used.
rem To compile for a specific Python version run:
rem set PYTHON=C:\Python34\python.exe & make.bat build
rem
rem To use a different test script:
rem set PYTHON=C:\Python34\python.exe & set TSCRIPT=foo.py & make.bat test
rem ==========================================================================
if "%PYTHON%" == "" (
set PYTHON=C:\Python27\python.exe
)
if "%TSCRIPT%" == "" (
set TSCRIPT=test\test_psutil.py
)
set PYTHON26=C:\Python26\python.exe
set PYTHON27=C:\Python27\python.exe
set PYTHON33=C:\Python33\python.exe
set PYTHON34=C:\Python34\python.exe
set PYTHON26-64=C:\Python26-64\python.exe
set PYTHON27-64=C:\Python27-64\python.exe
set PYTHON33-64=C:\Python33-64\python.exe
set PYTHON34-64=C:\Python34-64\python.exe
set ALL_PYTHONS=%PYTHON26% %PYTHON27% %PYTHON33% %PYTHON34% %PYTHON26-64% %PYTHON27-64% %PYTHON33-64% %PYTHON34-64%
rem Needed to locate the .pypirc file and upload exes on PYPI.
set HOME=%USERPROFILE%
rem ==========================================================================
if "%1" == "help" (
:help
echo Run `make ^<target^>` where ^<target^> is one of:
echo build compile without installing
echo build-all build exes + wheels
echo clean clean build files
echo flake8 run flake8
echo install compile and install
echo setup-dev-env install pip, pywin32, wheels, etc. for all python versions
echo test run tests
echo test-memleaks run memory leak tests
echo test-process run process related tests
echo test-system run system APIs related tests
echo uninstall uninstall
echo upload-all upload exes + wheels
goto :eof
)
if "%1" == "clean" (
for /r %%R in (__pycache__) do if exist %%R (rmdir /S /Q %%R)
for /r %%R in (*.pyc) do if exist %%R (del /s %%R)
for /r %%R in (*.pyd) do if exist %%R (del /s %%R)
for /r %%R in (*.orig) do if exist %%R (del /s %%R)
for /r %%R in (*.bak) do if exist %%R (del /s %%R)
for /r %%R in (*.rej) do if exist %%R (del /s %%R)
if exist psutil.egg-info (rmdir /S /Q psutil.egg-info)
if exist build (rmdir /S /Q build)
if exist dist (rmdir /S /Q dist)
goto :eof
)
if "%1" == "build" (
:build
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
%PYTHON% setup.py build
if %errorlevel% neq 0 goto :error
rem copies *.pyd files in ./psutil directory in order to allow
rem "import psutil" when using the interactive interpreter from
rem within this directory.
%PYTHON% setup.py build_ext -i
if %errorlevel% neq 0 goto :error
goto :eof
)
if "%1" == "install" (
:install
call :build
%PYTHON% setup.py install
goto :eof
)
if "%1" == "uninstall" (
for %%A in ("%PYTHON%") do (
set folder=%%~dpA
)
for /F "delims=" %%i in ('dir /b %folder%\Lib\site-packages\*psutil*') do (
rmdir /S /Q %folder%\Lib\site-packages\%%i
)
goto :eof
)
if "%1" == "test" (
call :install
%PYTHON% %TSCRIPT%
goto :eof
)
if "%1" == "test-process" (
call :install
%PYTHON% -m unittest -v test.test_psutil.TestProcess
goto :eof
)
if "%1" == "test-system" (
call :install
%PYTHON% -m unittest -v test.test_psutil.TestSystem
goto :eof
)
if "%1" == "test-memleaks" (
call :install
%PYTHON% test\test_memory_leaks.py
goto :eof
)
if "%1" == "build-all" (
:build-all
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
for %%P in (%ALL_PYTHONS%) do (
@echo ------------------------------------------------
@echo building exe for %%P
@echo ------------------------------------------------
%%P setup.py build bdist_wininst || goto :error
@echo ------------------------------------------------
@echo building wheel for %%P
@echo ------------------------------------------------
%%P setup.py build bdist_wheel || goto :error
)
echo OK
goto :eof
)
if "%1" == "upload-all" (
:upload-exes
"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat"
for %%P in (%ALL_PYTHONS%) do (
@echo ------------------------------------------------
@echo uploading exe for %%P
@echo ------------------------------------------------
%%P setup.py build bdist_wininst upload || goto :error
@echo ------------------------------------------------
@echo uploading wheel for %%P
@echo ------------------------------------------------
%%P setup.py build bdist_wheel upload || goto :error
)
echo OK
goto :eof
)
if "%1" == "setup-dev-env" (
:setup-env
@echo ------------------------------------------------
@echo downloading pip installer
@echo ------------------------------------------------
C:\python27\python.exe -c "import urllib2; r = urllib2.urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py'); open('get-pip.py', 'wb').write(r.read())"
for %%P in (%ALL_PYTHONS%) do (
@echo ------------------------------------------------
@echo installing pip for %%P
@echo ------------------------------------------------
%%P get-pip.py
)
for %%P in (%ALL_PYTHONS%) do (
@echo ------------------------------------------------
@echo installing deps for %%P
@echo ------------------------------------------------
rem mandatory / for unittests
%%P -m pip install unittest2 ipaddress mock wmi wheel pypiwin32 --upgrade
rem nice to have
%%P -m pip install ipdb pep8 pyflakes flake8 --upgrade
)
goto :eof
)
if "%1" == "flake8" (
:flake8
%PYTHON% -c "from flake8.main import main; main()"
goto :eof
)
goto :help
:error
@echo ------------------------------------------------
@echo last command exited with error code %errorlevel%
@echo ------------------------------------------------
@exit /b %errorlevel%
goto :eof