Skip to content

Commit 2917dc4

Browse files
committed
Apply import sort fixers from ruff.
1 parent 2a95f57 commit 2917dc4

20 files changed

Lines changed: 47 additions & 48 deletions

importlib_resources/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
"""
99

1010
from ._common import (
11+
Anchor,
12+
Package,
1113
as_file,
1214
files,
13-
Package,
14-
Anchor,
1515
)
16-
1716
from ._functional import (
1817
contents,
1918
is_resource,
@@ -23,10 +22,8 @@
2322
read_binary,
2423
read_text,
2524
)
26-
2725
from .abc import ResourceReader
2826

29-
3027
__all__ = [
3128
'Package',
3229
'Anchor',

importlib_resources/_common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import contextlib
2+
import functools
3+
import importlib
4+
import inspect
5+
import itertools
16
import os
27
import pathlib
38
import tempfile
4-
import functools
5-
import contextlib
69
import types
7-
import importlib
8-
import inspect
910
import warnings
10-
import itertools
11+
from typing import Optional, Union, cast
1112

12-
from typing import Union, Optional, cast
1313
from .abc import ResourceReader, Traversable
1414

1515
Package = Union[types.ModuleType, str]

importlib_resources/_functional.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
import warnings
44

5-
from ._common import files, as_file
6-
5+
from ._common import as_file, files
76

87
_MISSING = object()
98

importlib_resources/abc.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
import io
33
import itertools
44
import pathlib
5-
from typing import Any, BinaryIO, Iterable, Iterator, NoReturn, Text, Optional
6-
from typing import runtime_checkable, Protocol
5+
from typing import (
6+
Any,
7+
BinaryIO,
8+
Iterable,
9+
Iterator,
10+
NoReturn,
11+
Optional,
12+
Protocol,
13+
Text,
14+
runtime_checkable,
15+
)
716

817
from .compat.py38 import StrPath
918

10-
1119
__all__ = ["ResourceReader", "Traversable", "TraversableResources"]
1220

1321

importlib_resources/compat/py38.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import os
22
import sys
3-
43
from typing import Union
54

6-
75
if sys.version_info >= (3, 9):
86
StrPath = Union[str, os.PathLike[str]]
97
else:

importlib_resources/compat/py39.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import sys
22

3-
43
__all__ = ['ZipPath']
54

65

importlib_resources/future/adapters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from contextlib import suppress
44
from types import SimpleNamespace
55

6-
from .. import readers, _adapters
6+
from .. import _adapters, readers
77

88

99
def _block_standard(reader_getter):

importlib_resources/readers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
import collections
44
import contextlib
55
import itertools
6-
import pathlib
76
import operator
7+
import pathlib
88
import re
99
import warnings
1010
from collections.abc import Iterator
1111

1212
from . import abc
13-
1413
from ._itertools import only
1514
from .compat.py39 import ZipPath
1615

importlib_resources/tests/_path.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import pathlib
21
import functools
3-
4-
from typing import Dict, Union
5-
from typing import runtime_checkable
6-
from typing import Protocol
7-
2+
import pathlib
3+
from typing import Dict, Protocol, Union, runtime_checkable
84

95
####
106
# from jaraco.path 3.7.1

importlib_resources/tests/test_compatibilty_files.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import unittest
33

44
import importlib_resources as resources
5-
65
from importlib_resources._adapters import (
76
CompatibilityFiles,
87
wrap_spec,

0 commit comments

Comments
 (0)