diff --git a/.github/workflows/python_style_checks.yml b/.github/workflows/python_style_checks.yml index 5e4b9a1d9f..92ae080f53 100644 --- a/.github/workflows/python_style_checks.yml +++ b/.github/workflows/python_style_checks.yml @@ -25,6 +25,10 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it @@ -33,16 +37,17 @@ jobs: - uses: actions/setup-python@v2 # Run black code formatter - - uses: psf/black@21.4b2 + - uses: psf/black@stable with: - args: ". --check" + src: "." + options: "--check" flake8: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: [3.9] steps: - uses: actions/checkout@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54286f0c65..7311c9eb67 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 21.10b0 + rev: 22.1.0 hooks: - id: black exclude: "versioneer.py|dpctl/_version.py" diff --git a/dpctl/tests/test_sycl_event.py b/dpctl/tests/test_sycl_event.py index e56337b7ff..7691f00aef 100644 --- a/dpctl/tests/test_sycl_event.py +++ b/dpctl/tests/test_sycl_event.py @@ -202,7 +202,7 @@ def test_sycl_timer(): # device task m1.copy_from_device(m2) # host task - [x ** 2 for x in range(1024)] + [x**2 for x in range(1024)] host_dt, device_dt = timer.dt assert host_dt > device_dt q_no_profiling = dpctl.SyclQueue() diff --git a/examples/cython/sycl_buffer/bench.py b/examples/cython/sycl_buffer/bench.py index 9fc493fd18..f8edc91995 100644 --- a/examples/cython/sycl_buffer/bench.py +++ b/examples/cython/sycl_buffer/bench.py @@ -21,7 +21,7 @@ import dpctl -X = np.full((10 ** 4, 4098), 1e-4, dtype="d") +X = np.full((10**4, 4098), 1e-4, dtype="d") # warm-up print("=" * 10 + " Executing warm-up " + "=" * 10) diff --git a/examples/cython/sycl_direct_linkage/bench.py b/examples/cython/sycl_direct_linkage/bench.py index fdff5589ce..bc713a23d7 100644 --- a/examples/cython/sycl_direct_linkage/bench.py +++ b/examples/cython/sycl_direct_linkage/bench.py @@ -19,7 +19,7 @@ import numpy as np import syclbuffer_naive as sb -X = np.full((10 ** 4, 4098), 1e-4, dtype="d") +X = np.full((10**4, 4098), 1e-4, dtype="d") # warm-up print("=" * 10 + " Executing warm-up " + "=" * 10) diff --git a/examples/cython/usm_memory/run.py b/examples/cython/usm_memory/run.py index 720c580250..fa71bba36c 100644 --- a/examples/cython/usm_memory/run.py +++ b/examples/cython/usm_memory/run.py @@ -61,7 +61,7 @@ def gen_option_params( np.allclose(Xgpu, X_ref, atol=1e-5), ) -n_opts = 3 * 10 ** 6 +n_opts = 3 * 10**6 # compute on CPU sycl device diff --git a/examples/pybind11/use_dpctl_syclqueue/example.py b/examples/pybind11/use_dpctl_syclqueue/example.py index 1980ca82d3..7189adecb8 100644 --- a/examples/pybind11/use_dpctl_syclqueue/example.py +++ b/examples/pybind11/use_dpctl_syclqueue/example.py @@ -36,7 +36,7 @@ print("") print("Computing modular reduction using SYCL on a NumPy array") -X = np.random.randint(low=1, high=2 ** 16 - 1, size=10 ** 6, dtype=np.longlong) +X = np.random.randint(low=1, high=2**16 - 1, size=10**6, dtype=np.longlong) modulus_p = 347 Y = eg.offloaded_array_mod( diff --git a/examples/python/usm_memory_host_access.py b/examples/python/usm_memory_host_access.py index 984b4273b5..5fdd24ffc4 100644 --- a/examples/python/usm_memory_host_access.py +++ b/examples/python/usm_memory_host_access.py @@ -34,7 +34,7 @@ # populate buffer from host one byte at a type for i in range(len(ms)): ir = i % 256 - msv[i] = ir ** 2 % 256 + msv[i] = ir**2 % 256 mh = dpmem.MemoryUSMHost(64) mhv = memoryview(mh)