From 0ff743691565148f6a8d6a5a38adda26426c1ae7 Mon Sep 17 00:00:00 2001 From: antonwolfy <100830759+antonwolfy@users.noreply.github.com> Date: Sat, 18 Oct 2025 02:45:23 +0000 Subject: [PATCH 1/2] chore: update pre-commit hooks --- .pre-commit-config.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e85881dd4e..c49561b043 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,23 +2,23 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/PyCQA/bandit - rev: '1.8.3' + rev: '1.8.6' hooks: - id: bandit pass_filenames: false args: ["-r", "dpctl", "-lll"] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 25.9.0 hooks: - id: black exclude: "versioneer.py|dpctl/_version.py" - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort name: isort (python) @@ -29,7 +29,7 @@ repos: name: isort (pyi) types: [pyi] - repo: https://github.com/pycqa/flake8 - rev: 7.1.0 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/pocc/pre-commit-hooks @@ -38,12 +38,12 @@ repos: - id: clang-format args: ["-i"] - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks - rev: v2.12.0 + rev: v2.15.0 hooks: - id: pretty-format-toml args: [--autofix] - repo: https://github.com/MarcoGorelli/cython-lint - rev: v0.16.6 + rev: v0.18.0 hooks: - id: cython-lint - id: double-quote-cython-strings From e66d90e86b3aa2272e3383aed7e8beb4d6f5f2b5 Mon Sep 17 00:00:00 2001 From: Nikita Grigorian Date: Wed, 22 Oct 2025 13:27:58 -0700 Subject: [PATCH 2/2] Apply new version of black linter --- docs/_legacy/generate_rst.py | 4 ++-- dpctl/__init__.py | 8 ++++---- dpctl/memory/__init__.py | 18 +++++++++--------- dpctl/program/__init__.py | 6 +++--- dpctl/tensor/__init__.py | 10 +++++----- dpctl/tests/conftest.py | 3 +-- dpctl/tests/helper/__init__.py | 3 +-- dpctl/tests/test_service.py | 3 +-- dpctl/tests/test_sycl_context.py | 3 +-- dpctl/tests/test_sycl_device.py | 3 +-- dpctl/tests/test_sycl_device_factory.py | 3 +-- dpctl/tests/test_sycl_event.py | 3 +-- dpctl/tests/test_sycl_kernel_submit.py | 3 +-- dpctl/tests/test_sycl_platform.py | 3 +-- dpctl/tests/test_sycl_program.py | 3 +-- dpctl/tests/test_sycl_queue.py | 3 +-- dpctl/tests/test_sycl_queue_manager.py | 3 +-- dpctl/tests/test_sycl_queue_memcpy.py | 3 +-- dpctl/tests/test_sycl_usm.py | 3 +-- dpctl/tests/test_utils.py | 3 +-- examples/python/device_selection.py | 3 +-- examples/python/filter_selection.py | 3 +-- examples/python/lsplatform.py | 3 +-- 23 files changed, 41 insertions(+), 59 deletions(-) diff --git a/docs/_legacy/generate_rst.py b/docs/_legacy/generate_rst.py index c4e4c25888..e5b9552991 100644 --- a/docs/_legacy/generate_rst.py +++ b/docs/_legacy/generate_rst.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" The module provides helper functions to generate API documentation for - dpctl and its members. +"""The module provides helper functions to generate API documentation for +dpctl and its members. """ import argparse diff --git a/dpctl/__init__.py b/dpctl/__init__.py index 9e1b52432d..8c53ed7253 100644 --- a/dpctl/__init__.py +++ b/dpctl/__init__.py @@ -15,11 +15,11 @@ # limitations under the License. """ - **Data Parallel Control (dpctl)** is a Python abstraction layer over SYCL. +**Data Parallel Control (dpctl)** is a Python abstraction layer over SYCL. - Dpctl implements a subset of SYCL's API providing wrappers for the - SYCL runtime classes described in :sycl_runtime_classes:`Section 4.6 <>` of - the :sycl_spec_2020:`SYCL 2020 spec <>`. +Dpctl implements a subset of SYCL's API providing wrappers for the +SYCL runtime classes described in :sycl_runtime_classes:`Section 4.6 <>` of +the :sycl_spec_2020:`SYCL 2020 spec <>`. """ __author__ = "Intel Corp." diff --git a/dpctl/memory/__init__.py b/dpctl/memory/__init__.py index 7c86ec7aee..9b77f66244 100644 --- a/dpctl/memory/__init__.py +++ b/dpctl/memory/__init__.py @@ -15,17 +15,17 @@ # limitations under the License. """ - **Data Parallel Control Memory** provides Python objects for untyped USM - memory container of bytes for each kind of USM pointers: shared pointers, - device pointers and host pointers. +**Data Parallel Control Memory** provides Python objects for untyped USM +memory container of bytes for each kind of USM pointers: shared pointers, +device pointers and host pointers. - Shared and host pointers are accessible from both host and a device, - while device pointers are only accessible from device. +Shared and host pointers are accessible from both host and a device, +while device pointers are only accessible from device. - Python objects corresponding to shared and host pointers implement - Python simple buffer protocol. It is therefore possible to use these - objects to maniputalate USM memory using NumPy or `bytearray`, - `memoryview`, or `array.array` classes. +Python objects corresponding to shared and host pointers implement +Python simple buffer protocol. It is therefore possible to use these +objects to maniputalate USM memory using NumPy or `bytearray`, +`memoryview`, or `array.array` classes. """ from ._memory import ( diff --git a/dpctl/program/__init__.py b/dpctl/program/__init__.py index a96d33f04a..bddc8ae49b 100644 --- a/dpctl/program/__init__.py +++ b/dpctl/program/__init__.py @@ -15,9 +15,9 @@ # limitations under the License. """ - **Data Parallel Control Program** provides a way to create a SYCL kernel - from either an OpenCL program represented as a string or a SPIR-V binary - file. +**Data Parallel Control Program** provides a way to create a SYCL kernel +from either an OpenCL program represented as a string or a SPIR-V binary +file. """ from ._program import ( diff --git a/dpctl/tensor/__init__.py b/dpctl/tensor/__init__.py index df10879b68..1e1de32126 100644 --- a/dpctl/tensor/__init__.py +++ b/dpctl/tensor/__init__.py @@ -15,12 +15,12 @@ # limitations under the License. """ - **Data Parallel Tensor** provides an N-dimensional array container - backed by typed USM allocations and implements operations to - create and manipulate such arrays, as well as perform operations - on arrays in conformance with Python Array API standard. +**Data Parallel Tensor** provides an N-dimensional array container +backed by typed USM allocations and implements operations to +create and manipulate such arrays, as well as perform operations +on arrays in conformance with Python Array API standard. - [ArrayAPI] https://data-apis.org/array-api +[ArrayAPI] https://data-apis.org/array-api """ from dpctl.tensor._copy_utils import asnumpy, astype, copy, from_numpy, to_numpy diff --git a/dpctl/tests/conftest.py b/dpctl/tests/conftest.py index 2c265b5dd1..be5719aba4 100644 --- a/dpctl/tests/conftest.py +++ b/dpctl/tests/conftest.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Configures pytest to discover helper/ module -""" +"""Configures pytest to discover helper/ module""" import os import sys diff --git a/dpctl/tests/helper/__init__.py b/dpctl/tests/helper/__init__.py index 9734c5251d..5fa83345d3 100644 --- a/dpctl/tests/helper/__init__.py +++ b/dpctl/tests/helper/__init__.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Helper module for dpctl/tests -""" +"""Helper module for dpctl/tests""" from ._helper import ( create_invalid_capsule, diff --git a/dpctl/tests/test_service.py b/dpctl/tests/test_service.py index 842f9c2498..da60eac605 100644 --- a/dpctl/tests/test_service.py +++ b/dpctl/tests/test_service.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for miscellaneous functions. -""" +"""Defines unit test cases for miscellaneous functions.""" import ctypes import ctypes.util diff --git a/dpctl/tests/test_sycl_context.py b/dpctl/tests/test_sycl_context.py index 6c496a24bb..0cb222573b 100644 --- a/dpctl/tests/test_sycl_context.py +++ b/dpctl/tests/test_sycl_context.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for the :class:`dpctl.SyclContext` class. -""" +"""Defines unit test cases for the :class:`dpctl.SyclContext` class.""" import pytest diff --git a/dpctl/tests/test_sycl_device.py b/dpctl/tests/test_sycl_device.py index f3ad9ee478..4ec990cbc7 100644 --- a/dpctl/tests/test_sycl_device.py +++ b/dpctl/tests/test_sycl_device.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for the SyclDevice class. -""" +"""Defines unit test cases for the SyclDevice class.""" import pytest diff --git a/dpctl/tests/test_sycl_device_factory.py b/dpctl/tests/test_sycl_device_factory.py index 3317ba17fb..dabecf9247 100644 --- a/dpctl/tests/test_sycl_device_factory.py +++ b/dpctl/tests/test_sycl_device_factory.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for the _sycl_device_factory module -""" +"""Defines unit test cases for the _sycl_device_factory module""" import pytest diff --git a/dpctl/tests/test_sycl_event.py b/dpctl/tests/test_sycl_event.py index fb0c96862c..2405cbe6be 100644 --- a/dpctl/tests/test_sycl_event.py +++ b/dpctl/tests/test_sycl_event.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for the SyclEvent class. -""" +"""Defines unit test cases for the SyclEvent class.""" import pytest diff --git a/dpctl/tests/test_sycl_kernel_submit.py b/dpctl/tests/test_sycl_kernel_submit.py index fc03e7aaf0..3b5c08349b 100644 --- a/dpctl/tests/test_sycl_kernel_submit.py +++ b/dpctl/tests/test_sycl_kernel_submit.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for kernel submission to a sycl::queue. -""" +"""Defines unit test cases for kernel submission to a sycl::queue.""" import ctypes import os diff --git a/dpctl/tests/test_sycl_platform.py b/dpctl/tests/test_sycl_platform.py index 66d85db13c..9e49d8b3f8 100644 --- a/dpctl/tests/test_sycl_platform.py +++ b/dpctl/tests/test_sycl_platform.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for the SyclPlatform class. -""" +"""Defines unit test cases for the SyclPlatform class.""" import sys diff --git a/dpctl/tests/test_sycl_program.py b/dpctl/tests/test_sycl_program.py index a791a59daa..4b7102c264 100644 --- a/dpctl/tests/test_sycl_program.py +++ b/dpctl/tests/test_sycl_program.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for the SyclProgram and SyclKernel classes -""" +"""Defines unit test cases for the SyclProgram and SyclKernel classes""" import os diff --git a/dpctl/tests/test_sycl_queue.py b/dpctl/tests/test_sycl_queue.py index f391fcd993..4340143d8b 100644 --- a/dpctl/tests/test_sycl_queue.py +++ b/dpctl/tests/test_sycl_queue.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for the SyclQueue class. -""" +"""Defines unit test cases for the SyclQueue class.""" import ctypes import sys diff --git a/dpctl/tests/test_sycl_queue_manager.py b/dpctl/tests/test_sycl_queue_manager.py index 159333f90a..18cbb42eac 100644 --- a/dpctl/tests/test_sycl_queue_manager.py +++ b/dpctl/tests/test_sycl_queue_manager.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for the dpctl._sycl_queue_manager module. -""" +"""Defines unit test cases for the dpctl._sycl_queue_manager module.""" import pytest diff --git a/dpctl/tests/test_sycl_queue_memcpy.py b/dpctl/tests/test_sycl_queue_memcpy.py index d134323e74..ada73f7dca 100644 --- a/dpctl/tests/test_sycl_queue_memcpy.py +++ b/dpctl/tests/test_sycl_queue_memcpy.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for the SyclQueue.memcpy. -""" +"""Defines unit test cases for the SyclQueue.memcpy.""" import numpy as np import pytest diff --git a/dpctl/tests/test_sycl_usm.py b/dpctl/tests/test_sycl_usm.py index b84f269f39..7b79738231 100644 --- a/dpctl/tests/test_sycl_usm.py +++ b/dpctl/tests/test_sycl_usm.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Defines unit test cases for the Memory classes in _memory.pyx. -""" +"""Defines unit test cases for the Memory classes in _memory.pyx.""" import numpy as np import pytest diff --git a/dpctl/tests/test_utils.py b/dpctl/tests/test_utils.py index 197e17b81a..1481848947 100644 --- a/dpctl/tests/test_utils.py +++ b/dpctl/tests/test_utils.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Defines unit test cases for utility functions. -""" +"""Defines unit test cases for utility functions.""" import pytest diff --git a/examples/python/device_selection.py b/examples/python/device_selection.py index adc1b96c1c..bf21c8e44d 100644 --- a/examples/python/device_selection.py +++ b/examples/python/device_selection.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Examples illustrating SYCL device selection features provided by dpctl. -""" +"""Examples illustrating SYCL device selection features provided by dpctl.""" import dpctl diff --git a/examples/python/filter_selection.py b/examples/python/filter_selection.py index 3e44f2b0b6..286da98d7a 100644 --- a/examples/python/filter_selection.py +++ b/examples/python/filter_selection.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Examples illustrating SYCL device selection using filter strings. -""" +"""Examples illustrating SYCL device selection using filter strings.""" import dpctl diff --git a/examples/python/lsplatform.py b/examples/python/lsplatform.py index 4202758246..912a64ea44 100644 --- a/examples/python/lsplatform.py +++ b/examples/python/lsplatform.py @@ -14,8 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Demonstrates SYCL queue selection operations provided by dpctl. -""" +"""Demonstrates SYCL queue selection operations provided by dpctl.""" import dpctl