Skip to content

Commit

Permalink
Improve pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed May 2, 2024
1 parent c1b8a59 commit 59d33e7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 23 deletions.
8 changes: 7 additions & 1 deletion conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ for /f %%f in ('dir /b /S .\dist') do (

:: wheel file was renamed
for /f %%f in ('dir /b /S .\dist') do (
%PYTHON% -m pip install %%f
%PYTHON% -m pip install %%f ^
--no-build-isolation ^
--no-deps ^
--only-binary :all: ^
--no-index ^
--prefix %PREFIX% ^
-vv
if %ERRORLEVEL% neq 0 exit 1
)

Expand Down
8 changes: 7 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ export PATH=$CONDA_PREFIX/bin-llvm:$PATH
${PYTHON} -m build -w -n -x
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
--platform-tag manylinux2014_x86_64 dist/numba_dpex*.whl
${PYTHON} -m pip install dist/numba_dpex*.whl
${PYTHON} -m pip install dist/numba_dpex*.whl \
--no-build-isolation \
--no-deps \
--only-binary :all: \
--no-index \
--prefix "${PREFIX}" \
-vv

# Copy wheel package
if [[ -v WHEELS_OUTPUT_FOLDER ]]; then
Expand Down
34 changes: 18 additions & 16 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{% set excluded_compiler_version2 = "2024.0.2" %}
{% set excluded_compiler_version3 = "2024.0.3" %}

{% set pyproject = load_file_data('pyproject.toml') %}
{% set py_build_deps = pyproject.get('build-system', {}).get('requires', []) %}

package:
name: numba-dpex
version: {{ GIT_DESCRIBE_TAG }}
Expand All @@ -25,31 +28,30 @@ requirements:
# does not have it in meta data
- sysroot_linux-64 >=2.28 # [linux]
host:
- python
- pip >=24.0
- dpcpp-cpp-rt >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }},!={{ excluded_compiler_version3 }} # [win]
- dpcpp-cpp-rt >={{ required_compiler_version }},!={{ excluded_compiler_version1 }},!={{ excluded_compiler_version2 }} # [linux]
- python
- setuptools >=69
- scikit-build >=0.17
- ninja >=1.11.1 # [not win]
- cmake >=3.29
- numba >=0.59
- llvmlite >=0.42.0
- dpctl >=0.16.1
- dpnp >=0.14
- numpy >=1.24
{% for dep in py_build_deps %}
{% if dep.startswith('ninja') %}
- {{ dep.split(';')[0] }} # [not win]
{% elif dep.startswith('cmake') %}
- {{ dep }}
{% elif dep.startswith('build>=') %}
- {{ 'python-' ~ dep }}
{% else %}
- {{ dep|replace('_','-') }}
{% endif %}
{% endfor %}
# versioneer dependency
- tomli # [py<311]
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- dpcpp-llvm-spirv >={{ required_compiler_version }} # [not win]
- dpcpp-llvm-spirv >={{ required_compiler_version }},<2024.1 # [win]
- wheel >=0.43
- pip >=24.0
- python-build >=1.1
- versioneer==0.29
# versioneer dependency
- tomli # [py<311]
run:
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }}
# TODO: temporary fix, because IGC is broken for output produced by llvm-spirv 2024.1 on windows
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x') }} # [not win]
- {{ pin_compatible('dpcpp-llvm-spirv', min_pin='x.x', max_pin='x', upper_bound='2024.1') }} # [win]
Expand Down
19 changes: 14 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
# TODO: keep in sync with [project.dependencies] and /conda-recipe/meta.yaml
# TODO: keep in sync with [project.dependencies]
"wheel>=0.43",
"build>=1.1",
"setuptools>=63.0.0",
"scikit-build>=0.17.0",
"ninja>=1.11.1; platform_system!='Windows'",
"cmake>=3.29.0",
"numba>=0.59.0",
# We need dpctl for UsmNdArray integration for dpcpp code
"dpctl>=0.16.1",
"numpy>=1.24.0",
"wheel",
# We need numba for runtime cpp headers
"numba>=0.59.0",
"llvmlite>=0.42.0",
# Do we need dpnp at build time?
"dpnp >=0.14",
"numpy >=1.24",
# WARNING: check with doc how to upgrade
"versioneer[toml]==0.29"
]
Expand Down Expand Up @@ -39,7 +45,10 @@ dependencies = [
"dpctl>=0.16.1",
"dpnp>=0.14.0",
"numpy>=1.24.0",
"dpcpp_llvm_spirv>=2024.0"
"dpcpp_llvm_spirv>=2024.0",
# Sycl runtime dependencies
"dpcpp-cpp-rt>=0.59.0",
"intel-cmplr-lib-rt>=0.59.0"
]
description = "An extension for Numba to add data-parallel offload capability"
dynamic = ["version"]
Expand Down

0 comments on commit 59d33e7

Please sign in to comment.