Skip to content

Commit 1dd98b7

Browse files
committed
style: Apply isort
1 parent 666a18b commit 1dd98b7

36 files changed

+55
-47
lines changed

fluent.docs/fluent/docs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
23
from .build import DocBuilder
34

45

fluent.docs/fluent/docs/build.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
from collections import defaultdict
21
import os
3-
from pathlib import Path
42
import shutil
53
import subprocess
64
import tempfile
5+
from collections import defaultdict
6+
from pathlib import Path
7+
78
from .tags import get_tag_infos
89

910

fluent.docs/fluent/docs/tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from datetime import date
21
import subprocess
2+
from datetime import date
33

44

55
def get_tag_infos(cut_off_date):

fluent.pygments/fluent/pygments/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import argparse
22
import sys
33

4+
from fluent.pygments.lexer import FluentLexer
45
from pygments import highlight
56
from pygments.formatters import Terminal256Formatter
6-
from fluent.pygments.lexer import FluentLexer
77

88

99
def main():

fluent.pygments/fluent/pygments/lexer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from fluent.syntax import ast as FTL
22
from fluent.syntax import parse
3-
43
from pygments.lexer import Lexer
54
from pygments.token import Token
65

fluent.pygments/setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
from setuptools import setup, find_namespace_packages
21
import os
32

3+
from setuptools import find_namespace_packages, setup
4+
45
this_directory = os.path.abspath(os.path.dirname(__file__))
56
with open(os.path.join(this_directory, 'README.rst'), 'rb') as f:
67
long_description = f.read().decode('utf-8')

fluent.pygments/tests/pygments/test_lexer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
2-
from pygments.token import Token
32

43
from fluent.pygments.lexer import FluentLexer
4+
from pygments.token import Token
55

66

77
class LexerTest(unittest.TestCase):

fluent.runtime/fluent/runtime/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from fluent.syntax.ast import Resource
33

44
from .bundle import FluentBundle
5-
from .fallback import FluentLocalization, AbstractResourceLoader, FluentResourceLoader
6-
5+
from .fallback import AbstractResourceLoader, FluentLocalization, FluentResourceLoader
76

87
__all__ = [
98
'FluentLocalization',

fluent.runtime/fluent/runtime/builtins.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Any, Callable, Dict
2+
23
from .types import FluentType, fluent_date, fluent_number
34

45
NUMBER = fluent_number

fluent.runtime/fluent/runtime/bundle.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Tuple, Union, cast
2+
13
import babel
24
import babel.numbers
35
import babel.plural
4-
from typing import Any, Callable, Dict, List, TYPE_CHECKING, Tuple, Union, cast
5-
from typing_extensions import Literal
6-
76
from fluent.syntax import ast as FTL
7+
from typing_extensions import Literal
88

99
from .builtins import BUILTINS
1010
from .prepare import Compiler

fluent.runtime/fluent/runtime/fallback.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import codecs
22
import os
3-
from typing import Any, Callable, Dict, Generator, List, TYPE_CHECKING, Type, Union, cast
3+
from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, List, Type, Union, cast
44

55
from fluent.syntax import FluentParser
66

77
from .bundle import FluentBundle
88

99
if TYPE_CHECKING:
1010
from fluent.syntax.ast import Resource
11+
1112
from .types import FluentType
1213

1314

fluent.runtime/fluent/runtime/prepare.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Any, Dict, List
2+
23
from fluent.syntax import ast as FTL
4+
35
from . import resolver
46

57

fluent.runtime/fluent/runtime/resolver.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import attr
21
import contextlib
3-
from typing import Any, Dict, Generator, List, Set, TYPE_CHECKING, Union, cast
2+
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Set, Union, cast
43

4+
import attr
55
from fluent.syntax import ast as FTL
6+
67
from .errors import FluentCyclicReferenceError, FluentFormatError, FluentReferenceError
7-
from .types import FluentType, FluentNone, FluentInt, FluentFloat
8+
from .types import FluentFloat, FluentInt, FluentNone, FluentType
89
from .utils import reference_to_id, unknown_reference_error_obj
910

1011
if TYPE_CHECKING:

fluent.runtime/fluent/runtime/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import warnings
22
from datetime import date, datetime
33
from decimal import Decimal
4+
from typing import Any, Dict, Type, TypeVar, Union, cast
45

56
import attr
67
import pytz
78
from babel import Locale
89
from babel.dates import format_date, format_time, get_datetime_format, get_timezone
910
from babel.numbers import NumberPattern, parse_pattern
10-
from typing import Any, Dict, Type, TypeVar, Union, cast
1111
from typing_extensions import Literal
1212

1313
FORMAT_STYLE_DECIMAL = "decimal"

fluent.runtime/fluent/runtime/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
from fluent.syntax.ast import MessageReference, TermReference
66

7-
from .types import FluentInt, FluentFloat, FluentDecimal, FluentDate, FluentDateTime
87
from .errors import FluentReferenceError
8+
from .types import FluentDate, FluentDateTime, FluentDecimal, FluentFloat, FluentInt
99

1010
TERM_SIGIL = '-'
1111
ATTRIBUTE_SEPARATOR = '.'

fluent.runtime/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from os import path
2+
23
from setuptools import setup
34

45
this_directory = path.abspath(path.dirname(__file__))

fluent.runtime/tests/test_fallback.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import unittest
2-
from unittest import mock
31
import io
42
import os
3+
import unittest
4+
from unittest import mock
55

6-
from fluent.runtime import (
7-
FluentLocalization,
8-
FluentResourceLoader,
9-
)
10-
6+
from fluent.runtime import FluentLocalization, FluentResourceLoader
117

128
ISFILE = os.path.isfile
139

fluent.runtime/tests/test_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import pytz
77
from babel import Locale
8-
98
from fluent.runtime.types import FluentDateType, FluentNumber, fluent_date, fluent_number
109

1110

fluent.runtime/tools/benchmarks/fluent_benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
from __future__ import unicode_literals
55

66
import sys
7-
import pytest
87

8+
import pytest
99
from fluent.runtime import FluentBundle, FluentResource
1010

11-
1211
FTL_CONTENT = """
1312
one = One
1413
two = Two

fluent.syntax/fluent/syntax/ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import json
12
import re
23
import sys
3-
import json
44
from typing import Any, Callable, Dict, List, TypeVar, Union, cast
55

66
Node = TypeVar('Node', bound='BaseNode')

fluent.syntax/fluent/syntax/parser.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import re
22
from typing import Any, Callable, List, Set, TypeVar, Union, cast
3+
34
from . import ast
4-
from .stream import EOL, FluentParserStream
55
from .errors import ParseError
6+
from .stream import EOL, FluentParserStream
67

78
R = TypeVar("R", bound=ast.SyntaxNode)
89

fluent.syntax/fluent/syntax/serializer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import List, Union
2+
23
from . import ast
34

45

fluent.syntax/fluent/syntax/stream.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from typing import Callable, Union
2+
23
from typing_extensions import Literal
4+
35
from .errors import ParseError
46

57

fluent.syntax/fluent/syntax/visitor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from typing import Any, List
2+
23
from .ast import BaseNode, Node
34

45

fluent.syntax/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from os import path
2+
23
from setuptools import setup
34

45
this_directory = path.abspath(path.dirname(__file__))

fluent.syntax/tests/syntax/test_ast_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import unittest
22

3-
from tests.syntax import dedent_ftl
43
from fluent.syntax.ast import from_json
54
from fluent.syntax.parser import FluentParser
5+
from tests.syntax import dedent_ftl
66

77

88
class TestASTJSON(unittest.TestCase):

fluent.syntax/tests/syntax/test_entry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import unittest
22

3-
from tests.syntax import dedent_ftl
43
from fluent.syntax.ast import from_json
54
from fluent.syntax.parser import FluentParser
65
from fluent.syntax.serializer import FluentSerializer
6+
from tests.syntax import dedent_ftl
77

88

99
class TestParseEntry(unittest.TestCase):

fluent.syntax/tests/syntax/test_equals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22

3-
from tests.syntax import dedent_ftl
43
from fluent.syntax.parser import FluentParser
4+
from tests.syntax import dedent_ftl
55

66

77
class TestEntryEqualToSelf(unittest.TestCase):

fluent.syntax/tests/syntax/test_reference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import os
2-
import json
31
import codecs
2+
import json
3+
import os
44
import unittest
55

66
from fluent.syntax import parse

fluent.syntax/tests/syntax/test_serializer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import unittest
22

3-
from tests.syntax import dedent_ftl
43
from fluent.syntax import FluentParser, FluentSerializer
54
from fluent.syntax.serializer import serialize_expression, serialize_variant_key
5+
from tests.syntax import dedent_ftl
66

77

88
class TestSerializeResource(unittest.TestCase):

fluent.syntax/tests/syntax/test_structure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import os
2-
import json
31
import codecs
2+
import json
3+
import os
44
import unittest
55

66
from fluent.syntax import parse

fluent.syntax/tests/syntax/test_visitor.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from collections import defaultdict
21
import unittest
2+
from collections import defaultdict
33

4+
from fluent.syntax import ast, visitor
45
from fluent.syntax.parser import FluentParser
5-
from fluent.syntax import ast
6-
from fluent.syntax import visitor
76
from tests.syntax import dedent_ftl
87

98

scripts/build-docs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ from datetime import date
66
from fluent.docs import build_root, finalize_builddir
77
from fluent.docs.build import build
88

9-
109
if __name__ == "__main__":
1110
parser = argparse.ArgumentParser()
1211
parser.add_argument(

tools/fluentfmt.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/python
22

3-
import sys
43
import codecs
4+
import sys
5+
56
from fluent.syntax import parse, serialize
67

78
sys.path.append("./")

tools/parse.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/usr/bin/python
22

3-
import sys
43
import codecs
5-
from fluent.syntax import parse
64
import json
5+
import sys
6+
7+
from fluent.syntax import parse
78

89
sys.path.append('./')
910

tools/serialize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/python
22

3-
import sys
4-
import json
53
import codecs
4+
import json
5+
import sys
6+
67
from fluent.syntax import ast, serialize
78

89
sys.path.append("./")

0 commit comments

Comments
 (0)