Skip to content

Commit 4794a56

Browse files
authored
chore: Lint noxfile.py (#1443)
- Lint noxfile to avoid CI errors for PRs
1 parent 97bb157 commit 4794a56

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

noxfile.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def run_base_tests(session):
202202
else:
203203
session.run_always("pytest", test)
204204

205+
205206
def run_fx_core_tests(session):
206207
print("Running FX core tests")
207208
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -214,6 +215,7 @@ def run_fx_core_tests(session):
214215
else:
215216
session.run_always("pytest", test)
216217

218+
217219
def run_fx_converter_tests(session):
218220
print("Running FX converter tests")
219221
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -229,6 +231,7 @@ def run_fx_converter_tests(session):
229231
else:
230232
session.run_always("pytest", test, skip_tests)
231233

234+
232235
def run_fx_lower_tests(session):
233236
print("Running FX passes and trt_lower tests")
234237
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -237,7 +240,7 @@ def run_fx_lower_tests(session):
237240
# "passes/test_fuse_permute_linear_trt.py",
238241
"passes/test_remove_duplicate_output_args.py",
239242
"passes/test_fuse_permute_matmul_trt.py",
240-
#"passes/test_graph_opts.py"
243+
# "passes/test_graph_opts.py"
241244
"trt_lower",
242245
]
243246
for test in tests:
@@ -246,6 +249,7 @@ def run_fx_lower_tests(session):
246249
else:
247250
session.run_always("pytest", test)
248251

252+
249253
def run_fx_quant_tests(session):
250254
print("Running FX Quant tests")
251255
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -261,6 +265,7 @@ def run_fx_quant_tests(session):
261265
else:
262266
session.run_always("pytest", test, skip_tests)
263267

268+
264269
def run_fx_tracer_tests(session):
265270
print("Running FX Tracer tests")
266271
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -269,14 +274,15 @@ def run_fx_tracer_tests(session):
269274
tests = [
270275
"tracer/test_acc_shape_prop.py",
271276
"tracer/test_acc_tracer.py",
272-
#"tracer/test_dispatch_tracer.py"
277+
# "tracer/test_dispatch_tracer.py"
273278
]
274279
for test in tests:
275280
if USE_HOST_DEPS:
276281
session.run_always("pytest", test, env={"PYTHONPATH": PYT_PATH})
277282
else:
278283
session.run_always("pytest", test)
279284

285+
280286
def run_fx_tools_tests(session):
281287
print("Running FX tools tests")
282288
session.chdir(os.path.join(TOP_DIR, "py/torch_tensorrt/fx/test"))
@@ -396,6 +402,7 @@ def run_l0_api_tests(session):
396402
run_base_tests(session)
397403
cleanup(session)
398404

405+
399406
def run_l0_fx_tests(session):
400407
if not USE_HOST_DEPS:
401408
install_deps(session)
@@ -405,27 +412,31 @@ def run_l0_fx_tests(session):
405412
run_fx_lower_tests(session)
406413
cleanup(session)
407414

415+
408416
def run_l0_fx_core_tests(session):
409417
if not USE_HOST_DEPS:
410418
install_deps(session)
411419
install_torch_trt(session)
412420
run_fx_core_tests(session)
413421
cleanup(session)
414422

423+
415424
def run_l0_fx_converter_tests(session):
416425
if not USE_HOST_DEPS:
417426
install_deps(session)
418427
install_torch_trt(session)
419428
run_fx_converter_tests(session)
420429
cleanup(session)
421430

431+
422432
def run_l0_fx_lower_tests(session):
423433
if not USE_HOST_DEPS:
424434
install_deps(session)
425435
install_torch_trt(session)
426436
run_fx_lower_tests(session)
427437
cleanup(session)
428438

439+
429440
def run_l0_dla_tests(session):
430441
if not USE_HOST_DEPS:
431442
install_deps(session)
@@ -443,6 +454,7 @@ def run_l1_model_tests(session):
443454
run_model_tests(session)
444455
cleanup(session)
445456

457+
446458
def run_l1_int8_accuracy_tests(session):
447459
if not USE_HOST_DEPS:
448460
install_deps(session)
@@ -452,6 +464,7 @@ def run_l1_int8_accuracy_tests(session):
452464
run_int8_accuracy_tests(session)
453465
cleanup(session)
454466

467+
455468
def run_l1_fx_tests(session):
456469
if not USE_HOST_DEPS:
457470
install_deps(session)
@@ -461,6 +474,7 @@ def run_l1_fx_tests(session):
461474
run_fx_tools_tests(session)
462475
cleanup(session)
463476

477+
464478
def run_l2_trt_compatibility_tests(session):
465479
if not USE_HOST_DEPS:
466480
install_deps(session)
@@ -483,26 +497,31 @@ def l0_api_tests(session):
483497
"""When a developer needs to check correctness for a PR or something"""
484498
run_l0_api_tests(session)
485499

500+
486501
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
487502
def l0_fx_tests(session):
488503
"""When a developer needs to check correctness for a PR or something"""
489504
run_l0_fx_tests(session)
490505

506+
491507
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
492508
def l0_fx_core_tests(session):
493509
"""When a developer needs to check correctness for a PR or something"""
494510
run_l0_fx_core_tests(session)
495511

512+
496513
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
497514
def l0_fx_converter_tests(session):
498515
"""When a developer needs to check correctness for a PR or something"""
499516
run_l0_fx_converter_tests(session)
500517

518+
501519
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
502520
def l0_fx_lower_tests(session):
503521
"""When a developer needs to check correctness for a PR or something"""
504522
run_l0_fx_lower_tests(session)
505523

524+
506525
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
507526
def l0_dla_tests(session):
508527
"""When a developer needs to check basic api functionality using host dependencies"""
@@ -514,11 +533,13 @@ def l1_model_tests(session):
514533
"""When a user needs to test the functionality of standard models compilation and results"""
515534
run_l1_model_tests(session)
516535

536+
517537
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
518538
def l1_fx_tests(session):
519539
"""When a user needs to test the functionality of standard models compilation and results"""
520540
run_l1_fx_tests(session)
521541

542+
522543
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
523544
def l1_int8_accuracy_tests(session):
524545
"""Checking accuracy performance on various usecases"""
@@ -534,4 +555,4 @@ def l2_trt_compatibility_tests(session):
534555
@nox.session(python=SUPPORTED_PYTHON_VERSIONS, reuse_venv=True)
535556
def l2_multi_gpu_tests(session):
536557
"""Makes sure that Torch-TensorRT can operate on multi-gpu systems"""
537-
run_l2_multi_gpu_tests(session)
558+
run_l2_multi_gpu_tests(session)

0 commit comments

Comments
 (0)