Update to isort 5 with Black profile support

This commit is contained in:
Hugo van Kemenade 2020-08-07 13:28:33 +03:00
parent dece040ee8
commit dd87dd50c0
134 changed files with 197 additions and 41 deletions

View File

@ -9,7 +9,7 @@ repos:
types: []
- repo: https://github.com/timothycrosley/isort
rev: 7c29dd9d55161704cfc45998c6f5c2c43d39264b # frozen: 4.3.21
rev: 9ae09866e278fbc6ec0383ccb16b5c84e78e6e4d # frozen: 5.3.2
hooks:
- id: isort

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python
import pytest
from PIL import Image
from .helper import is_win32
@ -11,7 +12,7 @@ pytestmark = pytest.mark.skipif(is_win32(), reason="requires Unix or macOS")
def _get_mem_usage():
from resource import getpagesize, getrusage, RUSAGE_SELF
from resource import RUSAGE_SELF, getpagesize, getrusage
mem = getrusage(RUSAGE_SELF).ru_maxrss
return mem * getpagesize() / 1024 / 1024

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import is_win32, skip_unless_feature
@ -18,7 +19,7 @@ pytestmark = [
def test_leak_load():
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))
@ -28,7 +29,7 @@ def test_leak_load():
def test_leak_save():
from resource import setrlimit, RLIMIT_AS, RLIMIT_STACK
from resource import RLIMIT_AS, RLIMIT_STACK, setrlimit
setrlimit(RLIMIT_STACK, (stack_size, stack_size))
setrlimit(RLIMIT_AS, (mem_limit, mem_limit))

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
# This test is not run automatically.

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
# This test is not run automatically.

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
TEST_FILE = "Tests/images/libtiff_segfault.tif"

View File

@ -11,6 +11,7 @@ import tempfile
from io import BytesIO
import pytest
from PIL import Image, ImageMath, features
logger = logging.getLogger(__name__)
@ -184,7 +185,7 @@ class PillowLeakTestCase:
:returns: memory usage in kilobytes
"""
from resource import getrusage, RUSAGE_SELF
from resource import RUSAGE_SELF, getrusage
mem = getrusage(RUSAGE_SELF).ru_maxrss
if sys.platform == "darwin":

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image
from .helper import assert_image_similar

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter
sample = Image.new("L", (7, 5))

View File

@ -1,6 +1,7 @@
from array import array
import pytest
from PIL import Image, ImageFilter
from .helper import assert_image_equal

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
from .helper import is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import hopper

View File

@ -2,6 +2,7 @@ import io
import re
import pytest
from PIL import features
from .helper import skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageSequence, PngImagePlugin

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import BmpImagePlugin, Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import BufrStubImagePlugin, Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import CurImagePlugin, Image
TEST_FILE = "Tests/images/deerstalker.cur"

View File

@ -1,4 +1,5 @@
import pytest
from PIL import DcxImagePlugin, Image
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -2,6 +2,7 @@
from io import BytesIO
import pytest
from PIL import DdsImagePlugin, Image
from .helper import assert_image_equal

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import EpsImagePlugin, Image, features
from .helper import assert_image_similar, hopper, skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import FitsStubImagePlugin, Image
TEST_FILE = "Tests/images/hopper.fits"

View File

@ -1,4 +1,5 @@
import pytest
from PIL import FliImagePlugin, Image
from .helper import assert_image_equal, is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
FpxImagePlugin = pytest.importorskip(

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GbrImagePlugin, Image
from .helper import assert_image_equal

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GdImageFile, UnidentifiedImageError
TEST_GD_FILE = "Tests/images/hopper.gd"

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import GifImagePlugin, Image, ImageDraw, ImagePalette, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL.GimpPaletteFile import GimpPaletteFile

View File

@ -1,4 +1,5 @@
import pytest
from PIL import GribStubImagePlugin, Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Hdf5StubImagePlugin, Image
TEST_FILE = "Tests/images/hdf5.h5"

View File

@ -2,6 +2,7 @@ import io
import sys
import pytest
from PIL import IcnsImagePlugin, Image, features
from .helper import assert_image_equal, assert_image_similar

View File

@ -1,6 +1,7 @@
import io
import pytest
from PIL import IcoImagePlugin, Image, ImageDraw
from .helper import assert_image_equal, hopper

View File

@ -1,6 +1,7 @@
import filecmp
import pytest
from PIL import Image, ImImagePlugin
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -3,6 +3,7 @@ import re
from io import BytesIO
import pytest
from PIL import (
ExifTags,
Image,

View File

@ -2,6 +2,7 @@ import re
from io import BytesIO
import pytest
from PIL import Image, ImageFile, Jpeg2KImagePlugin, features
from .helper import (

View File

@ -7,6 +7,7 @@ from collections import namedtuple
from ctypes import c_float
import pytest
from PIL import Image, ImageFilter, TiffImagePlugin, TiffTags, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, McIdasImagePlugin
from .helper import assert_image_equal

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImagePalette
from .helper import assert_image_similar, hopper, skip_unless_feature

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import assert_image_similar, is_pypy, skip_unless_feature

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image, MspImagePlugin
from .helper import assert_image_equal, hopper

View File

@ -2,6 +2,7 @@ import os.path
import subprocess
import pytest
from PIL import Image
from .helper import IMCONVERT, assert_image_equal, hopper, imagemagick_available

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFile, PcxImagePlugin
from .helper import assert_image_equal, hopper

View File

@ -5,6 +5,7 @@ import tempfile
import time
import pytest
from PIL import Image, PdfParser
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, PixarImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -3,6 +3,7 @@ import zlib
from io import BytesIO
import pytest
from PIL import Image, ImageFile, PngImagePlugin, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, PsdImagePlugin
from .helper import assert_image_similar, hopper, is_pypy

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, SgiImagePlugin
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -2,6 +2,7 @@ import tempfile
from io import BytesIO
import pytest
from PIL import Image, ImageSequence, SpiderImagePlugin
from .helper import assert_image_equal, hopper, is_pypy

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image, SunImagePlugin
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, TarIO, features
from .helper import is_pypy

View File

@ -3,6 +3,7 @@ from glob import glob
from itertools import product
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -2,6 +2,7 @@ import os
from io import BytesIO
import pytest
from PIL import Image, TiffImagePlugin
from PIL.TiffImagePlugin import RESOLUTION_UNIT, X_RESOLUTION, Y_RESOLUTION

View File

@ -2,6 +2,7 @@ import io
import struct
import pytest
from PIL import Image, TiffImagePlugin, TiffTags
from PIL.TiffImagePlugin import IFDRational

View File

@ -2,6 +2,7 @@ import io
import re
import pytest
from PIL import Image, WebPImagePlugin, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, WmfImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, XpmImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, XVThumbImagePlugin
from .helper import assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import BdfFontFile, FontFile
filename = "Tests/images/courB08.bdf"

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import FontFile, Image, ImageDraw, ImageFont, PcfFontFile
from .helper import assert_image_equal, assert_image_similar, skip_unless_feature

View File

@ -3,8 +3,9 @@ import os
import shutil
import tempfile
import PIL
import pytest
import PIL
from PIL import Image, ImageDraw, ImagePalette, ImageShow, UnidentifiedImageError
from .helper import (

View File

@ -4,9 +4,9 @@ import subprocess
import sys
import sysconfig
import pytest
from setuptools.command.build_ext import new_compiler
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper, is_win32, on_ci
@ -17,8 +17,9 @@ if os.environ.get("PYTHONOPTIMIZE") == "2":
cffi = None
else:
try:
from PIL import PyAccess
import cffi
from PIL import PyAccess
except ImportError:
cffi = None

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image, assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageQt
from .helper import assert_image_equal, hopper

View File

@ -1,6 +1,7 @@
import os
import pytest
from PIL import Image
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImagePalette
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import assert_image, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageMath, ImageMode
from .helper import convert_to_comparable, skip_unless_feature

View File

@ -1,6 +1,7 @@
from contextlib import contextmanager
import pytest
from PIL import Image, ImageDraw
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -4,6 +4,7 @@ Tests for resize functionality.
from itertools import permutations
import pytest
from PIL import Image
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image
from .helper import (

View File

@ -1,6 +1,7 @@
import math
import pytest
from PIL import Image, ImageTransform
from .helper import assert_image_equal, assert_image_similar, hopper

View File

@ -4,6 +4,7 @@ import re
from io import BytesIO
import pytest
from PIL import Image, ImageMode, features
from .helper import assert_image, assert_image_equal, assert_image_similar, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageColor

View File

@ -1,6 +1,7 @@
import os.path
import pytest
from PIL import Image, ImageColor, ImageDraw, ImageFont
from .helper import (

View File

@ -1,6 +1,7 @@
from io import BytesIO
import pytest
from PIL import EpsImagePlugin, Image, ImageFile, features
from .helper import (

View File

@ -7,6 +7,7 @@ from io import BytesIO
import pytest
from packaging.version import parse as parse_version
from PIL import Image, ImageDraw, ImageFont, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageDraw, ImageFont
from .helper import assert_image_similar

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageDraw, ImageFont
from .helper import assert_image_similar, skip_unless_feature

View File

@ -3,6 +3,7 @@ import subprocess
import sys
import pytest
from PIL import Image, ImageGrab
from .helper import assert_image, assert_image_equal_tofile, skip_unless_feature

View File

@ -1,5 +1,6 @@
# Test the ImageMorphology functionality
import pytest
from PIL import Image, ImageMorph, _imagingmorph
from .helper import assert_image_equal, hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageOps, features
from .helper import (

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageFilter

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImagePalette
from .helper import assert_image_equal

View File

@ -2,6 +2,7 @@ import array
import struct
import pytest
from PIL import Image, ImagePath

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImageQt
from .helper import hopper

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageSequence, TiffImagePlugin
from .helper import assert_image_equal, hopper, skip_unless_feature

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageShow
from .helper import hopper, is_win32, on_ci

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image, ImageStat
from .helper import hopper

View File

@ -1,13 +1,14 @@
import pytest
from PIL import Image
from .helper import assert_image_equal, hopper
try:
from PIL import ImageTk
import tkinter as tk
from PIL import ImageTk
dir(ImageTk)
HAS_TK = True
except (OSError, ImportError):

View File

@ -1,4 +1,5 @@
import pytest
from PIL import ImageWin
from .helper import hopper, is_win32

View File

@ -1,4 +1,5 @@
import pytest
from PIL import Image

View File

@ -1,6 +1,7 @@
import sys
import pytest
from PIL import Image
X = 255

Some files were not shown because too many files have changed in this diff Show More