Skip to content

Commit

Permalink
Set up isort in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mgedmin committed Dec 6, 2020
1 parent 963f892 commit c842362
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -73,6 +73,7 @@ jobs:
matrix:
toxenv:
- flake8
- isort

steps:
- name: Git clone
Expand Down
16 changes: 11 additions & 5 deletions imgdiff.py
Expand Up @@ -4,19 +4,25 @@
Released under the MIT licence.
"""
import os
import sys

import optparse
import os
import shutil
import subprocess
import sys
import tempfile
import time

# There are two ways PIL is packaged
# There are two ways PIL used to be packaged
try:
from PIL import Image, ImageDraw, ImageChops, ImageFilter
from PIL import Image, ImageChops, ImageDraw, ImageFilter
except ImportError:
import Image, ImageDraw, ImageChops, ImageFilter
# This is the old way, and probably nobody uses it anymore. (PIL's dead
# anyway, Pillow supplanted it.)
import Image
import ImageChops
import ImageDraw
import ImageFilter


__version__ = '1.7.2.dev0'
Expand Down
3 changes: 2 additions & 1 deletion setup.py
@@ -1,5 +1,6 @@
#!/usr/bin/python
import os, re
import os
import re

from setuptools import setup

Expand Down
9 changes: 5 additions & 4 deletions tests.py
Expand Up @@ -4,15 +4,16 @@
import sys
import tempfile
import unittest
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO

import mock

import imgdiff

try:
from cStringIO import StringIO
except ImportError:
from io import StringIO


@mock.patch('sys.stderr', StringIO())
class TestMain(unittest.TestCase):
Expand Down
5 changes: 5 additions & 0 deletions tox.ini
Expand Up @@ -23,3 +23,8 @@ commands =
deps = flake8
skip_install = true
commands = flake8 imgdiff.py setup.py tests.py

[testenv:isort]
deps = isort
skip_install = true
commands = isort {posargs: -c --diff imgdiff.py setup.py tests.py}

0 comments on commit c842362

Please sign in to comment.