From 66948648285ce1b044e2666c4159681c48d56209 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Mon, 12 Apr 2021 09:58:25 -0700 Subject: [PATCH 01/61] Fix issue with checking if esp is connected --- adafruit_matrixportal/wifi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_matrixportal/wifi.py b/adafruit_matrixportal/wifi.py index 5312887..f298f39 100755 --- a/adafruit_matrixportal/wifi.py +++ b/adafruit_matrixportal/wifi.py @@ -77,7 +77,7 @@ def __init__(self, *, status_neopixel=None, esp=None, external_spi=None): ) requests.set_socket(socket, self.esp) - if esp.is_connected: + if self.esp.is_connected: self.requests = requests self._manager = None From 1f249440ae02eb7ed9cdb92d02dd9b870fefec02 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Thu, 22 Apr 2021 10:14:24 -0700 Subject: [PATCH 02/61] Make use of the new PortalBase WiFi modules --- adafruit_matrixportal/network.py | 10 ++- adafruit_matrixportal/wifi.py | 118 ------------------------------- docs/api.rst | 3 - 3 files changed, 9 insertions(+), 122 deletions(-) delete mode 100755 adafruit_matrixportal/wifi.py diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 8d7b953..90aee94 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -27,8 +27,9 @@ """ import gc +import neopixel from adafruit_portalbase.network import NetworkBase -from adafruit_matrixportal.wifi import WiFi +from adafruit_portalbase.wifi_coprocessor import WiFi __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" @@ -55,6 +56,13 @@ def __init__(self, **kwargs): extract_values = kwargs.pop("extract_values") if "debug" in kwargs: debug = kwargs.pop("debug") + + if "status_neopixel" in kwargs: + status_neopixel = kwargs.pop("status_neopixel") + status_led = neopixel.NeoPixel(status_neopixel, 1, brightness=0.2) + else: + status_led = None + kwargs["status_led"] = status_led wifi = WiFi(**kwargs) super().__init__( diff --git a/adafruit_matrixportal/wifi.py b/adafruit_matrixportal/wifi.py deleted file mode 100755 index f298f39..0000000 --- a/adafruit_matrixportal/wifi.py +++ /dev/null @@ -1,118 +0,0 @@ -# SPDX-FileCopyrightText: 2020 Melissa LeBlanc-Williams, written for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense -""" -`adafruit_matrixportal.wifi` -================================================================================ - -Helper library for the MatrixPortal M4 or Adafruit RGB Matrix Shield + Metro M4 Airlift Lite. - -* Author(s): Melissa LeBlanc-Williams - -Implementation Notes --------------------- - -**Hardware:** - -* `Adafruit MatrixPortal M4 `_ -* `Adafruit Metro M4 Express AirLift `_ -* `Adafruit RGB Matrix Shield `_ -* `64x32 RGB LED Matrix `_ - -**Software and Dependencies:** - -* Adafruit CircuitPython firmware for the supported boards: - https://github.com/adafruit/circuitpython/releases - -""" - -import gc -import board -import busio -from digitalio import DigitalInOut -import neopixel -from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager -import adafruit_esp32spi.adafruit_esp32spi_socket as socket -import adafruit_requests as requests - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" - - -class WiFi: - """Class representing the ESP. - - :param status_neopixel: The pin for the status NeoPixel. Use ``board.NEOPIXEL`` for the on-board - NeoPixel. Defaults to ``None``, not the status LED - :param esp: A passed ESP32 object, Can be used in cases where the ESP32 chip needs to be used - before calling the pyportal class. Defaults to ``None``. - :param busio.SPI external_spi: A previously declared spi object. Defaults to ``None``. - - """ - - def __init__(self, *, status_neopixel=None, esp=None, external_spi=None): - - if status_neopixel: - self.neopix = neopixel.NeoPixel(status_neopixel, 1, brightness=0.2) - else: - self.neopix = None - self.neo_status(0) - self.requests = None - - if esp: # If there was a passed ESP Object - self.esp = esp - if external_spi: # If SPI Object Passed - spi = external_spi - else: # Else: Make ESP32 connection - spi = busio.SPI(board.SCK, board.MOSI, board.MISO) - else: - esp32_ready = DigitalInOut(board.ESP_BUSY) - esp32_gpio0 = DigitalInOut(board.ESP_GPIO0) - esp32_reset = DigitalInOut(board.ESP_RESET) - esp32_cs = DigitalInOut(board.ESP_CS) - spi = busio.SPI(board.SCK, board.MOSI, board.MISO) - - self.esp = adafruit_esp32spi.ESP_SPIcontrol( - spi, esp32_cs, esp32_ready, esp32_reset, esp32_gpio0 - ) - - requests.set_socket(socket, self.esp) - if self.esp.is_connected: - self.requests = requests - self._manager = None - - gc.collect() - - def connect(self, ssid, password): - """ - Connect to WiFi using the settings found in secrets.py - """ - self.esp.connect({"ssid": ssid, "password": password}) - self.requests = requests - - def neo_status(self, value): - """The status NeoPixel. - - :param value: The color to change the NeoPixel. - - """ - if self.neopix: - self.neopix.fill(value) - - def manager(self, secrets): - """Initialize the WiFi Manager if it hasn't been cached and return it""" - if self._manager is None: - self._manager = adafruit_esp32spi_wifimanager.ESPSPI_WiFiManager( - self.esp, secrets, None - ) - return self._manager - - @property - def is_connected(self): - """Return whether we are connected.""" - return self.esp.is_connected - - @property - def enabled(self): - """Not currently disablable on the ESP32 Coprocessor""" - return True diff --git a/docs/api.rst b/docs/api.rst index 97f7fa8..9e5eecc 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -11,6 +11,3 @@ .. automodule:: adafruit_matrixportal.network :members: - -.. automodule:: adafruit_matrixportal.wifi - :members: From 257520cd9067ecab9c47098862ceebdb5570a900 Mon Sep 17 00:00:00 2001 From: Flavio Fernandes Date: Mon, 10 May 2021 05:42:55 -0400 Subject: [PATCH 03/61] Fix use of status_neopixel in network init Fixes adafruit/Adafruit_CircuitPython_MatrixPortal#77 --- adafruit_matrixportal/network.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 90aee94..88fd367 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -57,8 +57,8 @@ def __init__(self, **kwargs): if "debug" in kwargs: debug = kwargs.pop("debug") - if "status_neopixel" in kwargs: - status_neopixel = kwargs.pop("status_neopixel") + status_neopixel = kwargs.pop("status_neopixel", None) + if status_neopixel: status_led = neopixel.NeoPixel(status_neopixel, 1, brightness=0.2) else: status_led = None From c7f4290263e52551033264c78668e379d0a00c20 Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 19 May 2021 13:32:42 -0400 Subject: [PATCH 04/61] Added pull request template Signed-off-by: dherrada --- .../adafruit_circuitpython_pr.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md diff --git a/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md new file mode 100644 index 0000000..71ef8f8 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: 2021 Adafruit Industries +# +# SPDX-License-Identifier: MIT + +Thank you for contributing! Before you submit a pull request, please read the following. + +Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html + +If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs + +Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code + +Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues. From ed49b9462aeeea46af4cad1ba6e58a5789f969a7 Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 19 May 2021 13:35:18 -0400 Subject: [PATCH 05/61] Added help text and problem matcher Signed-off-by: dherrada --- .github/workflows/build.yml | 2 ++ .github/workflows/failure-help-text.yml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 .github/workflows/failure-help-text.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0434bc5..bd2441d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,3 +66,5 @@ jobs: python setup.py sdist python setup.py bdist_wheel --universal twine check dist/* + - name: Setup problem matchers + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 diff --git a/.github/workflows/failure-help-text.yml b/.github/workflows/failure-help-text.yml new file mode 100644 index 0000000..0b1194f --- /dev/null +++ b/.github/workflows/failure-help-text.yml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Failure help text + +on: + workflow_run: + workflows: ["Build CI"] + types: + - completed + +jobs: + post-help: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }} + steps: + - name: Post comment to help + uses: adafruit/circuitpython-action-library-ci-failed@v1 From 86ec1e8d883224a4995affdf85b4a3a0ec985ad1 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 24 May 2021 09:54:31 -0400 Subject: [PATCH 06/61] Moved CI to Python 3.7 Signed-off-by: dherrada --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd2441d..5ad8791 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.6 + - name: Set up Python 3.7 uses: actions/setup-python@v1 with: - python-version: 3.6 + python-version: 3.7 - name: Versions run: | python3 --version From 8f9697fc65e3393810de79f71b5b4d62401c1e91 Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 3 Jun 2021 11:00:07 -0400 Subject: [PATCH 07/61] Moved default branch to main --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9dade1a..37397a4 100644 --- a/README.rst +++ b/README.rst @@ -72,7 +72,7 @@ Contributing ============ Contributions are welcome! Please read our `Code of Conduct -`_ +`_ before contributing to help this project stay welcoming. Documentation From 5e1fddae37857971cae13452999860953ef6068d Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 23 Sep 2021 17:52:55 -0400 Subject: [PATCH 08/61] Globally disabled consider-using-f-string pylint check Signed-off-by: dherrada --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 354c761..8810708 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,5 +30,5 @@ repos: name: pylint (examples code) description: Run pylint rules on "examples/*.py" files entry: /usr/bin/env bash -c - args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)'] + args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name,consider-using-f-string $example; done)'] language: system From 00d887c12fdd9b29d4f9c0d54bb2df0dd8d3d5c1 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 25 Oct 2021 11:29:04 -0500 Subject: [PATCH 09/61] add docs link to readme --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index 37397a4..ad63e14 100644 --- a/README.rst +++ b/README.rst @@ -68,6 +68,11 @@ Usage Example # Scroll it matrixportal.scroll_text(SCROLL_DELAY) +Documentation +============= + +API documentation for this library can be found on `Read the Docs `_. + Contributing ============ From abdc664df234a5ffaf5109acdad0188fe52c63bb Mon Sep 17 00:00:00 2001 From: dherrada Date: Wed, 3 Nov 2021 14:40:16 -0400 Subject: [PATCH 10/61] PATCH Pylint and readthedocs patch test Signed-off-by: dherrada --- .github/workflows/build.yml | 4 ++-- .pre-commit-config.yaml | 26 +++++++++++++++++--------- .pylintrc | 2 +- .readthedocs.yml | 2 +- docs/requirements.txt | 5 +++++ 5 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 docs/requirements.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ad8791..f619953 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,9 +42,9 @@ jobs: # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) run: | source actions-ci/install.sh - - name: Pip install pylint, Sphinx, pre-commit + - name: Pip install Sphinx, pre-commit run: | - pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit + pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - name: Library version run: git describe --dirty --always --tags - name: Pre-commit hooks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8810708..1b9fadc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,17 +18,25 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: pylint-2.7.1 + rev: v2.11.1 hooks: - id: pylint name: pylint (library code) types: [python] - exclude: "^(docs/|examples/|setup.py$)" -- repo: local - hooks: - - id: pylint_examples - name: pylint (examples code) + args: + - --disable=consider-using-f-string + exclude: "^(docs/|examples/|tests/|setup.py$)" + - id: pylint + name: pylint (example code) description: Run pylint rules on "examples/*.py" files - entry: /usr/bin/env bash -c - args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name,consider-using-f-string $example; done)'] - language: system + types: [python] + files: "^examples/" + args: + - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code + - id: pylint + name: pylint (test code) + description: Run pylint rules on "tests/*.py" files + types: [python] + files: "^tests/" + args: + - --disable=missing-docstring,consider-using-f-string,duplicate-code diff --git a/.pylintrc b/.pylintrc index 9e69bd0..37fda44 100644 --- a/.pylintrc +++ b/.pylintrc @@ -252,7 +252,7 @@ ignore-docstrings=yes ignore-imports=yes # Minimum lines number of a similarity. -min-similarity-lines=12 +min-similarity-lines=4 [BASIC] diff --git a/.readthedocs.yml b/.readthedocs.yml index a1e2575..338427a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,4 +4,4 @@ python: version: 3 -requirements_file: requirements.txt +requirements_file: docs/requirements.txt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..88e6733 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +sphinx>=4.0.0 From db9ab9eb7a51c759a5ce22019b9d991f6d8d363e Mon Sep 17 00:00:00 2001 From: dherrada Date: Fri, 5 Nov 2021 14:49:30 -0400 Subject: [PATCH 11/61] Disabled unspecified-encoding pylint check Signed-off-by: dherrada --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 37fda44..bd3976d 100644 --- a/.pylintrc +++ b/.pylintrc @@ -55,7 +55,7 @@ confidence= # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" # disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation +disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,unspecified-encoding # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option From 6b677abb6d036b92f3dc42d4180937c1c4fdebeb Mon Sep 17 00:00:00 2001 From: dherrada Date: Tue, 9 Nov 2021 15:30:55 -0500 Subject: [PATCH 12/61] Updated readthedocs file --- .readthedocs.yaml | 15 +++++++++++++++ .readthedocs.yml | 7 ------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .readthedocs.yaml delete mode 100644 .readthedocs.yml diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..95ec218 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,15 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense + +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +python: + version: "3.6" + install: + - requirements: docs/requirements.txt + - requirements: requirements.txt diff --git a/.readthedocs.yml b/.readthedocs.yml deleted file mode 100644 index 338427a..0000000 --- a/.readthedocs.yml +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: Unlicense - -python: - version: 3 -requirements_file: docs/requirements.txt From 315fa7171a5df2bb9695965baa8859958390f577 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 23 Nov 2021 13:14:51 -0600 Subject: [PATCH 13/61] update rtd py version --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 95ec218..1335112 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 python: - version: "3.6" + version: "3.7" install: - requirements: docs/requirements.txt - requirements: requirements.txt From 267f01975326435859a78eba9054598ae7131ffa Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 1 Dec 2021 12:32:34 -0500 Subject: [PATCH 14/61] add empty __init__.py to make proper package --- adafruit_matrixportal/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 adafruit_matrixportal/__init__.py diff --git a/adafruit_matrixportal/__init__.py b/adafruit_matrixportal/__init__.py new file mode 100644 index 0000000..e69de29 From d13dd952dbfa7d5a4f02889c6c1e33d931b4f44a Mon Sep 17 00:00:00 2001 From: dherrada Date: Thu, 13 Jan 2022 16:27:30 -0500 Subject: [PATCH 15/61] First part of patch Signed-off-by: dherrada --- .../PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md | 2 +- .github/workflows/build.yml | 6 +++--- .github/workflows/release.yml | 8 ++++---- .readthedocs.yaml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md b/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md index 71ef8f8..8de294e 100644 --- a/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +++ b/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md @@ -4,7 +4,7 @@ Thank you for contributing! Before you submit a pull request, please read the following. -Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html +Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f619953..71b3827 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,10 +22,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - name: Set up Python 3.x + uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: "3.x" - name: Versions run: | python3 --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d0015a..a65e5de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,10 +24,10 @@ jobs: awk -F '\/' '{ print tolower($2) }' | tr '_' '-' ) - - name: Set up Python 3.6 - uses: actions/setup-python@v1 + - name: Set up Python 3.x + uses: actions/setup-python@v2 with: - python-version: 3.6 + python-version: "3.x" - name: Versions run: | python3 --version @@ -67,7 +67,7 @@ jobs: echo ::set-output name=setup-py::$( find . -wholename './setup.py' ) - name: Set up Python if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1335112..f8b2891 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,7 @@ version: 2 python: - version: "3.7" + version: "3.x" install: - requirements: docs/requirements.txt - requirements: requirements.txt From c697a8a544ef304941d7f772e7998a84f19b9162 Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 24 Jan 2022 16:46:17 -0500 Subject: [PATCH 16/61] Updated docs link, updated python docs link, updated setup.py --- README.rst | 4 ++-- docs/conf.py | 4 ++-- docs/index.rst | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index ad63e14..b6d92e2 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Introduction ============ .. image:: https://readthedocs.org/projects/adafruit-circuitpython-matrixportal/badge/?version=latest - :target: https://circuitpython.readthedocs.io/projects/matrixportal/en/latest/ + :target: https://docs.circuitpython.org/projects/matrixportal/en/latest/ :alt: Documentation Status .. image:: https://img.shields.io/discord/327254708534116352.svg @@ -71,7 +71,7 @@ Usage Example Documentation ============= -API documentation for this library can be found on `Read the Docs `_. +API documentation for this library can be found on `Read the Docs `_. Contributing ============ diff --git a/docs/conf.py b/docs/conf.py index cdafadb..d199778 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -29,8 +29,8 @@ intersphinx_mapping = { - "python": ("https://docs.python.org/3.4", None), - "CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None), + "python": ("https://docs.python.org/3", None), + "CircuitPython": ("https://docs.circuitpython.org/en/latest/", None), } # Add any paths that contain templates here, relative to this directory. diff --git a/docs/index.rst b/docs/index.rst index 8b689cc..f31be58 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -42,7 +42,7 @@ Table of Contents :caption: Other Links Download - CircuitPython Reference Documentation + CircuitPython Reference Documentation CircuitPython Support Forum Discord Chat Adafruit Learning System From 0b07eaf0006d247dd6bc656b407616768828571d Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Thu, 10 Feb 2022 10:06:20 -0500 Subject: [PATCH 17/61] Consolidate Documentation sections of README --- README.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index b6d92e2..0d35153 100644 --- a/README.rst +++ b/README.rst @@ -73,14 +73,11 @@ Documentation API documentation for this library can be found on `Read the Docs `_. +For information on building library documentation, please check out `this guide `_. + Contributing ============ Contributions are welcome! Please read our `Code of Conduct `_ before contributing to help this project stay welcoming. - -Documentation -============= - -For information on building library documentation, please check out `this guide `_. From 87ce4bd9515ee9f1afca3078a2b5fe3932ab9b6a Mon Sep 17 00:00:00 2001 From: dherrada Date: Mon, 14 Feb 2022 15:35:02 -0500 Subject: [PATCH 18/61] Fixed readthedocs build Signed-off-by: dherrada --- .readthedocs.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index f8b2891..33c2a61 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,8 +8,12 @@ # Required version: 2 +build: + os: ubuntu-20.04 + tools: + python: "3" + python: - version: "3.x" install: - requirements: docs/requirements.txt - requirements: requirements.txt From 949cd663fe61e55bded922844463b804ed9d3eed Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 28 Mar 2022 15:52:04 -0400 Subject: [PATCH 19/61] Update Black to latest. Signed-off-by: Kattni Rembor --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b9fadc..7467c1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: - repo: https://github.com/python/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/fsfe/reuse-tool From 18135eaabcdb11b616a2e640958465f716ab2e04 Mon Sep 17 00:00:00 2001 From: evaherrada Date: Thu, 21 Apr 2022 15:45:16 -0400 Subject: [PATCH 20/61] Updated gitignore Signed-off-by: evaherrada --- .gitignore | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 2c6ddfd..544ec4a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,47 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries # -# SPDX-License-Identifier: Unlicense +# SPDX-License-Identifier: MIT +# Do not include files and directories created by your personal work environment, such as the IDE +# you use, except for those already listed here. Pull requests including changes to this file will +# not be accepted. + +# This .gitignore file contains rules for files generated by working with CircuitPython libraries, +# including building Sphinx, testing with pip, and creating a virual environment, as well as the +# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs. + +# If you find that there are files being generated on your machine that should not be included in +# your git commit, you should create a .gitignore_global file on your computer to include the +# files created by your personal setup. To do so, follow the two steps below. + +# First, create a file called .gitignore_global somewhere convenient for you, and add rules for +# the files you want to exclude from git commits. + +# Second, configure Git to use the exclude file for all Git repositories by running the +# following via commandline, replacing "path/to/your/" with the actual path to your newly created +# .gitignore_global file: +# git config --global core.excludesfile path/to/your/.gitignore_global + +# CircuitPython-specific files *.mpy -.idea + +# Python-specific files __pycache__ -_build *.pyc + +# Sphinx build-specific files +_build + +# This file results from running `pip -e install .` in a local repository +*.egg-info + +# Virtual environment-specific files .env -.python-version -build*/ -bundles + +# MacOS-specific files *.DS_Store -.eggs -dist -**/*.egg-info + +# IDE-specific files +.idea .vscode +*~ From 0a3e0b664a242df52cfad7011dc09bcedbd1a474 Mon Sep 17 00:00:00 2001 From: evaherrada Date: Fri, 22 Apr 2022 15:58:55 -0400 Subject: [PATCH 21/61] Patch: Replaced discord badge image --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0d35153..1e88056 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Introduction :target: https://docs.circuitpython.org/projects/matrixportal/en/latest/ :alt: Documentation Status -.. image:: https://img.shields.io/discord/327254708534116352.svg +.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/badges/adafruit_discord.svg :target: https://adafru.it/discord :alt: Discord From 2ec74e88a10ec17df41b8e75fbe16af021e01581 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sun, 24 Apr 2022 14:04:43 -0500 Subject: [PATCH 22/61] change discord badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1e88056..2ae604e 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Introduction :target: https://docs.circuitpython.org/projects/matrixportal/en/latest/ :alt: Documentation Status -.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/badges/adafruit_discord.svg +.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg :target: https://adafru.it/discord :alt: Discord From 113714388207aab817493459ac9e62c9624b8b56 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Sun, 15 May 2022 12:49:57 -0400 Subject: [PATCH 23/61] Patch .pre-commit-config.yaml --- .pre-commit-config.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7467c1d..3343606 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,40 +3,40 @@ # SPDX-License-Identifier: Unlicense repos: -- repo: https://github.com/python/black + - repo: https://github.com/python/black rev: 22.3.0 hooks: - - id: black -- repo: https://github.com/fsfe/reuse-tool - rev: v0.12.1 + - id: black + - repo: https://github.com/fsfe/reuse-tool + rev: v0.14.0 hooks: - - id: reuse -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + - id: reuse + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 hooks: - - id: check-yaml - - id: end-of-file-fixer - - id: trailing-whitespace -- repo: https://github.com/pycqa/pylint + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/pycqa/pylint rev: v2.11.1 hooks: - - id: pylint + - id: pylint name: pylint (library code) types: [python] args: - --disable=consider-using-f-string exclude: "^(docs/|examples/|tests/|setup.py$)" - - id: pylint + - id: pylint name: pylint (example code) description: Run pylint rules on "examples/*.py" files types: [python] files: "^examples/" args: - - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code - - id: pylint + - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code + - id: pylint name: pylint (test code) description: Run pylint rules on "tests/*.py" files types: [python] files: "^tests/" args: - - --disable=missing-docstring,consider-using-f-string,duplicate-code + - --disable=missing-docstring,consider-using-f-string,duplicate-code From d1b51d34601d1e19bbd3cd9e031feda323da447b Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Sun, 22 May 2022 00:18:55 -0400 Subject: [PATCH 24/61] Increase min lines similarity Signed-off-by: Alec Delaney --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index bd3976d..d411a3c 100644 --- a/.pylintrc +++ b/.pylintrc @@ -252,7 +252,7 @@ ignore-docstrings=yes ignore-imports=yes # Minimum lines number of a similarity. -min-similarity-lines=4 +min-similarity-lines=12 [BASIC] From b5f7396c0cb9f79dbfb6506e2153cb6a8548096a Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Sun, 22 May 2022 00:18:23 -0400 Subject: [PATCH 25/61] Switch to inclusive terminology Signed-off-by: Alec Delaney --- .pylintrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pylintrc b/.pylintrc index d411a3c..66d688f 100644 --- a/.pylintrc +++ b/.pylintrc @@ -9,11 +9,11 @@ # run arbitrary code extension-pkg-whitelist= -# Add files or directories to the blacklist. They should be base names, not +# Add files or directories to the ignore-list. They should be base names, not # paths. ignore=CVS -# Add files or directories matching the regex patterns to the blacklist. The +# Add files or directories matching the regex patterns to the ignore-list. The # regex matches against base names, not paths. ignore-patterns= From babe2fe9221cd3763e6e24407c59c34a6f02ead6 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Mon, 30 May 2022 14:25:04 -0400 Subject: [PATCH 26/61] Set language to "en" for documentation Signed-off-by: Alec Delaney --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index d199778..cb7a373 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,7 +60,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. From fe15f7c93d849b092b112b68e9f645fe76990649 Mon Sep 17 00:00:00 2001 From: evaherrada Date: Tue, 7 Jun 2022 15:34:36 -0400 Subject: [PATCH 27/61] Added cp.org link to index.rst --- docs/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index f31be58..b48674c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -41,7 +41,8 @@ Table of Contents .. toctree:: :caption: Other Links - Download + Download from GitHub + Download Library Bundle CircuitPython Reference Documentation CircuitPython Support Forum Discord Chat From dbe47b80f0af99d776b2d0742893a39b527b0a84 Mon Sep 17 00:00:00 2001 From: evaherrada Date: Thu, 21 Jul 2022 14:19:52 -0400 Subject: [PATCH 28/61] Prepared for adding to PyPI --- setup.py | 67 +++++++++++++++++++++++++++++++++++++++++++++++ setup.py.disabled | 9 ------- 2 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 setup.py delete mode 100644 setup.py.disabled diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..36b7517 --- /dev/null +++ b/setup.py @@ -0,0 +1,67 @@ +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +"""A setuptools based setup module. + +See: +https://packaging.python.org/en/latest/distributing.html +https://github.com/pypa/sampleproject +""" + +# Always prefer setuptools over distutils +from setuptools import setup, find_packages + +# To use a consistent encoding +from codecs import open +from os import path + +here = path.abspath(path.dirname(__file__)) + +# Get the long description from the README file +with open(path.join(here, "README.rst"), encoding="utf-8") as f: + long_description = f.read() + +setup( + name="adafruit-circuitpython-matrixportal", + use_scm_version=True, + setup_requires=["setuptools_scm"], + description="CircuitPython helper for Adafruit MatrixPortal M4, Adafruit" + "RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix" + "FeatherWings", + long_description=long_description, + long_description_content_type="text/x-rst", + # The project's main homepage. + url="https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal", + # Author details + author="Adafruit Industries", + author_email="circuitpython@adafruit.com", + install_requires=[ + "Adafruit-Blinka", + "adafruit-blinka-displayio", + "adafruit-circuitpython-portalbase", + "adafruit-circuitpython-esp32spi", + "adafruit-circuitpython-bitmap-font", + "adafruit-circuitpython-display-text", + "adafruit-circuitpython-adafruitio", + "adafruit-circuitpython-neopixel", + "adafruit-circuitpython-requests", + ], + # Choose your license + license="MIT", + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Topic :: System :: Hardware", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + ], + # What does your project relate to? + keywords="adafruit matrixportal matrix rgb led feather featherwing shield" + "breakout hardware micropython circuitpython", + # You can just specify the packages manually here if your project is + # simple. Or you can use find_packages(). + packages=["adafruit_matrixportal"], +) diff --git a/setup.py.disabled b/setup.py.disabled deleted file mode 100644 index 4d6d42a..0000000 --- a/setup.py.disabled +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -""" -This library is not deployed to PyPI. It is either a board-specific helper library, or -does not make sense for use on or is incompatible with single board computers and Linux. -""" From e9a6fb4f2524c4afcf89c5b00d203b39ea7423f9 Mon Sep 17 00:00:00 2001 From: evaherrada Date: Thu, 21 Jul 2022 14:21:44 -0400 Subject: [PATCH 29/61] Added spaces --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 36b7517..1c69b91 100644 --- a/setup.py +++ b/setup.py @@ -27,8 +27,8 @@ use_scm_version=True, setup_requires=["setuptools_scm"], description="CircuitPython helper for Adafruit MatrixPortal M4, Adafruit" - "RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix" - "FeatherWings", + " RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix" + " FeatherWings", long_description=long_description, long_description_content_type="text/x-rst", # The project's main homepage. From 1b4d9677ab2347dff05588ab6fbbc666e13e6cc7 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Mon, 8 Aug 2022 22:05:55 -0400 Subject: [PATCH 30/61] Switched to pyproject.toml --- .github/workflows/build.yml | 23 +++++++----- .github/workflows/release.yml | 17 +++++---- optional_requirements.txt | 3 ++ pyproject.toml | 51 +++++++++++++++++++++++--- requirements.txt | 13 ++++--- setup.py | 67 ----------------------------------- 6 files changed, 81 insertions(+), 93 deletions(-) create mode 100644 optional_requirements.txt delete mode 100644 setup.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 71b3827..22f6582 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,24 +47,31 @@ jobs: pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - name: Library version run: git describe --dirty --always --tags + - name: Setup problem matchers + uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 - name: Pre-commit hooks run: | pre-commit run --all-files - name: Build assets run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . + - name: Archive bundles + uses: actions/upload-artifact@v2 + with: + name: bundles + path: ${{ github.workspace }}/bundles/ - name: Build docs working-directory: docs run: sphinx-build -E -W -b html . _build/html - - name: Check For setup.py + - name: Check For pyproject.toml id: need-pypi run: | - echo ::set-output name=setup-py::$( find . -wholename './setup.py' ) + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - name: Build Python package - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') run: | - pip install --upgrade setuptools wheel twine readme_renderer testresources - python setup.py sdist - python setup.py bdist_wheel --universal + pip install --upgrade build twine + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0-auto.0/1.2.3/" $file; + done; + python -m build twine check dist/* - - name: Setup problem matchers - uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a65e5de..d1b4f8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,25 +61,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - name: Check For setup.py + - name: Check For pyproject.toml id: need-pypi run: | - echo ::set-output name=setup-py::$( find . -wholename './setup.py' ) + echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - name: Set up Python - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') uses: actions/setup-python@v2 with: python-version: '3.x' - name: Install dependencies - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install --upgrade build twine - name: Build and publish - if: contains(steps.need-pypi.outputs.setup-py, 'setup.py') + if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') env: TWINE_USERNAME: ${{ secrets.pypi_username }} TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | - python setup.py sdist + for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do + sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file; + done; + python -m build twine upload dist/* diff --git a/optional_requirements.txt b/optional_requirements.txt new file mode 100644 index 0000000..d4e27c4 --- /dev/null +++ b/optional_requirements.txt @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries +# +# SPDX-License-Identifier: Unlicense diff --git a/pyproject.toml b/pyproject.toml index f3c35ae..1311319 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,49 @@ -# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# SPDX-FileCopyrightText: 2022 Alec Delaney for Adafruit Industries # -# SPDX-License-Identifier: Unlicense +# SPDX-License-Identifier: MIT -[tool.black] -target-version = ['py35'] +[build-system] +requires = [ + "setuptools", + "wheel", +] + +[project] +name = "adafruit-circuitpython-matrixportal" +description = "CircuitPython helper for Adafruit MatrixPortal M4, Adafruit RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix FeatherWings" +version = "0.0.0-auto.0" +readme = "README.rst" +authors = [ + {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} +] +urls = {Homepage = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal"} +keywords = [ + "adafruit", + "matrixportal", + "matrix", + "rgb", + "led", + "feather", + "featherwing", + "shieldbreakout", + "hardware", + "micropython", + "circuitpython", +] +license = {text = "MIT"} +classifiers = [ + "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Embedded Systems", + "Topic :: System :: Hardware", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", +] +dynamic = ["dependencies", "optional-dependencies"] + +[tool.setuptools] +packages = ["adafruit_matrixportal"] + +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +optional-dependencies = {optional = {file = ["optional_requirements.txt"]}} diff --git a/requirements.txt b/requirements.txt index ff8852f..2b58ffe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,13 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# SPDX-FileCopyrightText: Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries +# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries # -# SPDX-License-Identifier: MIT +# SPDX-License-Identifier: Unlicense +Adafruit-Blinka-displayio Adafruit-Blinka -adafruit-blinka-displayio -adafruit-circuitpython-portalbase -adafruit-circuitpython-esp32spi adafruit-circuitpython-bitmap-font adafruit-circuitpython-display-text +adafruit-circuitpython-esp32spi adafruit-circuitpython-adafruitio -adafruit-circuitpython-neopixel adafruit-circuitpython-requests +adafruit-circuitpython-neopixel +adafruit-circuitpython-portalbase diff --git a/setup.py b/setup.py deleted file mode 100644 index 1c69b91..0000000 --- a/setup.py +++ /dev/null @@ -1,67 +0,0 @@ -# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -"""A setuptools based setup module. - -See: -https://packaging.python.org/en/latest/distributing.html -https://github.com/pypa/sampleproject -""" - -# Always prefer setuptools over distutils -from setuptools import setup, find_packages - -# To use a consistent encoding -from codecs import open -from os import path - -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the README file -with open(path.join(here, "README.rst"), encoding="utf-8") as f: - long_description = f.read() - -setup( - name="adafruit-circuitpython-matrixportal", - use_scm_version=True, - setup_requires=["setuptools_scm"], - description="CircuitPython helper for Adafruit MatrixPortal M4, Adafruit" - " RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix" - " FeatherWings", - long_description=long_description, - long_description_content_type="text/x-rst", - # The project's main homepage. - url="https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal", - # Author details - author="Adafruit Industries", - author_email="circuitpython@adafruit.com", - install_requires=[ - "Adafruit-Blinka", - "adafruit-blinka-displayio", - "adafruit-circuitpython-portalbase", - "adafruit-circuitpython-esp32spi", - "adafruit-circuitpython-bitmap-font", - "adafruit-circuitpython-display-text", - "adafruit-circuitpython-adafruitio", - "adafruit-circuitpython-neopixel", - "adafruit-circuitpython-requests", - ], - # Choose your license - license="MIT", - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Topic :: Software Development :: Libraries", - "Topic :: System :: Hardware", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - ], - # What does your project relate to? - keywords="adafruit matrixportal matrix rgb led feather featherwing shield" - "breakout hardware micropython circuitpython", - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - packages=["adafruit_matrixportal"], -) From fa45db195a353c18d66eba1aafa1bba07a20e863 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 9 Aug 2022 12:03:54 -0400 Subject: [PATCH 31/61] Add setuptools-scm to build system requirements Signed-off-by: Alec Delaney --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1311319..4d80895 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ requires = [ "setuptools", "wheel", + "setuptools-scm", ] [project] From e46ee06b29fc268d4248edb0b7e305e5650443f6 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 16 Aug 2022 18:09:15 -0400 Subject: [PATCH 32/61] Update version string --- adafruit_matrixportal/graphics.py | 2 +- adafruit_matrixportal/matrix.py | 2 +- adafruit_matrixportal/matrixportal.py | 2 +- adafruit_matrixportal/network.py | 2 +- pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adafruit_matrixportal/graphics.py b/adafruit_matrixportal/graphics.py index 950dfb4..92b5767 100755 --- a/adafruit_matrixportal/graphics.py +++ b/adafruit_matrixportal/graphics.py @@ -29,7 +29,7 @@ from adafruit_portalbase.graphics import GraphicsBase from adafruit_matrixportal.matrix import Matrix -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" diff --git a/adafruit_matrixportal/matrix.py b/adafruit_matrixportal/matrix.py index e285a97..c86c239 100755 --- a/adafruit_matrixportal/matrix.py +++ b/adafruit_matrixportal/matrix.py @@ -33,7 +33,7 @@ import framebufferio -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index c48ca19..8594c26 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -33,7 +33,7 @@ from adafruit_matrixportal.network import Network from adafruit_matrixportal.graphics import Graphics -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 88fd367..f22a8c3 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -31,7 +31,7 @@ from adafruit_portalbase.network import NetworkBase from adafruit_portalbase.wifi_coprocessor import WiFi -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" diff --git a/pyproject.toml b/pyproject.toml index 4d80895..9a74f8b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ requires = [ [project] name = "adafruit-circuitpython-matrixportal" description = "CircuitPython helper for Adafruit MatrixPortal M4, Adafruit RGB Matrix Shield + Metro M4 Airlift Lite, and Adafruit RGB Matrix FeatherWings" -version = "0.0.0-auto.0" +version = "0.0.0+auto.0" readme = "README.rst" authors = [ {name = "Adafruit Industries", email = "circuitpython@adafruit.com"} From 70c652ba0cec999d23d3da1202bd95cd0913cabd Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 16 Aug 2022 21:09:15 -0400 Subject: [PATCH 33/61] Fix version strings in workflow files --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22f6582..cb2f60e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -71,7 +71,7 @@ jobs: run: | pip install --upgrade build twine for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0-auto.0/1.2.3/" $file; + sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; done; python -m build twine check dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1b4f8d..f3a0325 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file; + sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; done; python -m build twine upload dist/* From 5de96cac7d4e33f8def0ff82e9cdd5b25c9a2ede Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Mon, 22 Aug 2022 21:36:33 -0400 Subject: [PATCH 34/61] Keep copyright up to date in documentation --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index cb7a373..4082efb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,6 +6,7 @@ import os import sys +import datetime sys.path.insert(0, os.path.abspath("..")) @@ -43,7 +44,8 @@ # General information about the project. project = "Adafruit MatrixPortal Library" -copyright = "2020 Melissa LeBlanc-Williams" +current_year = str(datetime.datetime.now().year) +copyright = current_year + " Melissa LeBlanc-Williams" author = "Melissa LeBlanc-Williams" # The version info for the project you're documenting, acts as replacement for From 15e1746284bc8c45196e2ef84689d2151301dbc5 Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Tue, 23 Aug 2022 17:26:22 -0400 Subject: [PATCH 35/61] Use year duration range for copyright attribution --- docs/conf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 4082efb..a80aa9d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -44,8 +44,14 @@ # General information about the project. project = "Adafruit MatrixPortal Library" +creation_year = "2020" current_year = str(datetime.datetime.now().year) -copyright = current_year + " Melissa LeBlanc-Williams" +year_duration = ( + current_year + if current_year == creation_year + else creation_year + " - " + current_year +) +copyright = year_duration + " Melissa LeBlanc-Williams" author = "Melissa LeBlanc-Williams" # The version info for the project you're documenting, acts as replacement for From bbc95470f8269ecb61d25281cd8c616c06412e59 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Fri, 4 Nov 2022 00:02:50 -0400 Subject: [PATCH 36/61] Switching to composite actions --- .github/workflows/build.yml | 67 +---------------------- .github/workflows/release.yml | 88 ------------------------------ .github/workflows/release_gh.yml | 14 +++++ .github/workflows/release_pypi.yml | 14 +++++ 4 files changed, 30 insertions(+), 153 deletions(-) delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/release_gh.yml create mode 100644 .github/workflows/release_pypi.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb2f60e..041a337 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,68 +10,5 @@ jobs: test: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install dependencies - # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.) - run: | - source actions-ci/install.sh - - name: Pip install Sphinx, pre-commit - run: | - pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit - - name: Library version - run: git describe --dirty --always --tags - - name: Setup problem matchers - uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1 - - name: Pre-commit hooks - run: | - pre-commit run --all-files - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Archive bundles - uses: actions/upload-artifact@v2 - with: - name: bundles - path: ${{ github.workspace }}/bundles/ - - name: Build docs - working-directory: docs - run: sphinx-build -E -W -b html . _build/html - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Build Python package - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - pip install --upgrade build twine - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/1.2.3/" $file; - done; - python -m build - twine check dist/* + - name: Run Build CI workflow + uses: adafruit/workflows-circuitpython-libs/build@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index f3a0325..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,88 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries -# -# SPDX-License-Identifier: MIT - -name: Release Actions - -on: - release: - types: [published] - -jobs: - upload-release-assets: - runs-on: ubuntu-latest - steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - - name: Translate Repo Name For Build Tools filename_prefix - id: repo-name - run: | - echo ::set-output name=repo-name::$( - echo ${{ github.repository }} | - awk -F '\/' '{ print tolower($2) }' | - tr '_' '-' - ) - - name: Set up Python 3.x - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Versions - run: | - python3 --version - - name: Checkout Current Repo - uses: actions/checkout@v1 - with: - submodules: true - - name: Checkout tools repo - uses: actions/checkout@v2 - with: - repository: adafruit/actions-ci-circuitpython-libs - path: actions-ci - - name: Install deps - run: | - source actions-ci/install.sh - - name: Build assets - run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location . - - name: Upload Release Assets - # the 'official' actions version does not yet support dynamically - # supplying asset names to upload. @csexton's version chosen based on - # discussion in the issue below, as its the simplest to implement and - # allows for selecting files with a pattern. - # https://github.com/actions/upload-release-asset/issues/4 - #uses: actions/upload-release-asset@v1.0.1 - uses: csexton/release-asset-action@master - with: - pattern: "bundles/*" - github-token: ${{ secrets.GITHUB_TOKEN }} - - upload-pypi: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Check For pyproject.toml - id: need-pypi - run: | - echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' ) - - name: Set up Python - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - run: | - python -m pip install --upgrade pip - pip install --upgrade build twine - - name: Build and publish - if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml') - env: - TWINE_USERNAME: ${{ secrets.pypi_username }} - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: | - for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do - sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" $file; - done; - python -m build - twine upload dist/* diff --git a/.github/workflows/release_gh.yml b/.github/workflows/release_gh.yml new file mode 100644 index 0000000..041a337 --- /dev/null +++ b/.github/workflows/release_gh.yml @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Build CI + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Run Build CI workflow + uses: adafruit/workflows-circuitpython-libs/build@main diff --git a/.github/workflows/release_pypi.yml b/.github/workflows/release_pypi.yml new file mode 100644 index 0000000..041a337 --- /dev/null +++ b/.github/workflows/release_pypi.yml @@ -0,0 +1,14 @@ +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +name: Build CI + +on: [pull_request, push] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Run Build CI workflow + uses: adafruit/workflows-circuitpython-libs/build@main From 8d28979616aa82f48a953fbbb5febd77eb7e5d06 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Fri, 4 Nov 2022 00:47:00 -0400 Subject: [PATCH 37/61] Updated pylint version to 2.13.0 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3343606..4c43710 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v2.11.1 + rev: v2.13.0 hooks: - id: pylint name: pylint (library code) From 3e3b1a112ac74338f293b479fcb0d9c0509d0493 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Fri, 4 Nov 2022 08:15:21 -0400 Subject: [PATCH 38/61] Update pylint to 2.15.5 --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4c43710..0e5fccc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v2.13.0 + rev: v2.15.5 hooks: - id: pylint name: pylint (library code) From fd75c605bce4612c808c426030661d75747e1243 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:12:46 -0400 Subject: [PATCH 39/61] Fix release CI files --- .github/workflows/release_gh.yml | 14 +++++++++----- .github/workflows/release_pypi.yml | 15 ++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release_gh.yml b/.github/workflows/release_gh.yml index 041a337..b8aa8d6 100644 --- a/.github/workflows/release_gh.yml +++ b/.github/workflows/release_gh.yml @@ -2,13 +2,17 @@ # # SPDX-License-Identifier: MIT -name: Build CI +name: GitHub Release Actions -on: [pull_request, push] +on: + release: + types: [published] jobs: - test: + upload-release-assets: runs-on: ubuntu-latest steps: - - name: Run Build CI workflow - uses: adafruit/workflows-circuitpython-libs/build@main + - name: Run GitHub Release CI workflow + uses: adafruit/workflows-circuitpython-libs/release-gh@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release_pypi.yml b/.github/workflows/release_pypi.yml index 041a337..65775b7 100644 --- a/.github/workflows/release_pypi.yml +++ b/.github/workflows/release_pypi.yml @@ -2,13 +2,18 @@ # # SPDX-License-Identifier: MIT -name: Build CI +name: PyPI Release Actions -on: [pull_request, push] +on: + release: + types: [published] jobs: - test: + upload-release-assets: runs-on: ubuntu-latest steps: - - name: Run Build CI workflow - uses: adafruit/workflows-circuitpython-libs/build@main + - name: Run PyPI Release CI workflow + uses: adafruit/workflows-circuitpython-libs/release-pypi@main + with: + pypi-username: ${{ secrets.pypi_username }} + pypi-password: ${{ secrets.pypi_password }} From 8c12b53ef120673fc8c7575064e3c229875fc1e7 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Fri, 4 Nov 2022 18:34:33 -0400 Subject: [PATCH 40/61] Update .pylintrc for v2.15.5 --- .pylintrc | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/.pylintrc b/.pylintrc index 66d688f..40208c3 100644 --- a/.pylintrc +++ b/.pylintrc @@ -26,7 +26,7 @@ jobs=1 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. -load-plugins= +load-plugins=pylint.extensions.no_self_use # Pickle collected data for later comparisons. persistent=yes @@ -54,8 +54,8 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call -disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,unspecified-encoding +# disable=import-error,raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,deprecated-str-translate-call +disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -225,12 +225,6 @@ max-line-length=100 # Maximum number of lines in a module max-module-lines=1000 -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - # Allow the body of a class to be on the same line as the declaration if body # contains single statement. single-line-class-stmt=no @@ -257,38 +251,22 @@ min-similarity-lines=12 [BASIC] -# Naming hint for argument names -argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - # Regular expression matching correct argument names argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ -# Naming hint for attribute names -attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - # Regular expression matching correct attribute names attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ # Bad variable names which should always be refused, separated by a comma bad-names=foo,bar,baz,toto,tutu,tata -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - # Regular expression matching correct class attribute names class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ -# Naming hint for class names -# class-name-hint=[A-Z_][a-zA-Z0-9]+$ -class-name-hint=[A-Z_][a-zA-Z0-9_]+$ - # Regular expression matching correct class names # class-rgx=[A-Z_][a-zA-Z0-9]+$ class-rgx=[A-Z_][a-zA-Z0-9_]+$ -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - # Regular expression matching correct constant names const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ @@ -296,9 +274,6 @@ const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ # ones are exempt. docstring-min-length=-1 -# Naming hint for function names -function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - # Regular expression matching correct function names function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ @@ -309,21 +284,12 @@ good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_ # Include a hint for the correct naming format with invalid-name include-naming-hint=no -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - # Regular expression matching correct inline iteration names inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ -# Naming hint for method names -method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - # Regular expression matching correct method names method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - # Regular expression matching correct module names module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ @@ -339,9 +305,6 @@ no-docstring-rgx=^_ # to this list to register other decorators that produce valid properties. property-classes=abc.abstractproperty -# Naming hint for variable names -variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - # Regular expression matching correct variable names variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ From bf2dd60b98d689922cfea4418ace091c01d47730 Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:16:31 -0400 Subject: [PATCH 41/61] Add .venv to .gitignore Signed-off-by: Alec Delaney <89490472+tekktrik@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 544ec4a..db3d538 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ _build # Virtual environment-specific files .env +.venv # MacOS-specific files *.DS_Store From 0add9c7c86b42edabc60f1c9276248ff54d3ae2a Mon Sep 17 00:00:00 2001 From: Alec Delaney <89490472+tekktrik@users.noreply.github.com> Date: Thu, 19 Jan 2023 23:39:55 -0500 Subject: [PATCH 42/61] Add upload url to release action Signed-off-by: Alec Delaney <89490472+tekktrik@users.noreply.github.com> --- .github/workflows/release_gh.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release_gh.yml b/.github/workflows/release_gh.yml index b8aa8d6..9acec60 100644 --- a/.github/workflows/release_gh.yml +++ b/.github/workflows/release_gh.yml @@ -16,3 +16,4 @@ jobs: uses: adafruit/workflows-circuitpython-libs/release-gh@main with: github-token: ${{ secrets.GITHUB_TOKEN }} + upload-url: ${{ github.event.release.upload_url }} From e1c6a8ef9a80cd13216e99525a018373e11da732 Mon Sep 17 00:00:00 2001 From: "N. Sanchirico" Date: Tue, 21 Feb 2023 17:03:16 -0500 Subject: [PATCH 43/61] Add text kwarg to optionally forward to PortalBase.add_text --- adafruit_matrixportal/matrixportal.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index 8594c26..045b357 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -144,6 +144,7 @@ def add_text( line_spacing=1.25, text_anchor_point=(0, 0.5), is_data=True, + text=None ): """ Add text labels with settings @@ -166,6 +167,11 @@ def add_text( :param (float, float) text_anchor_point: Values between 0 and 1 to indicate where the text position is relative to the label :param bool is_data: If True, fetch will attempt to update the label + :param str text: If this is provided, it will set the initial text of the label. + + :return: Index of the new text label. + :rtype: int + """ if scrolling: if text_position is None: @@ -185,6 +191,7 @@ def add_text( line_spacing=line_spacing, text_anchor_point=text_anchor_point, is_data=is_data, + text=text ) self._text[index]["scrolling"] = scrolling From f13e13588dca663baea448e669be4d35764463d1 Mon Sep 17 00:00:00 2001 From: "N. Sanchirico" Date: Tue, 21 Feb 2023 17:23:10 -0500 Subject: [PATCH 44/61] Reformat with black --- adafruit_matrixportal/matrixportal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index 045b357..a20ba4d 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -144,7 +144,7 @@ def add_text( line_spacing=1.25, text_anchor_point=(0, 0.5), is_data=True, - text=None + text=None, ): """ Add text labels with settings @@ -191,7 +191,7 @@ def add_text( line_spacing=line_spacing, text_anchor_point=text_anchor_point, is_data=is_data, - text=text + text=text, ) self._text[index]["scrolling"] = scrolling From 43487bcef04b1ed09b734bc9946dc992d98267a6 Mon Sep 17 00:00:00 2001 From: Tekktrik Date: Tue, 9 May 2023 20:26:25 -0400 Subject: [PATCH 45/61] Update pre-commit hooks Signed-off-by: Tekktrik --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e5fccc..70ade69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,21 +4,21 @@ repos: - repo: https://github.com/python/black - rev: 22.3.0 + rev: 23.3.0 hooks: - id: black - repo: https://github.com/fsfe/reuse-tool - rev: v0.14.0 + rev: v1.1.2 hooks: - id: reuse - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.2.0 + rev: v4.4.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/pycqa/pylint - rev: v2.15.5 + rev: v2.17.4 hooks: - id: pylint name: pylint (library code) From 83b5b5db30aad14a5379f96e031f3643f2867f7e Mon Sep 17 00:00:00 2001 From: Tekktrik Date: Wed, 10 May 2023 22:37:43 -0400 Subject: [PATCH 46/61] Run pre-commit --- adafruit_matrixportal/matrix.py | 1 - adafruit_matrixportal/matrixportal.py | 1 - 2 files changed, 2 deletions(-) diff --git a/adafruit_matrixportal/matrix.py b/adafruit_matrixportal/matrix.py index c86c239..f7da310 100755 --- a/adafruit_matrixportal/matrix.py +++ b/adafruit_matrixportal/matrix.py @@ -68,7 +68,6 @@ def __init__( tile_rows=1, rotation=0, ): - panel_height = height // tile_rows if not isinstance(color_order, str): diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index a20ba4d..a990468 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -93,7 +93,6 @@ def __init__( tile_rows=1, rotation=0, ): - graphics = Graphics( default_bg=default_bg, bit_depth=bit_depth, From fd8454888e93ade948cebe22a102e407fb5b5ea6 Mon Sep 17 00:00:00 2001 From: Tekktrik Date: Sun, 14 May 2023 13:00:32 -0400 Subject: [PATCH 47/61] Update .pylintrc, fix jQuery for docs Signed-off-by: Tekktrik --- .pylintrc | 2 +- docs/conf.py | 1 + docs/requirements.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 40208c3..f945e92 100644 --- a/.pylintrc +++ b/.pylintrc @@ -396,4 +396,4 @@ min-public-methods=1 # Exceptions that will emit a warning when being caught. Defaults to # "Exception" -overgeneral-exceptions=Exception +overgeneral-exceptions=builtins.Exception diff --git a/docs/conf.py b/docs/conf.py index a80aa9d..41f3266 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,6 +17,7 @@ # ones. extensions = [ "sphinx.ext.autodoc", + "sphinxcontrib.jquery", "sphinx.ext.intersphinx", "sphinx.ext.napoleon", "sphinx.ext.todo", diff --git a/docs/requirements.txt b/docs/requirements.txt index 88e6733..797aa04 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,3 +3,4 @@ # SPDX-License-Identifier: Unlicense sphinx>=4.0.0 +sphinxcontrib-jquery From 11e860a464c04c2a16c74285ae61d22348452086 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 6 Jun 2023 08:32:52 -0700 Subject: [PATCH 48/61] Updated for MatrixPortal S3 --- adafruit_matrixportal/matrix.py | 7 +++++-- adafruit_matrixportal/network.py | 7 ++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/adafruit_matrixportal/matrix.py b/adafruit_matrixportal/matrix.py index f7da310..ea30545 100755 --- a/adafruit_matrixportal/matrix.py +++ b/adafruit_matrixportal/matrix.py @@ -79,8 +79,11 @@ def __init__( if -1 in (red_index, green_index, blue_index): raise ValueError("color_order should contain R, G, and B") - if "Matrix Portal M4" in os.uname().machine: - # MatrixPortal M4 Board + if ( + "Adafruit Matrix Portal" in os.uname().machine + or "Adafruit MatrixPortal" in os.uname().machine + ): + # MatrixPortal Board addr_pins = [board.MTX_ADDRA, board.MTX_ADDRB, board.MTX_ADDRC] if panel_height > 16: addr_pins.append(board.MTX_ADDRD) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index f22a8c3..87740f0 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -26,10 +26,15 @@ """ +import os import gc import neopixel from adafruit_portalbase.network import NetworkBase -from adafruit_portalbase.wifi_coprocessor import WiFi + +if os.uname().sysname == "samd51": + from adafruit_portalbase.wifi_coprocessor import WiFi +else: + from adafruit_portalbase.wifi_esp32s2 import WiFi __version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal.git" From dbf35608535ac75e5c8fc56a9dc3a7989cc8ff74 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Tue, 6 Jun 2023 08:40:41 -0700 Subject: [PATCH 49/61] Add autodoc mock imports --- docs/conf.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 41f3266..0623b0f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -27,7 +27,16 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -autodoc_mock_imports = ["supervisor", "rtc", "rgbmatrix", "framebufferio", "secrets"] +autodoc_mock_imports = [ + "supervisor", + "rtc", + "rgbmatrix", + "framebufferio", + "secrets", + "wifi", + "ssl", + "socketpool", +] intersphinx_mapping = { From b8603dca8d298c15a64839df3889ef9b1558a531 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Wed, 14 Jun 2023 11:37:03 -0700 Subject: [PATCH 50/61] MatrixPortal S3 Fixes when esp or external_spi supplied --- adafruit_matrixportal/network.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/adafruit_matrixportal/network.py b/adafruit_matrixportal/network.py index 87740f0..03f4504 100755 --- a/adafruit_matrixportal/network.py +++ b/adafruit_matrixportal/network.py @@ -62,6 +62,12 @@ def __init__(self, **kwargs): if "debug" in kwargs: debug = kwargs.pop("debug") + if os.uname().sysname != "samd51": + if "external_spi" in kwargs: + kwargs.pop("external_spi") + if "esp" in kwargs: + kwargs.pop("esp") + status_neopixel = kwargs.pop("status_neopixel", None) if status_neopixel: status_led = neopixel.NeoPixel(status_neopixel, 1, brightness=0.2) From 80a566225c6cd1051e2638affc9bcf2548bb5526 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Sun, 9 Jul 2023 16:06:55 -0400 Subject: [PATCH 51/61] Fix minor errors in docs Fixes docs: Serpentine => serpentine tiles_rows => tile_rows --- adafruit_matrixportal/matrixportal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index a990468..27f8af9 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -63,10 +63,10 @@ class MatrixPortal(PortalBase): :param debug: Turn on debug print outs. Defaults to False. :param int width: The total width of the display(s) in Pixels. Defaults to 64. :param int height: The total height of the display(s) in Pixels. Defaults to 32. - :param bool Serpentine: Used when panels are arranged in a serpentine pattern rather + :param bool derpentine: Used when panels are arranged in a serpentine pattern rather than a Z-pattern. Defaults to True. - :param int tiles_rows: Used to indicate the number of rows the panels are arranged in. - Defaults to 1. + :param int tile_rows: Used to indicate the number of rows the panels are arranged in. + Defaults to 1. """ From 339d324c70a2fa19939571c01f93f4282b9d72f8 Mon Sep 17 00:00:00 2001 From: Rose Hooper Date: Mon, 10 Jul 2023 11:10:53 -0400 Subject: [PATCH 52/61] Update adafruit_matrixportal/matrixportal.py Co-authored-by: Dan Halbert --- adafruit_matrixportal/matrixportal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index 27f8af9..fac002e 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -63,7 +63,7 @@ class MatrixPortal(PortalBase): :param debug: Turn on debug print outs. Defaults to False. :param int width: The total width of the display(s) in Pixels. Defaults to 64. :param int height: The total height of the display(s) in Pixels. Defaults to 32. - :param bool derpentine: Used when panels are arranged in a serpentine pattern rather + :param bool serpentine: Used when panels are arranged in a serpentine pattern rather than a Z-pattern. Defaults to True. :param int tile_rows: Used to indicate the number of rows the panels are arranged in. Defaults to 1. From f8bd51e9cc23a72875506fdf2a980d26a365cffc Mon Sep 17 00:00:00 2001 From: foamyguy Date: Wed, 23 Aug 2023 18:02:48 -0500 Subject: [PATCH 53/61] add bitmaptools to mock modules --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 0623b0f..981b464 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -36,6 +36,7 @@ "wifi", "ssl", "socketpool", + "bitmaptools", ] From e4932fd38e407a66d76721af2f4baa3bfd2ca5b2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 18 Sep 2023 16:24:01 -0500 Subject: [PATCH 54/61] "fix rtd theme " --- docs/conf.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 981b464..33d3ba8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -117,19 +117,10 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -on_rtd = os.environ.get("READTHEDOCS", None) == "True" - -if not on_rtd: # only import and set the theme if we're building docs locally - try: - import sphinx_rtd_theme - - html_theme = "sphinx_rtd_theme" - html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] - except: - html_theme = "default" - html_theme_path = ["."] -else: - html_theme_path = ["."] +import sphinx_rtd_theme + +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From db9374ca06719297cd831f79a29d5b9fdc5c2e4c Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 16 Oct 2023 14:30:31 -0500 Subject: [PATCH 55/61] unpin sphinx and add sphinx-rtd-theme to docs reqs Signed-off-by: foamyguy --- docs/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 797aa04..979f568 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,5 +2,6 @@ # # SPDX-License-Identifier: Unlicense -sphinx>=4.0.0 +sphinx sphinxcontrib-jquery +sphinx-rtd-theme From 12010b4e5cf1663ec3d2190ffe82ee46e5b8b48a Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Thu, 30 May 2024 14:30:52 -0700 Subject: [PATCH 56/61] Add use-wifi param --- adafruit_matrixportal/matrixportal.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index fac002e..902b8e0 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -92,6 +92,7 @@ def __init__( serpentine=True, tile_rows=1, rotation=0, + use_wifi=True, ): graphics = Graphics( default_bg=default_bg, @@ -106,13 +107,16 @@ def __init__( debug=debug, ) - network = Network( - status_neopixel=status_neopixel, - esp=esp, - external_spi=external_spi, - extract_values=False, - debug=debug, - ) + if use_wifi: + network = Network( + status_neopixel=status_neopixel, + esp=esp, + external_spi=external_spi, + extract_values=False, + debug=debug, + ) + else: + network = None super().__init__( network, From 0dc12c99c70eed4ab4aac470c68482bf176a6368 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 7 Oct 2024 09:24:05 -0500 Subject: [PATCH 57/61] remove deprecated get_html_theme_path() call Signed-off-by: foamyguy --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 33d3ba8..a42551b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -120,7 +120,6 @@ import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" -html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From cfba16f908e842ebd2889cd5ffa08e85a09d8989 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Tue, 14 Jan 2025 11:32:34 -0600 Subject: [PATCH 58/61] add sphinx configuration to rtd.yaml Signed-off-by: foamyguy --- .readthedocs.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 33c2a61..88bca9f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -8,6 +8,9 @@ # Required version: 2 +sphinx: + configuration: docs/conf.py + build: os: ubuntu-20.04 tools: From 04de7d5b56e733e1b9f90b76d8a6fd221f9b44be Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 19 Jan 2025 19:54:52 +0100 Subject: [PATCH 59/61] fix Matrix parameters documentation --- adafruit_matrixportal/matrix.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/adafruit_matrixportal/matrix.py b/adafruit_matrixportal/matrix.py index ea30545..5eba983 100755 --- a/adafruit_matrixportal/matrix.py +++ b/adafruit_matrixportal/matrix.py @@ -41,18 +41,19 @@ class Matrix: """Class representing the Adafruit RGB Matrix. This is used to automatically initialize the display. - :param int width: The width of the display in Pixels. Defaults to 64. - :param int height: The height of the display in Pixels. Defaults to 32. + :param int width: The total width of the display(s) in Pixels. Defaults to 64. + :param int height: The total height of the display(s) in Pixels. Defaults to 32. :param int bit_depth: The number of bits per color channel. Defaults to 2. :param list alt_addr_pins: An alternate set of address pins to use. Defaults to None :param string color_order: A string containing the letter "R", "G", and "B" in the order you want. Defaults to "RGB" - :param int width: The total width of the display(s) in Pixels. Defaults to 64. - :param int height: The total height of the display(s) in Pixels. Defaults to 32. - :param bool Serpentine: Used when panels are arranged in a serpentine pattern rather + :param bool serpentine: Used when panels are arranged in a serpentine pattern rather than a Z-pattern. Defaults to True. :param int tiles_rows: Used to indicate the number of rows the panels are arranged in. Defaults to 1. + :param int rotation: The rotation of the display in degrees clockwise. + Must be in 90 degree increments (0, 90, 180, 270). + Defaults to 0. """ # pylint: disable=too-few-public-methods,too-many-branches,too-many-statements,too-many-locals From 70b3b2f89d1b5fe2f73a7b89ad399a29c35d5a08 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 21 Jan 2025 15:28:42 +0100 Subject: [PATCH 60/61] fix pin names for generic feather case using RX and TX instead of unreliable D names restores functionality for Feather ESP32S2 --- adafruit_matrixportal/matrix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/adafruit_matrixportal/matrix.py b/adafruit_matrixportal/matrix.py index ea30545..f9bddf7 100755 --- a/adafruit_matrixportal/matrix.py +++ b/adafruit_matrixportal/matrix.py @@ -140,8 +140,8 @@ def __init__( board.D12, ] clock_pin = board.D13 - latch_pin = board.D0 - oe_pin = board.D1 + latch_pin = board.RX + oe_pin = board.TX else: # Metro/Grand Central Style Board if alt_addr_pins is None and height <= 16: From a1a93c2e02e1e32a66382c8e23b04d1fff2dc80a Mon Sep 17 00:00:00 2001 From: Justin Myers Date: Thu, 27 Feb 2025 15:42:14 -0800 Subject: [PATCH 61/61] Remove secrets usage --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index a42551b..f8db1a2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,7 +32,6 @@ "rtc", "rgbmatrix", "framebufferio", - "secrets", "wifi", "ssl", "socketpool",