Skip to content

Commit dd87dd5

Browse files
committed
Update to isort 5 with Black profile support
1 parent dece040 commit dd87dd5

134 files changed

Lines changed: 197 additions & 41 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
types: []
1010

1111
- repo: https://github.com/timothycrosley/isort
12-
rev: 7c29dd9d55161704cfc45998c6f5c2c43d39264b # frozen: 4.3.21
12+
rev: 9ae09866e278fbc6ec0383ccb16b5c84e78e6e4d # frozen: 5.3.2
1313
hooks:
1414
- id: isort
1515

Tests/check_imaging_leaks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python
22
import pytest
3+
34
from PIL import Image
45

56
from .helper import is_win32
@@ -11,7 +12,7 @@
1112

1213

1314
def _get_mem_usage():
14-
from resource import getpagesize, getrusage, RUSAGE_SELF
15+
from resource import RUSAGE_SELF, getpagesize, getrusage
1516

1617
mem = getrusage(RUSAGE_SELF).ru_maxrss
1718
return mem * getpagesize() / 1024 / 1024

Tests/check_j2k_leaks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from io import BytesIO
22

33
import pytest
4+
45
from PIL import Image
56

67
from .helper import is_win32, skip_unless_feature
@@ -18,7 +19,7 @@
1819

1920

2021
def test_leak_load():
21-
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
22+
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
2223

2324
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
2425
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))
@@ -28,7 +29,7 @@ def test_leak_load():
2829

2930

3031
def test_leak_save():
31-
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
32+
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
3233

3334
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
3435
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))

Tests/check_j2k_overflow.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from PIL import Image
34

45

Tests/check_large_memory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22

33
import pytest
4+
45
from PIL import Image
56

67
# This test is not run automatically.

Tests/check_large_memory_numpy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22

33
import pytest
4+
45
from PIL import Image
56

67
# This test is not run automatically.

Tests/check_libtiff_segfault.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from PIL import Image
34

45
TEST_FILE = "Tests/images/libtiff_segfault.tif"

Tests/helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from io import BytesIO
1212

1313
import pytest
14+
1415
from PIL import Image, ImageMath, features
1516

1617
logger = logging.getLogger(__name__)
@@ -184,7 +185,7 @@ def _get_mem_usage(self):
184185
:returns: memory usage in kilobytes
185186
"""
186187

187-
from resource import getrusage, RUSAGE_SELF
188+
from resource import RUSAGE_SELF, getrusage
188189

189190
mem = getrusage(RUSAGE_SELF).ru_maxrss
190191
if sys.platform == "darwin":

Tests/test_bmp_reference.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22

33
import pytest
4+
45
from PIL import Image
56

67
from .helper import assert_image_similar

Tests/test_box_blur.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from PIL import Image, ImageFilter
34

45
sample = Image.new("L", (7, 5))

0 commit comments

Comments
 (0)