Skip to content

Commit 514daa6

Browse files
authored
Un-disable ruff E722 Do not use bare except (NVIDIA#1347)
1 parent 4886636 commit 514daa6

3 files changed

Lines changed: 1 addition & 22 deletions

File tree

cuda_bindings/examples/3_CUDA_Features/simpleCudaGraphs_test.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import random as rnd
66

77
import numpy as np
8-
import pytest
98
from common import common
109
from common.helper_cuda import checkCudaErrors, findCudaDevice
1110
from cuda.bindings import driver as cuda
@@ -362,23 +361,6 @@ def cudaGraphsUsingStreamCapture(inputVec_h, inputVec_d, outputVec_d, result_d,
362361
checkCudaErrors(cudart.cudaStreamDestroy(streamForGraph))
363362

364363

365-
def checkKernelCompiles():
366-
kernel_headers = """\
367-
#include <cooperative_groups.h>
368-
"""
369-
try:
370-
common.KernelHelper(kernel_headers, findCudaDevice())
371-
except:
372-
# Filters out test from automation when CG header has issues compiling
373-
# Automation issue is observed when CG headers are obtained through PYPI packages
374-
# The problem is that these headers and their dependencies are segmented between
375-
# multiple packages, and NVRTC requires that you specify the path to each segemented
376-
# include path.
377-
return False
378-
return True
379-
380-
381-
@pytest.mark.skipif(not checkKernelCompiles(), reason="Automation filter against incompatible kernel")
382364
def main():
383365
size = 1 << 24 # number of elements to reduce
384366
maxBlocks = 512

cuda_bindings/tests/test_cufile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ def test_param(param, val, default_val):
14681468
try:
14691469
# Currently this line will raise, see below.
14701470
cufile.set_parameter_string(param, int(ctypes.addressof(orig_val_buf)))
1471-
except:
1471+
except cufile.cuFileError:
14721472
# This block will always be reached because cuFILE could start with garbage default (empty string)
14731473
# that cannot be restored. In other words, cuFILE does honor the common sense that getter/setter
14741474
# should be round-tripable.

ruff.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,16 @@ exclude = ["**/_version.py"]
5050
"setup.py" = ["F401"]
5151

5252
"cuda_bindings/examples/**" = [
53-
"E722",
5453
"E501", # line too long
5554
]
5655

5756
"cuda_bindings/tests/**" = [
58-
"E722",
5957
"UP022",
6058
"E402", # module level import not at top of file
6159
"F841",
6260
] # F841 complains about unused variables, but some assignments have side-effects that could be useful for tests (func calls for example)
6361

6462
"cuda_bindings/benchmarks/**" = [
65-
"E722",
6663
"UP022",
6764
"E402", # module level import not at top of file
6865
"F841",

0 commit comments

Comments
 (0)