Skip to content

Commit 0418aab

Browse files
committed
initial rattler-build recipe
1 parent c76f67e commit 0418aab

File tree

4 files changed

+141
-107
lines changed

4 files changed

+141
-107
lines changed

.github/workflows/conda-package.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,24 @@ jobs:
5151
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
5252
- name: Add conda to system path
5353
run: echo $CONDA/bin >> $GITHUB_PATH
54-
- name: Install conda-build
55-
run: conda install conda-build -c conda-forge --override-channels
54+
- name: Install rattler-build
55+
run: conda install conda-build rattler-build -c conda-forge --override-channels
5656
- name: Store conda paths as envs
5757
shell: bash -l {0}
5858
run: |
5959
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
60+
- name: Create variant config
61+
run: |
62+
echo "python:\n- ${{ matrix.python }}\n\nnumpy:\n - 2.0" > $GITHUB_WORKSPACE/conda-recipe/variant-config.yaml
6063
- name: Build conda package
6164
run: |
62-
# use bootstrap channel to pull NumPy linked with OpenBLAS
63-
CHANNELS="-c conda-forge --override-channels"
64-
VERSIONS="--python ${{ matrix.python }} --numpy 2.0"
65-
TEST="--no-test"
66-
conda build \
67-
$TEST \
68-
$VERSIONS \
69-
$CHANNELS \
70-
conda-recipe
65+
rattler-build build \
66+
-r $GITHUB_WORKSPACE/conda-recipe/recipe.yaml \
67+
-m $GITHUB_WORKSPACE/conda-recipe/variant-config.yaml \
68+
--test skip \
69+
--experimental \
70+
--channel-priority strict \
71+
-c ${{ env.INTEL_CHANNEL }} -c conda-forge
7172
- name: Upload artifact
7273
uses: actions/[email protected]
7374
with:
@@ -105,10 +106,10 @@ jobs:
105106
conda-remove-defaults: true
106107
python-version: ${{ matrix.python }}
107108

108-
- name: Install conda build
109+
- name: Install rattler-build
109110
run: |
110111
conda activate
111-
conda install -y conda-build
112+
conda install -y conda-build rattler-build
112113
conda list -n base
113114
114115
- name: Cache conda packages
@@ -129,13 +130,18 @@ jobs:
129130
echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV
130131
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV
131132
133+
- name: Create variant config
134+
shell: bash -l {0}
135+
run: |
136+
echo "python:\n- ${{ matrix.python }}\n\nnumpy:\n - 2.0" > $GITHUB_WORKSPACE/conda-recipe/variant-config.yaml
137+
132138
- name: Build conda package
133139
env:
134140
OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides
135141
run: |
136142
conda activate
137143
# TODO: roll back use of Intel channel when 2025.1 is available on conda-forge
138-
conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe
144+
rattler-build build -r %GITHUB_WORKSPACE%\conda-recipe\recipe.yaml -m %GITHUB_WORKSPACE%\conda-recipe\variant-config.yaml --test skip --experimental --channel-priority strict -c conda-forge
139145
140146
- name: Upload artifact
141147
uses: actions/[email protected]

conda-recipe/bld.bat renamed to conda-recipe/build.bat

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
77

88
REM Overriding IPO is useful for building in resources constrained VMs (public CI)
99
if DEFINED OVERRIDE_INTEL_IPO (
10-
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
10+
if "%OVERRIDE_INTEL_IPO%"!="" (
11+
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
12+
)
1113
)
1214

1315
FOR %%V IN (17.0.0 17 18.0.0 18 19.0.0 19 20.0.0 20) DO @(

conda-recipe/meta.yaml

Lines changed: 0 additions & 92 deletions
This file was deleted.

conda-recipe/recipe.yaml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
schema_version: 1
2+
3+
context:
4+
name: dpctl
5+
git_repo_url: "https://github.com/IntelPython/dpctl.git"
6+
latest_tag: ${{ git.latest_tag( git_repo_url ) }}
7+
version: ${{ latest_tag }}
8+
buildnumber: ${{ GIT_DESCRIBE_NUMBER }}
9+
required_compiler_version: "2024.2.0"
10+
11+
package:
12+
name: ${{ name }}
13+
version: ${{ version }}
14+
15+
source:
16+
path: ..
17+
use_gitignore: false
18+
19+
build:
20+
number: ${{buildnumber}}
21+
script:
22+
env:
23+
WHEELS_OUTPUT_FOLDER: ${{ env.get("WHEELS_OUTPUT_FOLDER", default="") }}
24+
OVERRIDE_INTEL_IPO: ${{ env.get("OVERRIDE_INTEL_IPO", default="") }}
25+
26+
requirements:
27+
ignore_run_exports:
28+
by_name:
29+
- level-zero
30+
# TODO: keep in sync with /pyproject.toml
31+
build:
32+
- ${{ compiler('cxx') }}
33+
- ${{ stdlib('c') }}
34+
- ${{ compiler('dpcpp') }} >= ${{ required_compiler_version }}
35+
host:
36+
- python
37+
- pip >=24.0
38+
- level-zero-devel >=1.16
39+
- pybind11 >=2.12
40+
- ${{ pin_compatible('intel-sycl-rt', lower_bound='x.x', upper_bound='x') }}
41+
- ${{ pin_compatible('intel-cmplr-lib-rt', lower_bound='x.x', upper_bound='x') }}
42+
# Ensure we are using latest version of setuptools, since we don't need
43+
# editable environments for release.
44+
- setuptools >=63.0
45+
- wheel>=0.43
46+
- python-build>=1.1
47+
- scikit-build>=0.17.0
48+
- if: linux
49+
then:
50+
- ninja>=1.11.1
51+
- cmake>=3.29.0
52+
- if: match(python, ">=3.13")
53+
then:
54+
- cython>=3.0.10,<3.1.0
55+
- if: match(python, "<3.13")
56+
then:
57+
- cython>=3.0.10
58+
- numpy>=1.23
59+
# WARNING: check with doc how to upgrade
60+
- versioneer==0.29
61+
# versioneer dependency
62+
- if: python < "3.11"
63+
then:
64+
- tomli
65+
run:
66+
- python
67+
- ${{ pin_compatible('intel-sycl-rt', lower_bound='x.x', upper_bound='x') }}
68+
- ${{ pin_compatible('intel-cmplr-lib-rt', lower_bound='x.x', upper_bound='x') }}
69+
- numpy
70+
71+
tests:
72+
- script:
73+
- if: linux
74+
then:
75+
- run_test.sh
76+
- if: win
77+
then:
78+
- run_test.bat
79+
files:
80+
recipe:
81+
- run_test.sh
82+
- run_test.bat
83+
requirements:
84+
run:
85+
- ${{ compiler('c') }}
86+
- ${{ compiler('cxx') }}
87+
- ${{ stdlib('c') }}
88+
- if: match(python, ">=3.13")
89+
then:
90+
- cython>=3.0.10,<3.1.0
91+
- if: match(python, "<3.13")
92+
then:
93+
- cython>=3.0.10
94+
- setuptools
95+
- pytest
96+
- pytest-cov
97+
98+
about:
99+
homepage: https://github.com/IntelPython/dpctl.git
100+
license: Apache-2.0
101+
license_file: LICENSE
102+
summary: 'A lightweight Python wrapper for a subset of SYCL API.'
103+
description: |
104+
<strong>LEGAL NOTICE: Use of this software package is subject to the
105+
software license agreement (as set forth above, in the license section of
106+
the installed Conda package and/or the README file) and all notices,
107+
disclaimers or license terms for third party or open source software
108+
included in or with the software.</strong>
109+
<br/><br/>
110+
EULA: <a href="https://opensource.org/licenses/Apache-2.0" target="_blank">Apache-2.0</a>
111+
<br/><br/>
112+
113+
extra:
114+
recipe-maintainers:
115+
- ndgrigorian
116+
- antonwolfy
117+
- vtavana
118+
- vlad-perevezentsev

0 commit comments

Comments
 (0)