From 5df8a183a7b409e13d3d7d6dd2da3bca40691e4c Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 28 Mar 2022 14:14:27 -0700 Subject: [PATCH 1/3] Update black version. --- .pre-commit-config.yaml | 3 ++- ci/checks/style.sh | 2 +- python/rmm/rmm.py | 3 ++- python/rmm/tests/test_rmm.py | 9 ++++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a50c645ba..00189783f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,10 @@ repos: types: [text] types_or: [python, cython] - repo: https://github.com/ambv/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black + args: ["--config=python/pyproject.toml"] - repo: https://gitlab.com/pycqa/flake8 rev: 3.8.3 hooks: diff --git a/ci/checks/style.sh b/ci/checks/style.sh index eb41bc6b5..cec606871 100644 --- a/ci/checks/style.sh +++ b/ci/checks/style.sh @@ -19,7 +19,7 @@ ISORT=`isort --check-only python --settings-path=python/setup.cfg ` ISORT_RETVAL=$? # Run black and get results/return code -BLACK=`black --check python` +BLACK=`black --config python/pyproject.toml --check python` BLACK_RETVAL=$? # Run flake8 and get results/return code diff --git a/python/rmm/rmm.py b/python/rmm/rmm.py index 9c57c6ac6..f77df659a 100644 --- a/python/rmm/rmm.py +++ b/python/rmm/rmm.py @@ -137,7 +137,8 @@ def get_ipc_handle(self, memory): start, end = cuda.cudadrv.driver.device_extents(memory) ipchandle = (ctypes.c_byte * 64)() # IPC handle is 64 bytes cuda.cudadrv.driver.driver.cuIpcGetMemHandle( - ctypes.byref(ipchandle), start, + ctypes.byref(ipchandle), + start, ) source_info = cuda.current_context().device.get_device_identity() offset = memory.handle.value - start diff --git a/python/rmm/tests/test_rmm.py b/python/rmm/tests/test_rmm.py index c82c306c7..409ed6b72 100644 --- a/python/rmm/tests/test_rmm.py +++ b/python/rmm/tests/test_rmm.py @@ -526,7 +526,8 @@ def test_mr_upstream_lifetime(): @pytest.mark.skipif( - not _CUDAMALLOC_ASYNC_SUPPORTED, reason="cudaMallocAsync not supported", + not _CUDAMALLOC_ASYNC_SUPPORTED, + reason="cudaMallocAsync not supported", ) @pytest.mark.parametrize("dtype", _dtypes) @pytest.mark.parametrize("nelem", _nelems) @@ -539,7 +540,8 @@ def test_cuda_async_memory_resource(dtype, nelem, alloc): @pytest.mark.skipif( - not _CUDAMALLOC_ASYNC_SUPPORTED, reason="cudaMallocAsync not supported", + not _CUDAMALLOC_ASYNC_SUPPORTED, + reason="cudaMallocAsync not supported", ) @pytest.mark.parametrize("nelems", _nelems) def test_cuda_async_memory_resource_stream(nelems): @@ -555,7 +557,8 @@ def test_cuda_async_memory_resource_stream(nelems): @pytest.mark.skipif( - not _CUDAMALLOC_ASYNC_SUPPORTED, reason="cudaMallocAsync not supported", + not _CUDAMALLOC_ASYNC_SUPPORTED, + reason="cudaMallocAsync not supported", ) @pytest.mark.parametrize("nelem", _nelems) @pytest.mark.parametrize("alloc", _allocs) From a216da9ccad21ef7f7d3998c29cd210482208647 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 28 Mar 2022 14:18:04 -0700 Subject: [PATCH 2/3] Update conda environments. --- conda/environments/rmm_dev_cuda11.5.yml | 2 +- conda/environments/rmm_dev_cuda11.6.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/environments/rmm_dev_cuda11.5.yml b/conda/environments/rmm_dev_cuda11.5.yml index d0b3816b7..cb88bec37 100644 --- a/conda/environments/rmm_dev_cuda11.5.yml +++ b/conda/environments/rmm_dev_cuda11.5.yml @@ -8,7 +8,7 @@ dependencies: - cmake>=3.20.1 - cmake-format=0.6.11 - flake8=3.8.3 -- black=19.10 +- black=22.3.0 - isort=5.6.4 - python>=3.8,<3.10 - numba>=0.49 diff --git a/conda/environments/rmm_dev_cuda11.6.yml b/conda/environments/rmm_dev_cuda11.6.yml index c0e8e2ed9..b180a53d8 100644 --- a/conda/environments/rmm_dev_cuda11.6.yml +++ b/conda/environments/rmm_dev_cuda11.6.yml @@ -8,7 +8,7 @@ dependencies: - cmake>=3.20.1 - cmake-format=0.6.11 - flake8=3.8.3 -- black=19.10 +- black=22.3.0 - isort=5.6.4 - python>=3.8,<3.10 - numba>=0.49 From 1c43a2b5e99e893ccbd1f3a2c3234ddde9cd84ab Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 30 Mar 2022 14:44:34 -0700 Subject: [PATCH 3/3] Update dev_requirements. --- python/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/dev_requirements.txt b/python/dev_requirements.txt index 09ad10049..217df3352 100644 --- a/python/dev_requirements.txt +++ b/python/dev_requirements.txt @@ -2,7 +2,7 @@ clang==8.0.1 flake8==3.8.3 -black==19.10b0 +black==22.3.0 isort==5.6.4 cmake-format==0.6.11 numpy