22from collections import namedtuple
33from enum import IntEnum
44
5- from .__about__ import (
6- __author__ , __copyright__ , __email__ , __license__ , __summary__ , __title__ ,
7- __uri__ , __version__ ,
8- )
5+ from .__about__ import __author__
6+ from .__about__ import __copyright__
7+ from .__about__ import __email__
8+ from .__about__ import __license__
9+ from .__about__ import __summary__
10+ from .__about__ import __title__
11+ from .__about__ import __uri__
12+ from .__about__ import __version__
913from .stdlib_list import STDLIB_NAMES
1014
1115__all__ = [
12- "__title__" , "__summary__" , "__uri__" , "__version__" , "__author__" ,
13- "__email__" , "__license__" , "__copyright__" ,
16+ "__title__" ,
17+ "__summary__" ,
18+ "__uri__" ,
19+ "__version__" ,
20+ "__author__" ,
21+ "__email__" ,
22+ "__license__" ,
23+ "__copyright__" ,
1424]
1525
16- DEFAULT_IMPORT_ORDER_STYLE = ' cryptography'
26+ DEFAULT_IMPORT_ORDER_STYLE = " cryptography"
1727
1828ClassifiedImport = namedtuple (
1929 'ClassifiedImport' ,
2030 ['type' , 'is_from' , 'modules' , 'names' , 'lineno' , 'level' , 'package' ,
2131 'type_checking' ],
2232)
23- NewLine = namedtuple (' NewLine' , [' lineno' ])
33+ NewLine = namedtuple (" NewLine" , [" lineno" ])
2434
2535
2636class ImportType (IntEnum ):
@@ -49,7 +59,7 @@ def get_package_names(name):
4959 package_names = [last_package_name ]
5060
5161 for part in reversed (parts ):
52- last_package_name = f' { last_package_name } .{ part } '
62+ last_package_name = f" { last_package_name } .{ part } "
5363 package_names .append (last_package_name )
5464
5565 return package_names
@@ -85,7 +95,12 @@ def visit_Import(self, node): # noqa: N802
8595 else :
8696 type_ = ImportType .MIXED
8797 classified_import = ClassifiedImport (
88- type_ , False , modules , [], node .lineno , 0 ,
98+ type_ ,
99+ False ,
100+ modules ,
101+ [],
102+ node .lineno ,
103+ 0 ,
89104 root_package_name (modules [0 ]),
90105 self ._type_checking_import (node ),
91106 )
@@ -100,8 +115,12 @@ def visit_ImportFrom(self, node): # noqa: N802
100115 type_ = self ._classify_type (module )
101116 names = [alias .name for alias in node .names ]
102117 classified_import = ClassifiedImport (
103- type_ , True , [module ], names ,
104- node .lineno , node .level ,
118+ type_ ,
119+ True ,
120+ [module ],
121+ names ,
122+ node .lineno ,
123+ node .level ,
105124 root_package_name (module ),
106125 self ._type_checking_import (node ),
107126 )
0 commit comments