From 147ccfcc1190136631b1933131952b1639b7f388 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 3 Nov 2023 13:34:19 +0000 Subject: [PATCH] QA: Apply isort suggestions. --- ST7735.py | 5 +++-- examples/framerate.py | 6 +++--- examples/gif.py | 8 +++++--- examples/image.py | 1 + examples/scrolling-text.py | 6 ++---- examples/shapes.py | 4 +--- setup.py | 2 +- st7735/__init__.py | 5 ++--- tests/conftest.py | 1 + 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ST7735.py b/ST7735.py index b998022..bef6ffd 100644 --- a/ST7735.py +++ b/ST7735.py @@ -1,4 +1,5 @@ -from st7735 import * # noqa F403 from warnings import warn -warn("Using \"import ST7735\" is deprecated. Please \"import st7735\" (all lowercase)!", DeprecationWarning, stacklevel=2) \ No newline at end of file +from st7735 import * # noqa F403 + +warn("Using \"import ST7735\" is deprecated. Please \"import st7735\" (all lowercase)!", DeprecationWarning, stacklevel=2) diff --git a/examples/framerate.py b/examples/framerate.py index 333ebfa..ddf6e67 100644 --- a/examples/framerate.py +++ b/examples/framerate.py @@ -18,12 +18,12 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -import time import math import sys +import time + +from PIL import Image, ImageDraw -from PIL import Image -from PIL import ImageDraw import ST7735 as ST7735 SPI_SPEED_MHZ = 10 # Higher speed = higher framerate diff --git a/examples/gif.py b/examples/gif.py index 1565d02..693a4bb 100644 --- a/examples/gif.py +++ b/examples/gif.py @@ -18,10 +18,12 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from PIL import Image -import ST7735 -import time import sys +import time + +from PIL import Image + +import ST7735 print(""" gif.py - Display a gif on the LCD. diff --git a/examples/image.py b/examples/image.py index 8f1a5f1..ce4c3a9 100644 --- a/examples/image.py +++ b/examples/image.py @@ -21,6 +21,7 @@ import sys from PIL import Image + import ST7735 as ST7735 print(""" diff --git a/examples/scrolling-text.py b/examples/scrolling-text.py index 262718e..dd19f8e 100644 --- a/examples/scrolling-text.py +++ b/examples/scrolling-text.py @@ -1,10 +1,8 @@ -from PIL import Image -from PIL import ImageDraw -from PIL import ImageFont import time -import ST7735 +from PIL import Image, ImageDraw, ImageFont +import ST7735 MESSAGE = "Hello World! How are you today?" diff --git a/examples/shapes.py b/examples/shapes.py index 341338c..5e0cf12 100644 --- a/examples/shapes.py +++ b/examples/shapes.py @@ -18,9 +18,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -from PIL import Image -from PIL import ImageDraw -from PIL import ImageFont +from PIL import Image, ImageDraw, ImageFont import ST7735 diff --git a/setup.py b/setup.py index ab16e72..9548e2c 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -from setuptools import setup, __version__ from pkg_resources import parse_version +from setuptools import __version__, setup minimum_version = parse_version('30.4.0') diff --git a/st7735/__init__.py b/st7735/__init__.py index 5859f27..2c9c880 100644 --- a/st7735/__init__.py +++ b/st7735/__init__.py @@ -20,11 +20,10 @@ # THE SOFTWARE. import numbers import time + import numpy as np - -import spidev import RPi.GPIO as GPIO - +import spidev __version__ = "0.0.5" diff --git a/tests/conftest.py b/tests/conftest.py index bdc5359..009dbb4 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,6 +3,7 @@ These allow the mocking of various Python modules that might otherwise have runtime side-effects. """ import sys + import mock import pytest