Skip to content

Commit 05dff91

Browse files
committed
Switch to python-build
1 parent 8eb86d4 commit 05dff91

File tree

3 files changed

+37
-14
lines changed

3 files changed

+37
-14
lines changed

conda-recipe/bld.bat

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,37 @@ REM of distutils (from late copies of CPython) that is enabled by default.
1212
REM It breaks build for Windows, so use distutils from "stdlib" as before.
1313
REM @TODO: remove the setting, once transition to build backend on Windows
1414
REM to cmake is complete.
15+
REM UPD: Seems to work fine with setuptools 69, so we need to set minimal
16+
REM requirements before removing it.
1517
SET "SETUPTOOLS_USE_DISTUTILS=stdlib"
1618

1719
set "CC=icx"
1820
set "CXX=icx"
1921

20-
set "SKBUILD_ARGS=-G Ninja --"
21-
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
22+
set "CMAKE_GENERATOR=Ninja"
23+
:: Make CMake verbose
24+
set "VERBOSE=1"
2225

23-
%PYTHON% setup.py install --single-version-externally-managed --record=record.txt %SKBUILD_ARGS%
26+
%PYTHON% -m build -w -n -x
27+
if %ERRORLEVEL% neq 0 exit 1
2428

25-
rem Build wheel package
29+
:: `pip install dist\numpy*.whl` does not work on windows,
30+
:: so use a loop; there's only one wheel in dist/ anyway
31+
for /f %%f in ('dir /b /S .\dist') do (
32+
%PYTHON% -m wheel tags --remove --build %GIT_DESCRIBE_NUMBER% %%f
33+
if %ERRORLEVEL% neq 0 exit 1
34+
)
35+
36+
:: wheel file was renamed
37+
for /f %%f in ('dir /b /S .\dist') do (
38+
%PYTHON% -m pip install %%f
39+
if %ERRORLEVEL% neq 0 exit 1
40+
)
41+
42+
:: Copy wheel package
2643
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
27-
%PYTHON% setup.py bdist_wheel --build-number %GIT_DESCRIBE_NUMBER% %SKBUILD_ARGS%
28-
if errorlevel 1 exit 1
29-
copy dist\numba_dpex*.whl %WHEELS_OUTPUT_FOLDER%
30-
if errorlevel 1 exit 1
44+
for /f %%f in ('dir /b /S .\dist') do (
45+
copy %%f %WHEELS_OUTPUT_FOLDER%
46+
if %ERRORLEVEL% neq 0 exit 1
47+
)
3148
)

conda-recipe/build.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,21 @@ export ICPXCFG
1515
export CC=icx
1616
export CXX=icpx
1717

18+
export CMAKE_GENERATOR=Ninja
19+
# Make CMake verbose
20+
export VERBOSE=1
21+
1822
# new llvm-spirv location
1923
# starting from dpcpp_impl_linux-64=2022.0.0=intel_3610
2024
export PATH=$CONDA_PREFIX/bin-llvm:$PATH
2125

22-
SKBUILD_ARGS=(-G Ninja -- -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON)
23-
24-
${PYTHON} setup.py install --single-version-externally-managed --record=record.txt "${SKBUILD_ARGS[@]}"
26+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
27+
${PYTHON} -m build -w -n -x
28+
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
29+
--platform-tag manylinux2014_x86_64 dist/numba_dpex*.whl
30+
${PYTHON} -m pip install dist/numba_dpex*.whl
2531

26-
# Build wheel package
27-
WHEELS_BUILD_ARGS=(-p manylinux2014_x86_64 --build-number "$GIT_DESCRIBE_NUMBER")
32+
# Copy wheel package
2833
if [[ -v WHEELS_OUTPUT_FOLDER ]]; then
29-
$PYTHON setup.py bdist_wheel "${WHEELS_BUILD_ARGS[@]}" "${SKBUILD_ARGS[@]}"
3034
cp dist/numba_dpex*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
3135
fi

conda-recipe/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ requirements:
4141
# - dpcpp-llvm-spirv >={{ required_compiler_version }}
4242
- dpcpp-llvm-spirv >=2023.0
4343
- wheel >=0.43
44+
- pip >=24.0
45+
- python-build >=1.1
4446
- versioneer==0.29
4547
# versioneer dependency
4648
- tomli # [py<311]

0 commit comments

Comments
 (0)