diff -Nru luma.led-matrix-1.5.0+dfsg1/CHANGES.rst luma.led-matrix-1.7.0/CHANGES.rst --- luma.led-matrix-1.5.0+dfsg1/CHANGES.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/CHANGES.rst 2022-10-19 19:37:59.000000000 +0000 @@ -4,6 +4,14 @@ +------------+------------------------------------------------------------------------+------------+ | Version | Description | Date | +============+========================================================================+============+ +| **1.7.0** | * Drop support for Python 3.6 | 2022/10/19 | +| | * Switch to implicit namespace package configuration | | +| | * luma.core 2.4.0 or newer is required now | | ++------------+------------------------------------------------------------------------+------------+ +| **1.6.1** | * Trigger publish on github actions | 2022/01/09 | ++------------+------------------------------------------------------------------------+------------+ +| **1.6.0** | * Remove redundant ``ws2812`` package | 2022/01/03 | ++------------+------------------------------------------------------------------------+------------+ | **1.5.0** | * Drop support for Python 2.7, only 3.5 or newer is supported now | 2020/07/04 | +------------+------------------------------------------------------------------------+------------+ | **1.4.1** | * Make ``contrast`` an optional constructor argument | 2019/12/08 | diff -Nru luma.led-matrix-1.5.0+dfsg1/.coveragerc luma.led-matrix-1.7.0/.coveragerc --- luma.led-matrix-1.5.0+dfsg1/.coveragerc 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/.coveragerc 2022-10-19 19:37:59.000000000 +0000 @@ -2,6 +2,7 @@ [run] source = luma.led_matrix omit = + luma/__init__.py setup.py .tox/* doc/* diff -Nru luma.led-matrix-1.5.0+dfsg1/debian/changelog luma.led-matrix-1.7.0/debian/changelog --- luma.led-matrix-1.5.0+dfsg1/debian/changelog 2021-03-20 21:22:14.000000000 +0000 +++ luma.led-matrix-1.7.0/debian/changelog 2023-01-21 09:31:23.000000000 +0000 @@ -1,3 +1,16 @@ +luma.led-matrix (1.7.0-1) unstable; urgency=medium + + [ Debian Janitor ] + * [d65a3f2] Apply multi-arch hints. + luma.led-matrix-doc: Add Multi-Arch: foreign. + + [ Anton Gladky ] + * [7b2e892] New upstream version 1.7.0. + * [f3aad59] Update standards version to 4.6.2, no changes needed. + * [3f62837] Replace sphinx by python3-sphinx. + * [d586fb9] Set minimal luma-core version to 2.4.0 + + -- Anton Gladky Sat, 21 Jan 2023 10:31:23 +0100 + luma.led-matrix (1.5.0+dfsg1-3) unstable; urgency=medium * [0b9afd9] Move package into the Electronics Team diff -Nru luma.led-matrix-1.5.0+dfsg1/debian/control luma.led-matrix-1.7.0/debian/control --- luma.led-matrix-1.5.0+dfsg1/debian/control 2021-03-20 21:20:48.000000000 +0000 +++ luma.led-matrix-1.7.0/debian/control 2023-01-21 09:31:23.000000000 +0000 @@ -9,8 +9,8 @@ python3-pil, python3-pytest, python3-setuptools, - sphinx -Standards-Version: 4.5.1 + python3-sphinx +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/electronics-team/luma.led-matrix Vcs-Git: https://salsa.debian.org/electronics-team/luma.led-matrix.git Homepage: https://github.com/rm-hull/luma.led_matrix @@ -22,7 +22,7 @@ Depends: ${misc:Depends}, ${python3:Depends}, ${shlibs:Depends}, - python3-luma.core + python3-luma.core (>= 2.4.0) Description: library interfacing LED matrix displays Library interfacing LED matrix displays with the MAX7219 driver (using SPI), WS2812 (NeoPixels, inc Pimoroni Unicorn pHat/Hat @@ -42,6 +42,7 @@ Section: python Depends: ${misc:Depends}, ${sphinxdoc:Depends} +Multi-Arch: foreign Description: doc for library interfacing LED matrix displays Library interfacing LED matrix displays with the MAX7219 driver (using SPI), WS2812 (NeoPixels, inc Pimoroni Unicorn pHat/Hat diff -Nru luma.led-matrix-1.5.0+dfsg1/doc/conf.py luma.led-matrix-1.7.0/doc/conf.py --- luma.led-matrix-1.5.0+dfsg1/doc/conf.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/doc/conf.py 2022-10-19 19:37:59.000000000 +0000 @@ -58,7 +58,7 @@ master_doc = 'index' # General information about the project. -project = u'Luma.LED_Matrix: Display driver for MAX7219, WS2812' +project = u'Luma.LED_Matrix: Display driver for MAX7219, WS2812, APA102' author = u'Richard Hull and contributors' copyright = u'2015-{0}, {1}'.format(datetime.now().year, author) @@ -71,7 +71,7 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +language = 'en' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff -Nru luma.led-matrix-1.5.0+dfsg1/doc/index.rst luma.led-matrix-1.7.0/doc/index.rst --- luma.led-matrix-1.5.0+dfsg1/doc/index.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/doc/index.rst 2022-10-19 19:37:59.000000000 +0000 @@ -1,7 +1,8 @@ Luma.LED_Matrix: Display drivers for MAX7219, WS2812, APA102 ============================================================ -.. image:: https://travis-ci.org/rm-hull/luma.led_matrix.svg?branch=master - :target: https://travis-ci.org/rm-hull/luma.led_matrix + +.. image:: https://github.com/rm-hull/luma.led_matrix/workflows/luma.led_matrix/badge.svg?branch=master + :target: https://github.com/rm-hull/luma.led_matrix/actions?workflow=luma.led_matrix .. image:: https://coveralls.io/repos/github/rm-hull/luma.led_matrix/badge.svg?branch=master :target: https://coveralls.io/github/rm-hull/luma.led_matrix?branch=master @@ -15,7 +16,10 @@ .. image:: https://img.shields.io/pypi/v/luma.led_matrix.svg :target: https://pypi.python.org/pypi/luma.led_matrix -.. image:: https://img.shields.io/maintenance/yes/2019.svg?maxAge=2592000 +.. image:: https://img.shields.io/pypi/dm/luma.led_matrix + :target: https://pypi.python.org/project/luma.led_matrix + +.. image:: https://img.shields.io/maintenance/yes/2021.svg?maxAge=2592000 .. toctree:: :maxdepth: 2 diff -Nru luma.led-matrix-1.5.0+dfsg1/doc/install.rst luma.led-matrix-1.7.0/doc/install.rst --- luma.led-matrix-1.5.0+dfsg1/doc/install.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/doc/install.rst 2022-10-19 19:37:59.000000000 +0000 @@ -1,14 +1,6 @@ Installation ------------ -.. note:: The library has been tested against Python 2.7 and 3.4+. - - For a **Python 3** installation, substitute the following in the - instructions below. - - * ``pip`` ⇒ ``pip3``, - * ``python`` ⇒ ``python3``, - * ``python-dev`` ⇒ ``python3-dev``, - * ``python-pip`` ⇒ ``python3-pip``. +.. note:: The library has been tested against Python 3.6 and newer. Pre-requisites ^^^^^^^^^^^^^^ @@ -109,7 +101,7 @@ Install the dependencies for library first with:: $ sudo usermod -a -G spi,gpio pi - $ sudo apt install build-essential python-dev python-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 + $ sudo apt install build-essential python3-dev python3-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 .. warning:: The default ``pip`` and ``setuptools`` bundled with apt on Raspbian are really old, and can cause components to not be installed properly. Make sure they are up to date by upgrading @@ -120,7 +112,7 @@ Proceed to install latest version of the luma.led_matrix library directly from `PyPI `_:: - $ sudo -H pip install --upgrade luma.led_matrix + $ sudo python3 -m pip install --upgrade luma.led_matrix Examples ^^^^^^^^ diff -Nru luma.led-matrix-1.5.0+dfsg1/doc/intro.rst luma.led-matrix-1.7.0/doc/intro.rst --- luma.led-matrix-1.5.0+dfsg1/doc/intro.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/doc/intro.rst 2022-10-19 19:37:59.000000000 +0000 @@ -12,7 +12,7 @@ * terminal-style printing, * state management, * dithering to monochrome, -* Python 2.7 and 3.4+ are both supported +* Python 3.6+ is supported .. image:: https://raw.githubusercontent.com/rm-hull/luma.led_matrix/master/doc/images/devices.jpg :alt: max7219 matrix diff -Nru luma.led-matrix-1.5.0+dfsg1/examples/view_message.py luma.led-matrix-1.7.0/examples/view_message.py --- luma.led-matrix-1.5.0+dfsg1/examples/view_message.py 1970-01-01 00:00:00.000000000 +0000 +++ luma.led-matrix-1.7.0/examples/view_message.py 2022-10-19 19:37:59.000000000 +0000 @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Commandline Wrapper +# Thomas Wenzlaff +# See LICENSE.rst for details. + +import time +import argparse + +from luma.led_matrix.device import max7219 +from luma.core.interface.serial import spi, noop +from luma.core.legacy import show_message +from luma.core.legacy.font import proportional, CP437_FONT + + +def output(n, block_orientation, rotate, inreverse, text): + # create matrix device + serial = spi(port=0, device=0, gpio=noop()) + device = max7219(serial, cascaded=n or 1, block_orientation=block_orientation, + rotate=rotate or 0, blocks_arranged_in_reverse_order=inreverse) + print(text) + + show_message(device, text, fill="white", font=proportional(CP437_FONT), scroll_delay=0.05) + time.sleep(1) + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description='view_message arguments', + formatter_class=argparse.ArgumentDefaultsHelpFormatter) + + parser.add_argument('--cascaded', '-n', type=int, default=1, help='Number of cascaded MAX7219 LED matrices') + parser.add_argument('--block-orientation', type=int, default=0, choices=[0, 90, -90], help='Corrects block orientation when wired vertically') + parser.add_argument('--rotate', type=int, default=0, choices=[0, 1, 2, 3], help='Rotate display 0=0°, 1=90°, 2=180°, 3=270°') + parser.add_argument('--reverse-order', type=bool, default=False, help='Set to true if blocks are in reverse order') + parser.add_argument('--text', '-t', default='>>> No text set', help='Set text message') + args = parser.parse_args() + + try: + output(args.cascaded, args.block_orientation, args.rotate, args.reverse_order, args.text) + except KeyboardInterrupt: + pass diff -Nru luma.led-matrix-1.5.0+dfsg1/.github/workflows/main.yml luma.led-matrix-1.7.0/.github/workflows/main.yml --- luma.led-matrix-1.5.0+dfsg1/.github/workflows/main.yml 1970-01-01 00:00:00.000000000 +0000 +++ luma.led-matrix-1.7.0/.github/workflows/main.yml 2022-10-19 19:37:59.000000000 +0000 @@ -0,0 +1,66 @@ +name: luma.led_matrix + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python-minor-version: [7, 8, 9, 10, 11-dev] + name: Python 3.${{ matrix.python-minor-version }} + steps: + - uses: actions/checkout@v3 + - name: Setup pip cache + uses: actions/cache@v3 + id: pipcache + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-py3${{ matrix.python-minor-version }}-pip- + - name: Install system dependencies + run: sudo apt-get install graphviz + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.${{ matrix.python-minor-version }} + check-latest: true + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install Python packages + run: pip install --upgrade setuptools pip wheel tox coveralls + - name: Run tests + env: + TOX_ENV: py3${{ matrix.python-minor-version }} + run: | + python_env=$(echo $TOX_ENV | sed -e s/-dev$//) + python -m tox -e ${python_env} + - name: QA + env: + TOX_ENV: qa,doc + run: python -m tox -e $TOX_ENV + - name: Upload Coverage + run: coveralls --service=github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_FLAG_NAME: ${{ matrix.test-name }} + COVERALLS_PARALLEL: true + + coveralls: + name: Coveralls + needs: build + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Finished + run: | + pip3 install --upgrade coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff -Nru luma.led-matrix-1.5.0+dfsg1/.github/workflows/publish-to-pypi.yml luma.led-matrix-1.7.0/.github/workflows/publish-to-pypi.yml --- luma.led-matrix-1.5.0+dfsg1/.github/workflows/publish-to-pypi.yml 1970-01-01 00:00:00.000000000 +0000 +++ luma.led-matrix-1.7.0/.github/workflows/publish-to-pypi.yml 2022-10-19 19:37:59.000000000 +0000 @@ -0,0 +1,38 @@ +name: Publish Package + +on: + push: + branches: + - master + tags: + - 1.* + +jobs: + build-and-publish: + name: Build and publish Python package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.9 + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install pypa/build + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ . + - name: Publish package to test PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + - name: Publish package to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff -Nru luma.led-matrix-1.5.0+dfsg1/LICENSE.rst luma.led-matrix-1.7.0/LICENSE.rst --- luma.led-matrix-1.5.0+dfsg1/LICENSE.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/LICENSE.rst 2022-10-19 19:37:59.000000000 +0000 @@ -1,7 +1,7 @@ The MIT License (MIT) --------------------- -Copyright (c) 2013-2020 Richard Hull and contributors +Copyright (c) 2013-2022 Richard Hull and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -20,4 +20,3 @@ 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. - diff -Nru luma.led-matrix-1.5.0+dfsg1/luma/__init__.py luma.led-matrix-1.7.0/luma/__init__.py --- luma.led-matrix-1.5.0+dfsg1/luma/__init__.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/luma/__init__.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2017-2019 Richard Hull and contributors -# See LICENSE.rst for details. - -try: - __import__('pkg_resources').declare_namespace(__name__) -except ImportError: - __path__ = __import__('pkgutil').extend_path(__path__, __name__) diff -Nru luma.led-matrix-1.5.0+dfsg1/luma/led_matrix/device.py luma.led-matrix-1.7.0/luma/led_matrix/device.py --- luma.led-matrix-1.5.0+dfsg1/luma/led_matrix/device.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/luma/led_matrix/device.py 2022-10-19 19:37:59.000000000 +0000 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2017-19 Richard Hull and contributors +# Copyright (c) 2017-2022 Richard Hull and contributors # See LICENSE.rst for details. """ @@ -70,7 +70,7 @@ if width <= 0 or width % 8 != 0 or height <= 0 or height % 8 != 0: raise luma.core.error.DeviceDisplayModeError( - "Unsupported display mode: {0} x {1}".format(width, height)) + f"Unsupported display mode: {width} x {height}") assert block_orientation in [0, 90, -90, 180] self._correction_angle = block_orientation @@ -118,8 +118,8 @@ Takes a 1-bit :py:mod:`PIL.Image` and dumps it to the LED matrix display via the MAX7219 serializers. """ - assert(image.mode == self.mode) - assert(image.size == self.size) + assert image.mode == self.mode + assert image.size == self.size image = self.preprocess(image) @@ -156,7 +156,7 @@ :param level: Desired contrast level in the range of 0-255. :type level: int """ - assert(0x00 <= value <= 0xFF) + assert 0x00 <= value <= 0xFF self.data([self._const.INTENSITY, value >> 4] * self.cascaded) def show(self): @@ -216,7 +216,7 @@ self.cascaded = width * height self.capabilities(width, height, rotate, mode="RGB") self._mapping = list(mapping or range(self.cascaded)) - assert(self.cascaded == len(self._mapping)) + assert self.cascaded == len(self._mapping) self._contrast = None self._prev_contrast = 0x70 @@ -255,7 +255,7 @@ resp = ws.ws2811_init(self._leds) if resp != 0: - raise RuntimeError('ws2811_init failed with code {0}'.format(resp)) + raise RuntimeError(f'ws2811_init failed with code {resp}') self.clear() self.show() @@ -269,8 +269,8 @@ Takes a 24-bit RGB :py:mod:`PIL.Image` and dumps it to the daisy-chained WS2812 neopixels. """ - assert(image.mode == self.mode) - assert(image.size == self.size) + assert image.mode == self.mode + assert image.size == self.size ws = self._ws m = self._mapping @@ -305,7 +305,7 @@ :param level: Desired contrast level in the range of 0-255. :type level: int """ - assert(0x00 <= value <= 0xFF) + assert 0x00 <= value <= 0xFF self._contrast = value self._ws.ws2811_channel_t_brightness_set(self._channel, value) self._flush() @@ -313,7 +313,7 @@ def _flush(self): resp = self._ws.ws2811_render(self._leds) if resp != 0: - raise RuntimeError('ws2811_render failed with code {0}'.format(resp)) + raise RuntimeError(f'ws2811_render failed with code {resp}') def __del__(self): # Required because Python will complain about memory leaks @@ -356,7 +356,7 @@ class apa102(device): """ - Serial interface to a series of 'next-gen' RGB neopixels daisy-chained + Serial interface to a series of 'next-gen' RGB DotStar daisy-chained together with APA102 chips. On creation, the array is initialized with the correct number of cascaded @@ -399,7 +399,7 @@ self.cascaded = width * height self.capabilities(width, height, rotate, mode="RGBA") self._mapping = list(mapping or range(self.cascaded)) - assert(self.cascaded == len(self._mapping)) + assert self.cascaded == len(self._mapping) self._last_image = None self.contrast(0x70) @@ -416,8 +416,8 @@ APA102 neopixels. If a pixel is not fully opaque, the alpha channel value is used to set the brightness of the respective RGB LED. """ - assert(image.mode == self.mode) - assert(image.size == self.size) + assert image.mode == self.mode + assert image.size == self.size self._last_image = image.copy() # Send zeros to reset, then pixel values then zeros at end @@ -454,7 +454,7 @@ :param level: Desired contrast level in the range of 0-255. :type level: int """ - assert(0x00 <= value <= 0xFF) + assert 0x00 <= value <= 0xFF self._brightness = value >> 4 if self._last_image is not None: self.display(self._last_image) @@ -478,7 +478,7 @@ def __init__(self, width, undefined="_", **kwargs): if width <= 0 or width % 2 == 1: raise luma.core.error.DeviceDisplayModeError( - "Unsupported display mode: width={0}".format(width)) + f"Unsupported display mode: width={width}") height = 7 mapping = [(i % width) * height + (i // width) for i in range(width * height)] @@ -496,7 +496,7 @@ if not isinstance(value, list): value = [value] * self.device.width - assert(len(value) == self.device.width) + assert len(value) == self.device.width self._colors = observable(value, observer=self._color_chg) def _color_chg(self, color): @@ -575,8 +575,8 @@ If a pixel is not fully opaque, the alpha channel value is used to set the brightness of the respective RGB LED. """ - assert(image.mode == self.mode) - assert(image.size == self.size) + assert image.mode == self.mode + assert image.size == self.size self._last_image = image.copy() # Send zeros to reset, then pixel values then zeros at end @@ -618,7 +618,7 @@ :param level: Desired contrast level in the range of 0-255. :type level: int """ - assert(0x00 <= value <= 0xFF) + assert 0x00 <= value <= 0xFF self._brightness = value if self._last_image is not None: self.display(self._last_image) diff -Nru luma.led-matrix-1.5.0+dfsg1/luma/led_matrix/__init__.py luma.led-matrix-1.7.0/luma/led_matrix/__init__.py --- luma.led-matrix-1.5.0+dfsg1/luma/led_matrix/__init__.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/luma/led_matrix/__init__.py 2022-10-19 19:37:59.000000000 +0000 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2017-18 Richard Hull and contributors +# Copyright (c) 2017-2022 Richard Hull and contributors # See LICENSE.rst for details. """ @@ -7,4 +7,4 @@ RGB NeoPixels (WS2812 / APA102). """ -__version__ = '1.5.0' +__version__ = "1.7.0" diff -Nru luma.led-matrix-1.5.0+dfsg1/MANIFEST.in luma.led-matrix-1.7.0/MANIFEST.in --- luma.led-matrix-1.5.0+dfsg1/MANIFEST.in 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/MANIFEST.in 2022-10-19 19:37:59.000000000 +0000 @@ -1,4 +1,4 @@ -include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg .coveragerc +include README.rst CHANGES.rst CONTRIBUTING.rst LICENSE.rst tox.ini setup.cfg pyproject.toml pytest.ini .coveragerc recursive-include luma *.py diff -Nru luma.led-matrix-1.5.0+dfsg1/pyproject.toml luma.led-matrix-1.7.0/pyproject.toml --- luma.led-matrix-1.5.0+dfsg1/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ luma.led-matrix-1.7.0/pyproject.toml 2022-10-19 19:37:59.000000000 +0000 @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools >= 40.6.0", "wheel"] +build-backend = "setuptools.build_meta" diff -Nru luma.led-matrix-1.5.0+dfsg1/pytest.ini luma.led-matrix-1.7.0/pytest.ini --- luma.led-matrix-1.5.0+dfsg1/pytest.ini 1970-01-01 00:00:00.000000000 +0000 +++ luma.led-matrix-1.7.0/pytest.ini 2022-10-19 19:37:59.000000000 +0000 @@ -0,0 +1,3 @@ +[pytest] +addopts = --timeout=10 -v -r wsx + diff -Nru luma.led-matrix-1.5.0+dfsg1/README.rst luma.led-matrix-1.7.0/README.rst --- luma.led-matrix-1.5.0+dfsg1/README.rst 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/README.rst 2022-10-19 19:37:59.000000000 +0000 @@ -10,8 +10,8 @@ =============== **Display drivers for MAX7219, WS2812, APA102** -.. image:: https://travis-ci.org/rm-hull/luma.led_matrix.svg?branch=master - :target: https://travis-ci.org/rm-hull/luma.led_matrix +.. image:: https://github.com/rm-hull/luma.led_matrix/workflows/luma.led_matrix/badge.svg?branch=master + :target: https://github.com/rm-hull/luma.led_matrix/actions?workflow=luma.led_matrix .. image:: https://coveralls.io/repos/github/rm-hull/luma.led_matrix/badge.svg?branch=master :target: https://coveralls.io/github/rm-hull/luma.led_matrix?branch=master @@ -25,13 +25,16 @@ .. image:: https://img.shields.io/pypi/v/luma.led_matrix.svg :target: https://pypi.python.org/pypi/luma.led_matrix -.. image:: https://img.shields.io/maintenance/yes/2020.svg?maxAge=2592000 +.. image:: https://img.shields.io/pypi/dm/luma.led_matrix + :target: https://pypi.python.org/project/luma.led_matrix + +.. image:: https://img.shields.io/maintenance/yes/2022.svg?maxAge=2592000 Python 3 library interfacing LED matrix displays with the MAX7219 driver (using -SPI) and WS2812 & APA102 NeoPixels (inc Pimoroni Unicorn pHat/Hat and Unicorn -Hat HD) on the Raspberry Pi and other Linux-based single board computers - it -provides a `Pillow `_-compatible drawing canvas, -and other functionality to support: +SPI), WS2812 (NeoPixels, inc Pimoroni Unicorn pHat/Hat and Unicorn Hat HD) and +APA102 (DotStar) on the Raspberry Pi and other Linux-based single board computers +- it provides a `Pillow `_-compatible drawing +canvas, and other functionality to support: * multiple cascaded devices * LED matrix, seven-segment and NeoPixel variants @@ -40,7 +43,7 @@ * state management, * dithering to monochrome, * pygame emulator, -* Python 2.7 and 3.5+ are both supported +* Python 3.6 and newer are supported Documentation ------------- @@ -67,25 +70,11 @@ .. image:: https://raw.githubusercontent.com/rm-hull/luma.led_matrix/master/doc/images/emulator.gif :alt: max7219 emulator -Breaking changes ----------------- -Version 0.3.0 was released on 19 January 2017: this came with a rename of the -github project from **max7219** to **luma.led_matrix** to reflect the changing -nature of the codebase. - -There is no direct migration path, but the old `docs `_ -and `PyPi packages `_ will remain -available indefinitely, but that deprecated codebase will no longer recieve -updates or fixes. - -The consequence is that any existing code that uses the old **max7219** package -should probably be updated. - License ------- The MIT License (MIT) -Copyright (c) 2013-2020 Richard Hull & Contributors +Copyright (c) 2013-2022 Richard Hull & Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff -Nru luma.led-matrix-1.5.0+dfsg1/setup.cfg luma.led-matrix-1.7.0/setup.cfg --- luma.led-matrix-1.5.0+dfsg1/setup.cfg 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/setup.cfg 2022-10-19 19:37:59.000000000 +0000 @@ -1,3 +1,53 @@ +[metadata] +name = luma.led_matrix +version = attr: luma.led_matrix.__version__ +description = A library to drive a MAX7219 LED serializer (using SPI) and WS2812 NeoPixels (using DMA) +long_description = file: README.rst, CONTRIBUTING.rst, CHANGES.rst +long_description_content_type = text/x-rst +keywords = raspberry pi, rpi, led, max7219, matrix, seven segment, 7 segment, neopixel, neosegment, ws2812, ws281x, apa102, unicorn-phat, unicorn-hat, unicorn-hat-hd +author = Richard Hull +author_email = richard.hull@destructuring-bind.org +url = https://github.com/rm-hull/luma.led_matrix +license = MIT +classifiers = + License :: OSI Approved :: MIT License + Development Status :: 5 - Production/Stable + Intended Audience :: Education + Intended Audience :: Developers + Topic :: Education + Topic :: System :: Hardware + Topic :: System :: Hardware :: Hardware Drivers + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + +[options] +zip_safe = False +packages = find_namespace: +python_requires = >=3.7, <4 +install_requires = + luma.core>=2.4.0 + rpi_ws281x; platform_machine=="armv7l" and platform_system=="Linux" +tests_require = + pytest + pytest-cov + pytest-timeout + +[options.packages.find] +include = luma* + +[options.extras_require] +docs = sphinx>=1.5.1 +qa = + flake8 + rstcheck +test = + pytest + pytest-cov + pytest-timeout + [bdist_wheel] universal = 1 diff -Nru luma.led-matrix-1.5.0+dfsg1/setup.py luma.led-matrix-1.7.0/setup.py --- luma.led-matrix-1.5.0+dfsg1/setup.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/setup.py 2022-10-19 19:37:59.000000000 +0000 @@ -1,100 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import re -import os -import sys -from io import open -from setuptools import setup, find_packages +import setuptools - -def read_file(fname, encoding='utf-8'): - with open(fname, encoding=encoding) as r: - return r.read() - - -def find_version(*file_paths): - fpath = os.path.join(os.path.dirname(__file__), *file_paths) - version_file = read_file(fpath) - version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", - version_file, re.M) - if version_match: - return version_match.group(1) - - err_msg = 'Unable to find version string in {}'.format(fpath) - raise RuntimeError(err_msg) - - -README = read_file('README.rst') -CONTRIB = read_file('CONTRIBUTING.rst') -CHANGES = read_file('CHANGES.rst') -version = find_version('luma', 'led_matrix', '__init__.py') -project_url = 'https://github.com/rm-hull/luma.led_matrix' - -needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) -pytest_runner = ['pytest-runner'] if needs_pytest else [] -test_deps = [ - 'mock;python_version<"3.3"', - 'pytest<=4.5', - 'pytest-cov' -] - -setup( - name="luma.led_matrix", - version=version, - author="Richard Hull", - author_email="richard.hull@destructuring-bind.org", - description="A library to drive a MAX7219 LED serializer (using SPI) and WS2812 NeoPixels (using DMA)", - long_description="\n\n".join([README, CONTRIB, CHANGES]), - long_description_content_type="text/x-rst", - license="MIT", - keywords=[ - "raspberry pi", "rpi", "led", "max7219", "matrix", "seven segment", "7 segment", - "neopixel", "neosegment", "ws2812", "ws281x", "apa102", "unicorn-phat", - "unicorn-hat", "unicorn-hat-hd" - ], - url=project_url, - download_url=project_url + '/tarball/' + version, - project_urls={ - 'Documentation': 'https://luma-led-matrix.readthedocs.io', - 'Source': project_url, - 'Issue Tracker': project_url + '/issues', - }, - packages=find_packages(), - namespace_packages=["luma"], - install_requires=["luma.core>=1.14.0"], - setup_requires=pytest_runner, - tests_require=test_deps, - extras_require={ - ':platform_machine=="armv7l" and platform_system=="Linux"': [ - 'ws2812', 'rpi_ws281x' - ], - 'docs': [ - 'sphinx >= 1.5.1' - ], - 'qa': [ - 'rstcheck', - 'flake8' - ], - 'test': test_deps - }, - zip_safe=False, - python_requires='>=3.5, <4', - classifiers=[ - "License :: OSI Approved :: MIT License", - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Education", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Topic :: Education", - "Topic :: System :: Hardware", - "Topic :: System :: Hardware :: Hardware Drivers", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Operating System :: POSIX", - "Operating System :: Unix" - ] -) +if __name__ == "__main__": + setuptools.setup() diff -Nru luma.led-matrix-1.5.0+dfsg1/tests/baseline_data.py luma.led-matrix-1.7.0/tests/baseline_data.py --- luma.led-matrix-1.5.0+dfsg1/tests/baseline_data.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/tests/baseline_data.py 2022-10-19 19:37:59.000000000 +0000 @@ -1,19 +1,24 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (c) 2014-19 Richard Hull and contributors +# Copyright (c) 2014-2020 Richard Hull and contributors # See LICENSE.rst for details. """ Collection of datasets to prevent regression bugs from creeping in. """ -import io import json -import os.path +from pathlib import Path def get_json_data(fname): - dirname = os.path.abspath(os.path.dirname(__file__)) - fpath = os.path.join(dirname, 'reference', 'data', fname + '.json') - with io.open(fpath) as f: + """ + Load JSON reference data. + + :param fname: Filename without extension. + :type fname: str + """ + base_dir = Path(__file__).resolve().parent + fpath = base_dir.joinpath('reference', 'data', fname + '.json') + with fpath.open() as f: return json.load(f) diff -Nru luma.led-matrix-1.5.0+dfsg1/tests/helpers.py luma.led-matrix-1.7.0/tests/helpers.py --- luma.led-matrix-1.5.0+dfsg1/tests/helpers.py 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/tests/helpers.py 2022-10-19 19:37:59.000000000 +0000 @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2017-18 Richard Hull and contributors +# Copyright (c) 2017-2020 Richard Hull and contributors # See LICENSE.rst for details. -import os.path - +from pathlib import Path from unittest.mock import Mock + import pytest from PIL import ImageChops @@ -28,18 +28,26 @@ """ with pytest.raises(luma.core.error.DeviceDisplayModeError) as ex: deviceType(serial_interface, width=width, height=height) - assert "Unsupported display mode: {} x {}".format(width, height) in str(ex.value) + assert f"Unsupported display mode: {width} x {height}" in str(ex.value) def get_reference_file(fname): - return os.path.abspath(os.path.join( - os.path.dirname(__file__), - 'reference', - fname)) + """ + Get absolute path for ``fname``. + + :param fname: Filename. + :type fname: str or pathlib.Path + :rtype: str + """ + return str(Path(__file__).resolve().parent.joinpath('reference', fname)) def get_reference_image(fname): - return get_reference_file(os.path.join('images', fname)) + """ + :param fname: Filename. + :type fname: str or pathlib.Path + """ + return get_reference_file(Path('images').joinpath(fname)) def assert_identical_image(reference, target): diff -Nru luma.led-matrix-1.5.0+dfsg1/tox.ini luma.led-matrix-1.7.0/tox.ini --- luma.led-matrix-1.5.0+dfsg1/tox.ini 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/tox.ini 2022-10-19 19:37:59.000000000 +0000 @@ -1,16 +1,17 @@ -# Copyright (c) 2017-2020 Richard Hull and contributors +# Copyright (c) 2017-2022 Richard Hull and contributors # See LICENSE.rst for details. [tox] -envlist = py{27,35,36,37,38},qa,doc +envlist = py{37,38,39,310,311},qa,doc skip_missing_interpreters = True [testenv] +usedevelop = true +setenv = + PYTHONDEVMODE=1 commands = coverage erase - python setup.py install - coverage run -m py.test -v -r wsx - coverage report + pytest --cov=luma coverage html deps = .[test] diff -Nru luma.led-matrix-1.5.0+dfsg1/.travis.yml luma.led-matrix-1.7.0/.travis.yml --- luma.led-matrix-1.5.0+dfsg1/.travis.yml 2020-07-04 21:23:29.000000000 +0000 +++ luma.led-matrix-1.7.0/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -dist: bionic -language: python -cache: pip - -matrix: - include: - - python: 3.5 - env: TOXENV=py35 - - python: 3.6 - env: TOXENV=py36 - - python: 3.7 - env: TOXENV=py37 - - python: 3.8 - env: TOXENV=py38 - - python: 3.5 - env: TOXENV=qa,doc - -addons: - apt: - packages: - - graphviz - -install: - - pip install --upgrade --ignore-installed setuptools pip tox coveralls -script: tox -vv -after_success: if [ "$TOXENV" == "py36" ]; then coveralls; fi