Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix RUF052 and RUF046 warnings #803

Merged
merged 3 commits into from
Dec 16, 2024
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-12]
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4
Expand All @@ -30,13 +30,13 @@ jobs:
python-version: '3.x'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.19.2
run: python -m pip install cibuildwheel==2.22.0

- name: Build wheels
shell: bash
run: |
set -x
if [[ "${{ matrix.os }}" == "windows-2019" ]]; then
if [[ ${{ matrix.os }} == windows-* ]]; then
export CL_INC_DIR="D:/a/pyopencl/pyopencl/OpenCL-Headers/install/include"
export CL_LIB_DIR="C:/Program Files/OpenCL-ICD-Loader/lib"
fi
Expand Down
2 changes: 1 addition & 1 deletion doc/runtime_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Operations on SVM
Image
-----

.. class:: ImageFormat([channel_order, channel_type])
.. class:: ImageFormat(channel_order, channel_type)

.. attribute:: channel_order

Expand Down
2 changes: 1 addition & 1 deletion pyopencl/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@ def arange(queue, *args, **kwargs):
raise TypeError("arange requires a dtype argument")

from math import ceil
size = int(ceil((stop-start)/step))
size = ceil((stop-start)/step)

result = Array(queue, (size,), dtype, allocator=inf.allocator)
result.add_event(_arange_knl(result, start, step, queue=queue))
Expand Down
4 changes: 2 additions & 2 deletions pyopencl/cltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# {{{ vector types

def _create_vector_types():
_mapping = [(k, globals()[k]) for k in
mapping = [(k, globals()[k]) for k in
["char", "uchar", "short", "ushort", "int",
"uint", "long", "ulong", "float", "double"]]

Expand All @@ -64,7 +64,7 @@ def set_global(key, val):

counts = [2, 3, 4, 8, 16]

for base_name, base_type in _mapping:
for base_name, base_type in mapping:
for count in counts:
name = "%s%d" % (base_name, count)

Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ test-command = "pytest {project}/test"
test-extras = [
"test",
]
environment-pass = [
"CL_INC_DIR",
"CL_LIB_DIR",
]
test-skip = [
"*-macosx_*:arm64",
"*-macosx_arm64",
]

[tool.cibuildwheel.linux]
skip = [
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-ocl-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ git clone --branch v2022.01.04 https://github.com/KhronosGroup/OpenCL-Headers



cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build
cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build
cmake --build ./OpenCL-Headers/build --target install

cmake -D CMAKE_PREFIX_PATH=${PWD}/OpenCL-Headers/install -D OPENCL_ICD_LOADER_HEADERS_DIR=${PWD}/OpenCL-Headers/install/include -D CMAKE_INSTALL_PREFIX=./OpenCL-ICD-Loader/install -S ./OpenCL-ICD-Loader -B ./OpenCL-ICD-Loader/build
cmake --build ./OpenCL-ICD-Loader/build --target install --config Release

echo "PyOpenCL wheel includes Khronos Group OpenCL-ICD-Loader which is licensed as below" >> ${SCRIPT_DIR}/../LICENSE
cat ./OpenCL-ICD-Loader/LICENSE >> ${SCRIPT_DIR}/../LICENSE
cat ./OpenCL-ICD-Loader/LICENSE >> ${SCRIPT_DIR}/../LICENSE
Loading