Skip to content

Commit c369d69

Browse files
pavanbalajimeta-codesync[bot]
authored andcommitted
Suppress fbcode-nonempty-init-py lint warnings
Summary: The fbcode-nonempty-init-py patternlint rule recommends keeping __init__.py files empty and moving initialization code to a separate module. However, for torchcomms this would not help: we would still need to import those modules from __init__.py to ensure they run at package import time (e.g., loading libtorchcomms.so, registering metaclasses, setting up backends). Moving the code out and re-importing it just adds indirection with no benefit. Add patternlint-disable comments to suppress the advice-level warnings in the affected __init__.py files. Differential Revision: D95155993
1 parent e2089a6 commit c369d69

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

comms/torchcomms/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22

33
# pyre-strict
4+
# patternlint-disable fbcode-nonempty-init-py
45
import ctypes
56
import os
67
import sys

comms/torchcomms/distwrap/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22
# pyre-strict
3+
# patternlint-disable fbcode-nonempty-init-py
34

45
from typing import Any, Callable
56

comms/torchcomms/functional/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
# patternlint-disable fbcode-nonempty-init-py
23

34
import os
45

comms/torchcomms/hooks/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22

33
# pyre-strict
4+
# patternlint-disable fbcode-nonempty-init-py
45

56
"""
67
TorchComm hooks module.

comms/torchcomms/hooks/fr/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright (c) Meta Platforms, Inc. and affiliates.
22

33
# pyre-strict
4+
# patternlint-disable fbcode-nonempty-init-py
45

56
"""
67
Flight Recorder module for TorchComm hooks.

0 commit comments

Comments
 (0)