Fix examples and pytest, run ruff (#3230)
Mark inactive issues and pull requests / mark-inactive-30d (push) Has been cancelled
Mark inactive issues and pull requests / mark-inactive-90d (push) Has been cancelled

Co-authored-by: dePaul Miller <23461061+depaulmillz@users.noreply.github.com>
This commit is contained in:
dePaul Miller
2026-05-21 11:05:38 +08:00
committed by GitHub
co-authored by dePaul Miller
parent 982cb9e718
commit 546c3efa89
11 changed files with 342 additions and 159 deletions
+6
View File
@@ -39,6 +39,8 @@ import numpy as np
project_root = Path(__file__).resolve().parent.parent.parent.parent
cute_example_path = project_root / "examples" / "python" / "CuTeDSL" / "cute"
example_path = project_root / "examples" / "python" / "CuTeDSL"
utils_path = project_root / "test" / "utils"
@@ -50,9 +52,11 @@ utils_path = project_root / "test" / "utils"
# Importing cutlass here, while sys.path is still clean, avoids that race.
import cutlass # noqa: E402 (intentional early import)
sys.path.append(str(cute_example_path))
sys.path.append(str(example_path))
sys.path.append(str(utils_path))
# The helper class to prevent modification of sys.path from test files
# Only allow modification of sys.path from pytest monkeypatch API calls
class ImmutableSysPath(list):
@@ -70,6 +74,7 @@ class ImmutableSysPath(list):
}
for mtd in mutating_methods:
def mutating_method(self, *args, mtd=mtd, **kwargs):
frame = sys._getframe().f_back
if (
@@ -98,6 +103,7 @@ sys.path = ImmutableSysPath(list(sys.path))
pytest_plugins = ["test_sharding"]
def pytest_addoption(parser):
parser.addoption(
"--sample-interval",