Skip to content

Commit 549d332

Browse files
committed
Optimised imports with isort
1 parent 0985a5a commit 549d332

File tree

11 files changed

+28
-26
lines changed

11 files changed

+28
-26
lines changed

.isort.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,12 @@ import_heading_firstparty=this package
99
balanced_wrapping=False
1010
lines_between_types=0
1111
use_parentheses=True
12-
default_section=FIRSTPARTY
12+
default_section=LOCALFOLDER
1313
no_lines_before=LOCALFOLDER
14+
known_third_party=
15+
pytest
16+
aenum
17+
pydash
18+
pytz
19+
known_first_party=
20+
domdf_python_tools

domdf_python_tools/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@
4848
# MA 02110-1301, USA.
4949
#
5050

51+
# this package
52+
from domdf_python_tools import doctools, pagesizes, paths, terminal, utils
5153
from domdf_python_tools.utils import *
52-
from domdf_python_tools import paths, terminal, utils, doctools, pagesizes
5354

5455
__all__ = ["paths", "terminal", "utils", "dates"]
5556

domdf_python_tools/dates.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
from collections import OrderedDict
3737
from typing import Optional, Union
3838

39-
# 3rd party
4039
try:
4140
import pytz
4241

domdf_python_tools/enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
# MA 02110-1301, USA.
2525
#
2626

27+
# 3rd party
2728
from aenum import Enum, IntEnum # type: ignore
2829

2930
__all__ = ["IntEnum", "StrEnum"]

domdf_python_tools/pagesizes/classes.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,13 @@
3131
# MA 02110-1301, USA.
3232
#
3333

34+
# stdlib
3435
from collections import namedtuple
3536
from collections.abc import Sequence
3637
from typing import List, Tuple
3738

3839
from ._types import AnyNumber
39-
from .units import (
40-
cicero,
41-
cm,
42-
didot,
43-
inch,
44-
mm,
45-
new_cicero,
46-
new_didot,
47-
pica,
48-
pt,
49-
scaled_point,
50-
um,
51-
)
40+
from .units import cicero, cm, didot, inch, mm, new_cicero, new_didot, pica, pt, scaled_point, um
5241
from .utils import _rounders, convert_from
5342

5443
__all__ = [

domdf_python_tools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# stdlib
3030
import sys
3131
from collections.abc import Sequence
32-
from typing import Any, Iterable, Generator, List, Tuple
32+
from typing import Any, Generator, Iterable, List, Tuple
3333

3434
pyversion = int(sys.version[0]) # Python Version
3535

tests/test_dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import datetime
1212

1313
# 3rd party
14-
import pytz
1514
import pytest # type: ignore
15+
import pytz
1616

1717
# this package
1818
from domdf_python_tools import dates

tests/test_enums.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
"""
99

10+
# this package
1011
from domdf_python_tools import enums
1112

1213

tests/test_pagesizes.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
88
"""
99

10+
# this package
1011
from domdf_python_tools.pagesizes import A4, BaseSize, inch, mm, parse_measurement
1112

1213

tests/test_utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
88
"""
99

10-
import types
11-
import pathlib
10+
# stdlib
1211
import decimal
12+
import pathlib
13+
import types
1314

15+
# 3rd party
1416
import pytest # type: ignore
1517

16-
from domdf_python_tools.utils import str2tuple, tuple2str, chunks, list2str, list2string, pyversion
18+
# this package
1719
from domdf_python_tools import utils
20+
from domdf_python_tools.utils import chunks, list2str, list2string, pyversion, str2tuple, tuple2str
1821

1922

2023
def test_pyversion():

0 commit comments

Comments
 (0)