Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ extend-ignore = E203, W503
show-source = True

exclude =
versioneer.py
dpctl/_version.py
build
conda.recipe
.git
Expand Down
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# *.bat text eol=crlf
* text=auto eol=lf

dpctl/_version.py export-subst
.git_archival.txt export-subst
8 changes: 4 additions & 4 deletions .github/workflows/adaptivecpp-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ jobs:
"adaptivecpp=*=cpu_llvm19*" "clang=19.*" "clangxx=19.*" \
"hip-runtime-amd=6.*" \
intel-opencl-rt \
cmake cython ninja numpy pybind11 pytest scikit-build "setuptools<80" versioneer
cmake cython cython-cmake ninja numpy pybind11 pytest scikit-build-core \
setuptools setuptools-scm

- name: Report the environment
run: |
Expand Down Expand Up @@ -113,9 +114,8 @@ jobs:
for d in ${SYCL_EXAMPLES}; do
pushd "examples/${d}" > /dev/null
CC="${CONDA_PREFIX}/bin/clang" CXX="${CONDA_PREFIX}/bin/acpp" \
python setup.py build_ext --inplace -G Ninja -- \
-DDPCTL_SYCL_PROVIDER=AdaptiveCpp \
-DDpctl_DIR="${GITHUB_WORKSPACE}/cmake"
python -m pip install --no-build-isolation --no-deps -e . \
--config-settings=cmake.define.DPCTL_SYCL_PROVIDER=AdaptiveCpp
popd > /dev/null
done
for d in ${C_EXAMPLES}; do
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# versioneer needs the tags to compute the package version
# setuptools-scm needs the tags to compute the package version
fetch-depth: 0
persist-credentials: false

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:

- name: Install dpctl dependencies
run: |
pip install numpy cython setuptools"<80" scikit-build"<1.0" cmake ninja versioneer[toml]==0.29
pip install numpy cython scikit-build-core setuptools-scm cython-cmake cmake ninja

- name: Report compiler version
run: |
Expand Down Expand Up @@ -105,7 +105,9 @@ jobs:
run: |
set -o pipefail
source "${ONEAPI_ROOT}/setvars.sh"
# --skip-editable: build_ext --inplace already compiled everything
rm -rf build
# --skip-editable: a regular install is enough for Coverity to see
# all compilation units
cov-build --dir cov-int \
python scripts/build_locally.py --oneapi --skip-editable --verbose \
2>&1 | tee cov-build.log
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Install dpctl dependencies
shell: bash -l {0}
run: |
pip install numpy cython setuptools"<80" pytest pytest-cov scikit-build"<1.0" cmake coverage[toml] versioneer[toml]==0.29
pip install numpy cython pytest pytest-cov scikit-build-core setuptools-scm cython-cmake cmake ninja coverage[toml]

- name: Build dpctl with coverage
shell: bash -l {0}
Expand All @@ -113,7 +113,7 @@ jobs:
shell: bash -l {0}
run: |
echo "Processing c-api-coverage"
DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
DPCTL_LCOV_FN=$(find build/coverage -name dpctl.lcov)
export DPCTL_LCOV_FN
grep "/tmp" "$DPCTL_LCOV_FN"
coveralls-lcov -v -n \
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ jobs:
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
shell: bash -l {0}
run: |
pip install numpy cython setuptools">=70.1" scikit-build"<1.0" cmake sphinx"<7.2" pydot graphviz furo \
pip install numpy cython scikit-build-core setuptools-scm cython-cmake cmake ninja sphinx"<7.2" pydot graphviz furo \
sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx-design \
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling \
versioneer[toml]==0.29
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -78,7 +77,7 @@ jobs:
tar xf doxyrest-2.1.2-linux-amd64.tar.xz
python scripts/gen_docs.py --doxyrest-root="$(pwd)/doxyrest-2.1.2-linux-amd64" --verbose --multiversion --clean || exit 1
python -c "import dpctl; print(dpctl.__version__)" || exit 1
mv "$(find _skbuild -type d -path "*/cmake-install/docs/docs" | head -n 1)" ~/docs
mv build/docs/docs/docs ~/docs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backfill-docs.yml is not in this PR and still builds with setup.py build_ext and looks in _skbuild, so it will fail for every tag made after this PR. It could build like this workflow, with gen_docs.py and build/docs, when the tag has no setup.py.

git clean -dfx
git reset --hard
- name: Publish docs
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/intel-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# versioneer takes the version from git describe.
# setuptools-scm takes the version from the git tags.
fetch-depth: 0

- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
# oneMKL example looks for, and intel-opencl-rt provides the OpenCL CPU device to run them on
run: |
conda create -y -p "$RUNNER_TEMP/examples" "$DPCTL_SPEC" "$PYTHON_SPEC" pytest \
"setuptools<72.2.0" cmake ninja pybind11 cython "scikit-build<1.0" \
"setuptools<72.2.0" cmake ninja pybind11 cython cython-cmake scikit-build-core \
mkl-dpcpp mkl-devel-dpcpp tbb-devel intel-opencl-rt \
-c "$RUNNER_TEMP/channel" -c conda-forge --override-channels
conda create -y -p "$RUNNER_TEMP/build_env" \
Expand All @@ -261,7 +261,7 @@ jobs:
while IFS= read -r d; do
pushd "$d" > /dev/null
conda activate --stack "$RUNNER_TEMP/build_env"
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja
CC=icx CXX=icpx python -m pip install --no-build-isolation --no-deps -e .
conda deactivate
if [ -e tests ]; then
LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" python -m pytest tests
Expand All @@ -278,7 +278,7 @@ jobs:
while IFS= read -r d; do
pushd "$d" > /dev/null
conda activate --stack "$RUNNER_TEMP/build_env"
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja
CC=icx CXX=icpx python -m pip install --no-build-isolation --no-deps -e .
conda deactivate
python -m pytest tests
popd > /dev/null
Expand Down Expand Up @@ -350,7 +350,7 @@ jobs:
run: |
@echo on
call conda create -y -p "%RUNNER_TEMP%\examples" "%DPCTL_SPEC%" "%PYTHON_SPEC%" pytest ^
"setuptools<72.2.0" cmake ninja pybind11 cython "scikit-build<1.0" ^
"setuptools<72.2.0" cmake ninja pybind11 cython cython-cmake scikit-build-core ^
mkl-dpcpp mkl-devel-dpcpp tbb-devel intel-opencl-rt ^
-c "%RUNNER_TEMP%\channel" -c conda-forge --override-channels || exit /b 1
call conda create -y -p "%RUNNER_TEMP%\build_env" "%DPCPP_CMPLR%" vs2022_win-64 ^
Expand Down Expand Up @@ -392,7 +392,7 @@ jobs:
REM endlocal drops the compiler's PATH, which conda deactivate leaves behind
setlocal
call conda activate --stack "%RUNNER_TEMP%\build_env" || exit /b 1
python setup.py build_ext --inplace -G Ninja || exit /b 1
python -m pip install --no-build-isolation --no-deps -e . || exit /b 1
endlocal
if exist tests (
python -m pytest -v tests || exit /b 1
Expand All @@ -415,7 +415,7 @@ jobs:
REM endlocal drops the compiler's PATH, which conda deactivate leaves behind
setlocal
call conda activate --stack "%RUNNER_TEMP%\build_env" || exit /b 1
python setup.py build_ext --inplace -G Ninja || exit /b 1
python -m pip install --no-build-isolation --no-deps -e . || exit /b 1
endlocal
python -m pytest -v tests || exit /b 1
popd
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/os-llvm-sycl-build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
run: |
$ErrorActionPreference = 'Stop'
$PSNativeCommandUseErrorActionPreference = $true
python -m pip install numpy cython "setuptools<80" pytest "scikit-build<1.0" cmake ninja "versioneer[toml]==0.29"
python -m pip install numpy cython pytest scikit-build-core setuptools-scm cython-cmake cmake ninja

- name: Build GTest
shell: pwsh
Expand Down Expand Up @@ -187,15 +187,15 @@ jobs:
--compiler-root="%SYCL_BUNDLE_FOLDER%\dpcpp_compiler\bin" ^
--cmake-opts="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF -DDPCTL_BUILD_CAPI_TESTS=ON -DGTest_DIR=%GTEST_DIR%" || exit /b 1
set "BUILD_DIR="
for /d %%d in (_skbuild\*) do (
for /d %%d in (build\*) do (
if defined BUILD_DIR (
echo ::error::more than one build directory in _skbuild
echo ::error::more than one build directory in build
exit /b 1
)
set "BUILD_DIR=%CD%\%%d\cmake-build"
set "BUILD_DIR=%CD%\%%d"
)
if not defined BUILD_DIR (
echo ::error::no build directory in _skbuild
echo ::error::no build directory in build
exit /b 1
)
echo BUILD_DIR=%BUILD_DIR%>> "%GITHUB_ENV%"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/os-llvm-sycl-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
- name: Install dpctl dependencies
shell: bash -l {0}
run: |
pip install numpy cython setuptools"<80" pytest scikit-build"<1.0" cmake ninja versioneer[toml]==0.29
pip install numpy cython pytest scikit-build-core setuptools-scm cython-cmake cmake ninja

- name: Create set_allvars.sh
shell: bash -l {0}
Expand Down Expand Up @@ -217,13 +217,13 @@ jobs:
shell: bash -l {0}
run: |
source set_allvars.sh
cmake --build _skbuild/*/cmake-build --target dpctl_c_api_tests
cmake --build build/* --target dpctl_c_api_tests

- name: Run C-API tests
shell: bash -l {0}
env:
DPCTL_VERBOSITY: warning
run: |
source set_allvars.sh
cd _skbuild/*/cmake-build/libsyclinterface/tests
cd build/*/libsyclinterface/tests
./dpctl_c_api_tests
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ __pycache__/

# CMake build and local install directory
build
_skbuild
build_cmake

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Existing checkouts keep their _skbuild/ tree, which now shows up in git status, and the sdist packs it, since scikit-build-core follows .gitignore. Keeping _skbuild here avoids both.

install

Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ repos:
rev: 26.10.1
hooks:
- id: black
exclude: "versioneer.py|dpctl/_version.py"
- repo: https://github.com/pycqa/isort
rev: 9.0.2
hooks:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Changed the development packages on `dppy/label/dev` to build against conda-forge only, and the wheels there to declare `intel-sycl-rt` and `intel-cmplr-lib-rt` in their metadata, at least the compiler version they were built with [gh-2409](https://github.com/IntelPython/dpctl/pull/2409)
* Changed the conda recipe's tests to `pip check`, the import and `python -m dpctl -f`, as in the conda-forge feedstock, so `conda build` and `conda build --test` no longer run the test suite; run it with `ci/hooks.py`, or with `python -m pytest --pyargs dpctl` in an environment with dpctl installed [gh-2409](https://github.com/IntelPython/dpctl/pull/2409)
* Changed the install instructions in `README.md` and the documentation to conda-forge and PyPI [gh-2409](https://github.com/IntelPython/dpctl/pull/2409)
* Build with `scikit-build-core` instead of `scikit-build` and `setuptools`, and compute the version with `setuptools-scm` instead of `versioneer` [gh-2345](https://github.com/IntelPython/dpctl/pull/2345)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This line could also say what changes for developers: setup.py is gone (build with pip install ., add -e to develop), and build_locally.py --skip-editable now installs dpctl into the environment instead of building in place.


## [0.23.0] - Oct. 22, 2026

Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ target_link_libraries(DpctlCAPI INTERFACE DPCTLSyclInterfaceHeaders)

install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/dpctl/apis/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl/include
DESTINATION dpctl/include
FILES_MATCHING REGEX "\\.h(pp)?$"
)

Expand All @@ -196,9 +196,15 @@ file(GLOB _cmake_scripts ${CMAKE_SOURCE_DIR}/cmake/*.cmake)
install(FILES ${_cmake_scripts}
DESTINATION dpctl/resources/cmake
)
# Installed into the environment prefix, not site-packages
if(DEFINED SKBUILD_DATA_DIR)
set(_dpctl_config_dest ${SKBUILD_DATA_DIR}/lib/cmake/dpctl)
else()
set(_dpctl_config_dest lib/cmake/dpctl)
endif()
install(FILES
${CMAKE_SOURCE_DIR}/cmake/dpctl-config.cmake
DESTINATION lib/cmake/dpctl
DESTINATION ${_dpctl_config_dest}
)

if (DPCTL_GENERATE_DOCS)
Expand Down
5 changes: 3 additions & 2 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

"%PYTHON%" setup.py clean --all

REM useful for building in resources constrained VMs (public CI)
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"

Expand All @@ -22,6 +20,9 @@ set "CC=icx"
set "CXX=icx"

set "CMAKE_GENERATOR=Ninja"
:: Set by the VS activation, but not supported by Ninja
set "CMAKE_GENERATOR_PLATFORM="
set "CMAKE_GENERATOR_TOOLSET="
:: Make CMake verbose
set "VERBOSE=1"

Expand Down
4 changes: 0 additions & 4 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export ICPXCFG
ICXCFG="$(pwd)/icpx_for_conda.cfg"
export ICXCFG

if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi

export CC=icx
export CXX=icpx

Expand Down
10 changes: 3 additions & 7 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,13 @@ requirements:
- pybind11 >=3.0.2
- intel-sycl-rt
- intel-cmplr-lib-rt
# Ensure we are using latest version of setuptools, since we don't need
# editable environments for release.
- setuptools >=69
- wheel >=0.43
- python-build >=1.1
- scikit-build >=0.17.0,<1.0
- scikit-build-core >=0.11
- setuptools-scm >=8
- cython-cmake >=0.2
- cython >=3.1.0 # [py>=313]
- cython >=3.0.10 # [py<313]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: CMake now requires Cython 3.1 (find_package(Cython MODULE REQUIRED VERSION 3.1)), so this could be cython >=3.1.0 for every Python, as in pyproject.toml.

- numpy
# WARNING: check with doc how to upgrade
- versioneer ==0.29
run:
- python
- {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }}
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (DPCTL_ENABLE_DOXYREST)
endif()

# Set the location where the generated docs are saved
set(DOC_OUTPUT_DIR ${CMAKE_INSTALL_PREFIX}/docs)
set(DOC_OUTPUT_DIR ${CMAKE_BINARY_DIR}/docs)

# set(INDEX_NO_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_no_doxyrest.rst.in)
# set(INDEX_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_doxyrest.rst.in)
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Generating The Documentation

The helper script ``scripts/gen_docs.py`` is the preferred way to generate the
documentation. The generated documentation HTML pages are installed to the
``CMAKE_INSTALL_PREFIX/docs`` directory.
``docs`` directory in the CMake build directory.

----------------------------
```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/doc_sources/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ The package ``dpctl`` provides
* Extension generators
- :ref:`Declarations <dpctl_cython_api>` for classes defined in :py:mod:`dpctl` and supporting functions for use in `Cython <cython_docs_>`_.
- :ref:`Integration <dpctl_pybind11_api>` with `pybind11 <pybind11_docs_>`_ defines type casters connecting SYCL classes and Python classes, as well as defines C++ classes wrapping a Python object for :mod:`dpctl.memory` objects.
- :ref:`Integration <dpctl_cmake_support>` with `CMake <cmake_docs_>`_ to simplify building DPC++-based Python extension using `scikit-build <skbuild_docs_>`_.
- :ref:`Integration <dpctl_cmake_support>` with `CMake <cmake_docs_>`_ to simplify building DPC++-based Python extension using `scikit-build-core <skbuild_docs_>`_.
* C API for DPC++ runtime
- :doc:`DPCTLSyclInterface C library <libsyclinterface/generated/index>`


.. _cmake_docs: https://cmake.org/documentation/
.. _cython_docs: https://cython.readthedocs.io/en/latest/
.. _skbuild_docs: https://scikit-build.readthedocs.io/en/latest/
.. _skbuild_docs: https://scikit-build-core.readthedocs.io/en/latest/
.. _pybind11_docs: https://pybind11.readthedocs.io/en/stable/

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_sources/beginners_guides/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ One way to create such environment is as follows:

conda create -n dev_dpctl -c conda-forge python=3.12 pip
conda activate dev_dpctl
pip install --no-cache-dir numpy cython scikit-build cmake ninja pytest
pip install --no-cache-dir numpy cython cython-cmake scikit-build-core setuptools-scm cmake ninja pytest

Using such environment and with DPC++ compiler activated, build the project using

Expand Down
Loading
Loading