@@ -17,8 +17,8 @@ set "DPBENCH_SYCL=1"
1717set " CMAKE_GENERATOR = Ninja"
1818set " CC = icx"
1919set " CXX = icx"
20-
21- " %PYTHON% " setup.py clean --all
20+ :: Make CMake verbose
21+ set " VERBOSE = 1 "
2222
2323FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @ (
2424 REM set DIR_HINT if directory exists
@@ -41,18 +41,41 @@ if EXIST "%PLATFORM_DIR%" (
4141 if errorlevel 1 exit 1
4242)
4343
44- @ REM TODO: switch to pip build. Currently results in broken binary
45- @ REM %PYTHON% -m pip install --no-index --no-deps --no-build-isolation . -v
44+ :: -wnx flags mean: --wheel --no-isolation --skip-dependency-check
45+ %PYTHON% -m build -w -n -x
46+ if %ERRORLEVEL% neq 0 exit 1
47+
48+ :: `pip install dist\dpbench*.whl` does not work on windows,
49+ :: so use a loop; there's only one wheel in dist/ anyway
50+ for /f %%f in ('dir /b /S .\dist') do (
51+ %PYTHON% -m wheel tags --remove --build %GIT_DESCRIBE_NUMBER% %%f
52+ if %ERRORLEVEL% neq 0 exit 1
53+ )
54+
55+ :: wheel file was renamed
56+ for /f %%f in ('dir /b /S .\dist') do (
57+ %PYTHON% -m pip install %%f ^
58+ --no-build-isolation ^
59+ --no-deps ^
60+ --only-binary :all: ^
61+ --no-index ^
62+ --prefix %PREFIX% ^
63+ -vv
64+ if %ERRORLEVEL% neq 0 exit 1
65+ )
66+
67+ :: Must be consistent with pyproject.toml project.scritps. Currently pip does
68+ :: not allow to ignore scripts installation, so we have to remove them manually.
69+ :: https://github.com/pypa/pip/issues/3980
70+ :: We have to let conda-build manage it for use in order to set proper python
71+ :: path.
72+ :: https://docs.conda.io/projects/conda-build/en/stable/resources/define-metadata.html#python-entry-points
73+ rm %PREFIX% \Scripts\dpbench.exe
74+
75+ :: Copy wheel package
4676if NOT " %WHEELS_OUTPUT_FOLDER% " == " " (
47- rem Install and assemble wheel package from the build bits
48- " %PYTHON% " setup.py install --single-version-externally-managed --record=record.txt bdist_wheel --build-number %GIT_DESCRIBE_NUMBER%
49- if errorlevel 1 exit 1
5077 copy dist\dpbench*.whl %WHEELS_OUTPUT_FOLDER%
5178 if errorlevel 1 exit 1
52- ) ELSE (
53- rem Only install
54- " %PYTHON% " setup.py install --single-version-externally-managed --record=record.txt
55- if errorlevel 1 exit 1
5679)
5780
5881rem copy back
0 commit comments