Skip to content

Commit 2bbf32b

Browse files
committed
Migrate package build to python-build
1 parent 86056f6 commit 2bbf32b

File tree

4 files changed

+36
-22
lines changed

4 files changed

+36
-22
lines changed

conda-recipe/bld.bat

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ set "DPBENCH_SYCL=1"
1717
set "CMAKE_GENERATOR=Ninja"
1818
set "CC=icx"
1919
set "CXX=icx"
20-
21-
"%PYTHON%" setup.py clean --all
20+
:: Make CMake verbose
21+
set "VERBOSE=1"
2222

2323
FOR %%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,26 @@ 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+
%PYTHON% -m build -w -n -x
45+
if %ERRORLEVEL% neq 0 exit 1
46+
47+
:: `pip install dist\numpy*.whl` does not work on windows,
48+
:: so use a loop; there's only one wheel in dist/ anyway
49+
for /f %%f in ('dir /b /S .\dist') do (
50+
%PYTHON% -m wheel tags --remove --build %GIT_DESCRIBE_NUMBER% %%f
51+
if %ERRORLEVEL% neq 0 exit 1
52+
)
53+
54+
:: wheel file was renamed
55+
for /f %%f in ('dir /b /S .\dist') do (
56+
%PYTHON% -m pip install %%f
57+
if %ERRORLEVEL% neq 0 exit 1
58+
)
59+
60+
:: Copy wheel package
4661
if 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
5062
copy dist\dpbench*.whl %WHEELS_OUTPUT_FOLDER%
5163
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
5664
)
5765

5866
rem copy back

conda-recipe/build.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@ export CMAKE_GENERATOR="Ninja"
1616
export CC=icx
1717
export CXX=icpx
1818

19-
if [ -e "_skbuild" ]; then
20-
${PYTHON} setup.py clean --all
21-
fi
22-
2319
# TODO: switch to pip build. Currently results in broken binary on Windows
2420
# $PYTHON -m pip install --no-index --no-deps --no-build-isolation . -v
2521

26-
# Build wheel package
27-
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
28-
$PYTHON setup.py install --single-version-externally-managed --record=record.txt bdist_wheel -p manylinux2014_x86_64 --build-number $GIT_DESCRIBE_NUMBER
29-
mkdir -p ${WHEELS_OUTPUT_FOLDER}
30-
cp dist/dpbench*.whl ${WHEELS_OUTPUT_FOLDER}
31-
else
32-
$PYTHON setup.py install --single-version-externally-managed --record=record.txt
22+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
23+
${PYTHON} -m build -w -n -x
24+
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
25+
--platform-tag manylinux2014_x86_64 dist/dpbench*.whl
26+
${PYTHON} -m pip install dist/dpbench*.whl
27+
28+
# Copy wheel package
29+
if [[ -v WHEELS_OUTPUT_FOLDER ]]; then
30+
cp dist/dpbench*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
3331
fi

conda-recipe/meta.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ requirements:
2626
- sysroot_linux-64 >=2.28 # [linux]
2727
host:
2828
- python
29+
- pip
2930
{% for dep in py_build_deps %}
3031
{% if dep.startswith('ninja') %}
3132
- {{ dep.split(';')[0] }} # [not win]
33+
{% elif dep.startswith('cmake') %}
34+
- cmake=3.26 # [win]
35+
- {{ dep }} # [not win]
36+
{% elif dep.startswith('build>=') %}
37+
- {{ 'python-' ~ dep }}
3238
{% else %}
3339
- {{ dep|replace('_','-') }}
3440
{% endif %}

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ dpbench = "dpbench.console.entry:main"
6161
# TODO: make it optional for no sycl build. Workaround: `--no-deps`.
6262
# https://github.com/scikit-build/scikit-build/issues/981
6363
requires = [
64+
"wheel>=0.43",
65+
"build>=1.1",
6466
"setuptools>=63.0.0",
6567
"scikit-build>=0.17.0", # sycl build dep
6668
"ninja>=1.11.1; platform_system!='Windows'", # sycl build dep

0 commit comments

Comments
 (0)