Commit eabaf4b
authored
Unify ruff config and apply lint fixes across all sub-repos (#1703)
* Unify ruff config across sub-repos
Merge cuda_pathfinder's [tool.ruff] into the top-level ruff.toml and
remove the duplicate. The unified config is the union of all lint rules
(adding ARG, Q, N, C4, PIE, T20, RUF, PT, DTZ) with sane per-file
ignores for tests, examples, benchmarks, scripts, and CUDA naming
conventions in cuda_bindings.
Made-with: Cursor
* Add ruff to pixi dependencies
Made-with: Cursor
* Update ruff config with review feedback
- Remove combine-as-imports (keep as-imports separate from bare imports)
- Add C408 to global ignores (dict()/list()/tuple() calls are fine)
- Add RUF005 to global ignores (list concatenation is fine)
- Add E402, F403, F405 to __init__.py per-file-ignores
- Add E702, B028 to test per-file-ignores
- Add T201 for canary_probe_subprocess.py
Made-with: Cursor
* fix(ruff/cuda_core): I001 sort imports
- I001: unsorted imports — 48 fixed across 48 files
Made-with: Cursor
* fix(ruff/cuda_core): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 80 fixed across 24 files
Made-with: Cursor
* fix(ruff/cuda_core): C4 simplify comprehensions
- C416: unnecessary-comprehension — use set()/list() directly
- C401: unnecessary-generator-set — use set comprehension
- C419: unnecessary-comprehension-in-call — use generator in all()/any()
- C400: unnecessary-generator-list — use list comprehension
- C414: unnecessary-double-cast-or-process — remove redundant list()
- C420: unnecessary-dict-comprehension — use dict.fromkeys()
40 fixed across 10 files
Made-with: Cursor
* fix(ruff/cuda_core): PIE misc cleanup
- PIE808: unnecessary-range-start — remove redundant range(0, n)
- PIE790: unnecessary-placeholder — remove pass after docstring
- PIE810: multiple-starts-ends-with — consolidate into tuple arg
3 fixed across 3 files
Made-with: Cursor
* fix(ruff/cuda_core): PT pytest-style fixes
- PT003: extraneous-scope-function — remove default scope="function"
- PT022: pytest-useless-yield-fixture — convert yield fixture to return
- PT001: pytest-fixture-incorrect-parentheses — remove empty parentheses
- PT013: pytest-incorrect-pytest-import — use pytest.param instead of from pytest import param
18 fixed across 4 files
Made-with: Cursor
* fix(ruff/cuda_core): RUF ruff-specific fixes
- RUF022: unsorted-dunder-all — sort __all__ entries (4 fixes across 4 files)
- RUF023: unsorted-dunder-slots — sort __slots__ entries (3 fixes across 1 file)
- RUF012: mutable-class-default — suppress with noqa for lookup tables (5 fixes in 1 file)
Made-with: Cursor
* fix(ruff/cuda_core): E pycodestyle fixes
- E711: none-comparison — use 'is not None' instead of '!= None' (1 fix in 1 file)
Made-with: Cursor
* fix(ruff/cuda_core): N naming convention fixes
- N806: non-lowercase-variable-in-function — rename CUDA_PATH to cuda_path (2 fixes in 1 file)
- N816: mixed-case-variable-in-global-scope — suppress for CUDA API naming (1 noqa in 1 file)
- N801: invalid-class-name — suppress for setuptools convention (1 noqa in 1 file)
Made-with: Cursor
* fix(ruff/cuda_core): ARG unused argument suppression
- ARG002: unused-method-argument — suppress for interface method (1 noqa in 1 file)
Made-with: Cursor
* fix(ruff/cuda_core): F pyflakes fixes
- F401: unused-import — suppress for re-exports and side-effect imports (4 noqa in 2 files)
Made-with: Cursor
* fix(ruff/cuda_core): B bugbear fixes
- B018: useless-expression — suppress for property access expected to raise (2 noqa in 1 file)
Made-with: Cursor
* fix(ruff/cuda_core): S bandit security suppressions
- S110: try-except-pass — suppress for best-effort cleanup (5 noqa in 2 files)
- S102: exec-builtin — suppress in test code (2 noqa in 2 files)
- S301: suspicious-pickle-usage — suppress in test code (3 noqa in 3 files)
Made-with: Cursor
* fix(ruff/cuda_bindings): I001 sort imports
- I001: unsorted imports — 42 fixed across NFILES files
Made-with: Cursor
* fix(ruff/cuda_bindings): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 16 fixed across 9 files
Made-with: Cursor
* fix(ruff/cuda_bindings): C4 simplify comprehensions
- C416: unnecessary-comprehension — use set()/list() directly
- C401: unnecessary-generator-set — use set comprehension
- C419: unnecessary-comprehension-in-call — use generator in all()/any()
- C400: unnecessary-generator-list — use list comprehension
- C414: unnecessary-double-cast-or-process — remove redundant list()
- C420: unnecessary-dict-comprehension — use dict.fromkeys()
9 fixed across 3 files
Made-with: Cursor
* fix(ruff/cuda_bindings): PIE misc cleanup
- PIE808: unnecessary-range-start — remove redundant range(0, n)
- PIE790: unnecessary-placeholder — remove pass after docstring
- PIE810: multiple-starts-ends-with — consolidate into tuple arg
5 fixed across 4 files
Made-with: Cursor
* fix(ruff/cuda_bindings): PT pytest-style fixes
- PT003: extraneous-scope-function — remove default scope="function" (4 fixes)
- PT001: pytest-fixture-incorrect-parentheses — remove empty parentheses
4 fixed across 1 files
Made-with: Cursor
* fix(ruff/cuda_bindings): F pyflakes fixes
- F401: unused-import — suppress for intentional re-exports and side-effect imports (2 noqa in 2 files)
Made-with: Cursor
* fix(ruff/cuda_bindings): S bandit security suppressions
- S110: try-except-pass — suppress for best-effort cleanup (2 noqa in 1 file)
- S603: subprocess-without-shell-equals-true — suppress at call site (5 noqa in 4 files)
- S607: start-process-with-partial-path — suppress at call site (3 noqa in 2 files)
Made-with: Cursor
* fix(ruff/cuda_pathfinder): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 12 fixed across 7 files
Made-with: Cursor
* fix(ruff/cuda_pathfinder): SIM simplify code
- SIM102: collapsible-if — merge nested if statements (1 fix in 1 file)
- SIM105: suppressible-exception — use contextlib.suppress instead of try/except/pass (1 fix in 1 file)
Made-with: Cursor
* fix(ruff/cuda_pathfinder): S bandit security suppressions
- S110: try-except-pass — suppress for best-effort cleanup (1 noqa in 1 file)
Made-with: Cursor
* fix(ruff/cuda_python_test_helpers): I001 sort imports
- I001: unsorted imports — across 1 files
Made-with: Cursor
* fix(ruff/cuda_python_test_helpers): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 1 fixed across 1 files
Made-with: Cursor
* fix(ruff/cuda_python_test_helpers): RUF ruff-specific fixes
- RUF059: unused-unpacked-variable — prefix unused vars with underscore (2 fixes in 1 file)
Made-with: Cursor
* fix(ruff/toolshed): I001 sort imports
- I001: unsorted imports — across 2 files
Made-with: Cursor
* fix(ruff/toolshed): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 2 fixed across 1 files
Made-with: Cursor
* fix(ruff/toolshed): DTZ datetime timezone fixes
- DTZ011: call-date-today — use timezone-aware datetime.now(tz=utc) (1 fix in 1 file)
Made-with: Cursor
* fix(ruff/toolshed): N naming convention fixes
- N806: non-lowercase-variable-in-function — rename TILE_SIZE to tile_size (1 fix in 1 file)
Made-with: Cursor
* fix(ruff/toolshed): S bandit security suppressions
- S603: subprocess-without-shell-equals-true — suppress at call site (1 noqa in 1 file)
- S607: start-process-with-partial-path — suppress at call site (1 noqa in 1 file)
Made-with: Cursor
* fix(ruff/ci): RUF100 remove stale noqa comments
- RUF100: unused-noqa — 1 fixed across 1 files
Made-with: Cursor
* fix(ruff/ci): RUF ruff-specific fixes
- RUF013: implicit-optional — annotate as T | None explicitly (2 fixes in 1 file)
Made-with: Cursor
* fix(ruff/ci): S bandit security suppressions
- S603: subprocess-without-shell-equals-true — suppress at call site (1 noqa in 1 file)
Made-with: Cursor
* fix(ruff/root): ARG unused argument suppression
- ARG001: unused-function-argument — suppress for pytest hook signature (1 noqa in 1 file)
Made-with: Cursor
* fixup: correct S noqa placement for multiline calls
Made-with: Cursor
* fix(ruff): apply ruff formatting
- 2 files reformatted (cuda_core/cuda/core/system/__init__.py, cuda_core/tests/test_utils.py)
Made-with: Cursor
* fix(ruff): add RUF012 to test/benchmark per-file-ignores
ctypes Structure._fields_ is a standard pattern, not a mutable default concern
Made-with: Cursor
* fix(core): use CUmemAllocationType for VMM allocation enums
Read CU_MEM_ALLOCATION_TYPE_* from CUmemAllocationType instead of CUmemAccess_flags so cuda.core imports correctly in test/docs CI jobs.
Made-with: Cursor
* fix(tests): use pytest.param in test_utils
Switch test parametrization calls to pytest.param so collection succeeds under current pytest and the pixi cuda_core suite runs end-to-end.
Made-with: Cursor1 parent 21c46f0 commit eabaf4b
File tree
126 files changed
+1403
-361
lines changed- ci/tools
- cuda_bindings
- benchmarks
- cuda/bindings/_test_helpers
- examples
- 0_Introduction
- 2_Concepts_and_Techniques
- 3_CUDA_Features
- 4_CUDA_Libraries
- common
- extra
- tests
- nvml
- cuda_core
- cuda/core
- _memory
- _utils
- experimental
- system
- examples
- tests
- example_tests
- graph
- helpers
- memory_ipc
- system
- cuda_pathfinder
- cuda/pathfinder
- _dynamic_libs
- _headers
- _utils
- tests
- cuda_python_test_helpers/cuda_python_test_helpers
- toolshed
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
126 files changed
+1403
-361
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
| 71 | + | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
| |||
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments