diff --git a/.github/workflows/conda-package.yml b/.github/workflows/conda-package.yml index 3683807525..17676beab5 100644 --- a/.github/workflows/conda-package.yml +++ b/.github/workflows/conda-package.yml @@ -51,23 +51,24 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}- - name: Add conda to system path run: echo $CONDA/bin >> $GITHUB_PATH - - name: Install conda-build - run: conda install conda-build -c conda-forge --override-channels + - name: Install rattler-build + run: conda install conda-build rattler-build -c conda-forge --override-channels - name: Store conda paths as envs shell: bash -l {0} run: | echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV + - name: Create variant config + run: | + echo "python:\n- ${{ matrix.python }}\n\nnumpy:\n - 2.0" > $GITHUB_WORKSPACE/conda-recipe/variant-config.yaml - name: Build conda package run: | - # use bootstrap channel to pull NumPy linked with OpenBLAS - CHANNELS="-c conda-forge --override-channels" - VERSIONS="--python ${{ matrix.python }} --numpy 2.0" - TEST="--no-test" - conda build \ - $TEST \ - $VERSIONS \ - $CHANNELS \ - conda-recipe + 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 - name: Upload artifact uses: actions/upload-artifact@v4.6.2 with: @@ -105,10 +106,10 @@ jobs: conda-remove-defaults: true python-version: ${{ matrix.python }} - - name: Install conda build + - name: Install rattler-build run: | conda activate - conda install -y conda-build + conda install -y conda-build rattler-build conda list -n base - name: Cache conda packages @@ -129,13 +130,18 @@ jobs: echo "CONDA_BLD=$CONDA/conda-bld/win-64/" | tr "\\\\" '/' >> $GITHUB_ENV echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE${{ runner.os == 'Linux' && '/' || '\\' }}" >> $GITHUB_ENV + - name: Create variant config + shell: bash -l {0} + run: | + echo "python:\n- ${{ matrix.python }}\n\nnumpy:\n - 2.0" > $GITHUB_WORKSPACE/conda-recipe/variant-config.yaml + - name: Build conda package env: OVERRIDE_INTEL_IPO: 1 # IPO requires more resources that GH actions VM provides run: | conda activate # TODO: roll back use of Intel channel when 2025.1 is available on conda-forge - conda build --no-test --python ${{ matrix.python }} --numpy 2.0 -c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels conda-recipe + 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 ${{ env.INTEL_CHANNEL }} -c conda-forge - name: Upload artifact uses: actions/upload-artifact@v4.6.2 diff --git a/conda-recipe/bld.bat b/conda-recipe/build.bat similarity index 94% rename from conda-recipe/bld.bat rename to conda-recipe/build.bat index 69ce621862..68fa9a5a9f 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/build.bat @@ -7,7 +7,9 @@ set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%" REM Overriding IPO is useful for building in resources constrained VMs (public CI) if DEFINED OVERRIDE_INTEL_IPO ( - set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE" + if "%OVERRIDE_INTEL_IPO%"!="" ( + set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE" + ) ) FOR %%V IN (17.0.0 17 18.0.0 18 19.0.0 19 20.0.0 20) DO @( diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml deleted file mode 100644 index 812362a627..0000000000 --- a/conda-recipe/meta.yaml +++ /dev/null @@ -1,92 +0,0 @@ -{% set required_compiler_version = "2024.2.0" %} - -{% set pyproject = load_file_data('pyproject.toml') %} -{% set py_build_deps = pyproject.get('build-system', {}).get('requires', []) %} - -package: - name: dpctl - version: {{ GIT_DESCRIBE_TAG }} - -source: - path: .. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - script_env: - - WHEELS_OUTPUT_FOLDER - - OVERRIDE_INTEL_IPO # [win] - ignore_run_exports: - - level-zero - -requirements: - # TODO: keep in sync with /pyproject.toml - build: - - {{ compiler('cxx') }} - - {{ stdlib('c') }} - - {{ compiler('dpcpp') }} >={{ required_compiler_version }} - host: - - python - - pip >=24.0 - - level-zero-devel >=1.16 - - pybind11 >=2.12 - - {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }} - - {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }} - # Ensure we are using latest version of setuptools, since we don't need - # editable environments for release. - - setuptools >=69 - {% 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 }} - {% elif dep.startswith('cython') %} - {% if dep.split(';')[1] == "python_version<'3.13'" %} - - {{ dep.split(';')[0] }} # [py<313] - {% else %} - - {{ dep.split(';')[0] }} # [py>=313] - {% endif %} - {% else %} - - {{ dep|replace('_','-') }} - {% endif %} - {% endfor %} - # versioneer dependency - - tomli # [py<311] - run: - - python - - {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }} - - {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }} - - numpy - -test: - requires: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - {{ stdlib('c') }} - - cython - - setuptools - - pytest - - pytest-cov - -about: - home: https://github.com/IntelPython/dpctl.git - license: Apache-2.0 - license_file: LICENSE - summary: 'A lightweight Python wrapper for a subset of SYCL API.' - description: | - LEGAL NOTICE: Use of this software package is subject to the - software license agreement (as set forth above, in the license section of - the installed Conda package and/or the README file) and all notices, - disclaimers or license terms for third party or open source software - included in or with the software. -

- EULA: Apache-2.0 -

- -extra: - recipe-maintainers: - - ndgrigorian - - antonwolfy - - vtavana - - vlad-perevezentsev diff --git a/conda-recipe/recipe.yaml b/conda-recipe/recipe.yaml new file mode 100644 index 0000000000..fe2deae655 --- /dev/null +++ b/conda-recipe/recipe.yaml @@ -0,0 +1,118 @@ +schema_version: 1 + +context: + name: dpctl + git_repo_url: "https://github.com/IntelPython/dpctl.git" + latest_tag: ${{ git.latest_tag( git_repo_url ) }} + version: ${{ latest_tag }} + buildnumber: ${{ GIT_DESCRIBE_NUMBER }} + required_compiler_version: "2024.2.0" + +package: + name: ${{ name }} + version: ${{ version }} + +source: + path: .. + use_gitignore: false + +build: + number: ${{buildnumber}} + script: + env: + WHEELS_OUTPUT_FOLDER: ${{ env.get("WHEELS_OUTPUT_FOLDER", default="") }} + OVERRIDE_INTEL_IPO: ${{ env.get("OVERRIDE_INTEL_IPO", default="") }} + +requirements: + ignore_run_exports: + by_name: + - level-zero + # TODO: keep in sync with /pyproject.toml + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - ${{ compiler('dpcpp') }} >= ${{ required_compiler_version }} + host: + - python + - pip >=24.0 + - level-zero-devel >=1.16 + - pybind11 >=2.12 + - ${{ pin_compatible('intel-sycl-rt', lower_bound='x.x', upper_bound='x') }} + - ${{ pin_compatible('intel-cmplr-lib-rt', lower_bound='x.x', upper_bound='x') }} + # Ensure we are using latest version of setuptools, since we don't need + # editable environments for release. + - setuptools >=63.0 + - wheel>=0.43 + - python-build>=1.1 + - scikit-build>=0.17.0 + - if: linux + then: + - ninja>=1.11.1 + - cmake>=3.29.0 + - if: match(python, ">=3.13") + then: + - cython>=3.0.10,<3.1.0 + - if: match(python, "<3.13") + then: + - cython>=3.0.10 + - numpy>=1.23 + # WARNING: check with doc how to upgrade + - versioneer==0.29 + # versioneer dependency + - if: python < "3.11" + then: + - tomli + run: + - python + - ${{ pin_compatible('intel-sycl-rt', lower_bound='x.x', upper_bound='x') }} + - ${{ pin_compatible('intel-cmplr-lib-rt', lower_bound='x.x', upper_bound='x') }} + - numpy + +tests: + - script: + - if: linux + then: + - run_test.sh + - if: win + then: + - run_test.bat + files: + recipe: + - run_test.sh + - run_test.bat + requirements: + run: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - if: match(python, ">=3.13") + then: + - cython>=3.0.10,<3.1.0 + - if: match(python, "<3.13") + then: + - cython>=3.0.10 + - setuptools + - pytest + - pytest-cov + +about: + homepage: https://github.com/IntelPython/dpctl.git + license: Apache-2.0 + license_file: LICENSE + summary: 'A lightweight Python wrapper for a subset of SYCL API.' + description: | + LEGAL NOTICE: Use of this software package is subject to the + software license agreement (as set forth above, in the license section of + the installed Conda package and/or the README file) and all notices, + disclaimers or license terms for third party or open source software + included in or with the software. +

+ EULA: Apache-2.0 +

+ +extra: + recipe-maintainers: + - ndgrigorian + - antonwolfy + - vtavana + - vlad-perevezentsev