Skip to content

Commit

Permalink
Disable isort on several files
Browse files Browse the repository at this point in the history
Summary: isort introduces some import/circular dependency issues. Ideally we'll fix those in the future, but for now just disable isort on many of the `__init__.py` files so that we can apply black+isort across the repo.

Reviewed By: alexeib

Differential Revision: D24377771

fbshipit-source-id: 9a16343a13f162582722b4147959caea29682bbe
  • Loading branch information
myleott authored and facebook-github-bot committed Oct 18, 2020
1 parent 7a3f20d commit 5695cdf
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/noisychannel/rerank_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def add_reranking_args(parser):
help='the fraction of the source prefix to use in rescoring (in terms of words wo bpe)')
group.add_argument('--normalize', action='store_true',
help='whether to normalize by src and target len')

# fmt: on
return group


Expand Down
1 change: 1 addition & 0 deletions fairseq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

__all__ = ['pdb']
__version__ = '1.0.0a0'
Expand Down
1 change: 1 addition & 0 deletions fairseq/criterions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

import importlib
import os
Expand Down
1 change: 1 addition & 0 deletions fairseq/criterions/wav2vec_criterion.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def add_args(parser):
help='weights for additional loss terms (not first one)')
parser.add_argument('--log-keys', type=str, default=None,
help='output keys to log')
# fmt: on

def forward(self, model, sample, reduce=True, log_pred=False):
"""Compute the loss for the given sample.
Expand Down
1 change: 1 addition & 0 deletions fairseq/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

from .dictionary import Dictionary, TruncatedDictionary

Expand Down
1 change: 1 addition & 0 deletions fairseq/model_parallel/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

from .multihead_attention import ModelParallelMultiheadAttention
from .transformer_layer import ModelParallelTransformerEncoderLayer, ModelParallelTransformerDecoderLayer
Expand Down
1 change: 1 addition & 0 deletions fairseq/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

import argparse
import importlib
Expand Down
1 change: 1 addition & 0 deletions fairseq/models/lstm_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def add_args(parser):
parser.add_argument('--share-decoder-input-output-embed', default=False,
action='store_true',
help='share decoder input and output embeddings')
# fmt: on

@classmethod
def build_model(cls, args, task):
Expand Down
6 changes: 6 additions & 0 deletions fairseq/models/nat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

from .fairseq_nat_model import *
from .nonautoregressive_transformer import *
from .nat_crf_transformer import *
Expand Down
1 change: 1 addition & 0 deletions fairseq/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

from .adaptive_input import AdaptiveInput
from .adaptive_softmax import AdaptiveSoftmax
Expand Down
1 change: 1 addition & 0 deletions fairseq/optim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

import importlib
import os
Expand Down
1 change: 1 addition & 0 deletions fairseq/optim/lr_scheduler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

import importlib
import os
Expand Down
1 change: 1 addition & 0 deletions fairseq/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""isort:skip_file"""

import argparse
import importlib
Expand Down
1 change: 1 addition & 0 deletions fairseq/tasks/translation_lev.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def add_args(parser):
'--noise',
default='random_delete',
choices=['random_delete', 'random_mask', 'no_noise', 'full_mask'])
# fmt: on

def load_dataset(self, split, epoch=1, combine=False, **kwargs):
"""Load a given dataset split.
Expand Down

0 comments on commit 5695cdf

Please sign in to comment.