From: Melissa LeBlanc-Williams Date: Tue, 21 Sep 2021 17:41:22 +0000 (-0700) Subject: Merge pull request #511 from lesamouraipourpre/examples X-Git-Tag: 6.13.1~1 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/a734c8e5126f5e9eb1a1d56194fb5aabde700672?hp=f2e61b007285b6e438bdfef1e37ac2b4e843701d Merge pull request #511 from lesamouraipourpre/examples Document the examples --- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ce2635b..220e398 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,8 +29,5 @@ jobs: TWINE_USERNAME: ${{ secrets.pypi_username }} TWINE_PASSWORD: ${{ secrets.pypi_password }} run: | - for file in $(find -not -path "./.*" -not -path "./docs*" -name "*.py"); do - sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file; - done; python setup.py sdist twine upload dist/* diff --git a/README.rst b/README.rst index d802c16..8f3aa29 100755 --- a/README.rst +++ b/README.rst @@ -25,11 +25,13 @@ for devices or hosts running CPython or MicroPython. Working code exists to emul * **board** - breakout-specific pin identities * **busio** - hardware-driven interfaces for I2C, SPI, UART * **digitalio** - digital input/output pins, using pin identities from board+microcontroller packages +* **keypad** - support for scanning keys and key matrices * **microcontroller** - chip-specific pin identities * **micropython** - MicroPython-specific module * **neopixel_write** - low-level interface to NeoPixels * **pulseio** - contains classes that provide access to basic pulse IO (PWM) * **pwmio** - contains classes that provide access to basic pulse IO (PWM) +* **rainbowio** - provides the colorwheel() function For details, see the `Blinka API reference `_. diff --git a/docs/api.rst b/docs/api.rst index 61e9bbe..dc0aeb6 100755 --- a/docs/api.rst +++ b/docs/api.rst @@ -13,6 +13,9 @@ .. automodule:: adafruit_blinka.microcontroller :members: +.. automodule:: analogio + :members: + .. automodule:: bitbangio :members: @@ -25,13 +28,23 @@ .. automodule:: digitalio :members: -.. automodule:: analogio +.. automodule:: keypad :members: -.. automodule:: pulseio +.. automodule:: microcontroller + :members: + +.. automodule:: micropython :members: .. automodule:: neopixel_write :members: +.. automodule:: pulseio + :members: + +.. automodule:: pwmio + :members: +.. automodule:: rainbowio + :members: diff --git a/setup.py b/setup.py index a18904c..576afbd 100755 --- a/setup.py +++ b/setup.py @@ -34,11 +34,7 @@ if os.path.exists("/proc/device-tree/compatible"): setup( name="Adafruit-Blinka", - use_scm_version={ - # This is needed for the PyPI version munging in the Github Actions release.yml - "git_describe_command": "git describe --tags --long", - "local_scheme": "no-local-version", - }, + use_scm_version=True, setup_requires=["setuptools_scm"], description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.", long_description=long_description, @@ -57,11 +53,10 @@ setup( "board", "busio", "digitalio", - "keypad", "micropython", - "neopixel_write", "pulseio", "pwmio", + "neopixel_write", "rainbowio", ], package_data={ diff --git a/src/analogio.py b/src/analogio.py index 6d5821a..0016505 100644 --- a/src/analogio.py +++ b/src/analogio.py @@ -7,11 +7,6 @@ Not supported by all boards. * Author(s): Carter Nelson, Melissa LeBlanc-Williams """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import sys from adafruit_blinka.agnostic import detector diff --git a/src/bitbangio.py b/src/bitbangio.py index e63168f..d13b743 100755 --- a/src/bitbangio.py +++ b/src/bitbangio.py @@ -7,11 +7,6 @@ See `CircuitPython:bitbangio` in CircuitPython for more details. * Author(s): cefn """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import adafruit_platformdetect.constants.boards as ap_board from adafruit_blinka import Lockable, agnostic diff --git a/src/board.py b/src/board.py index 0de6c10..af73c13 100755 --- a/src/board.py +++ b/src/board.py @@ -27,13 +27,6 @@ See `CircuitPython:board` in CircuitPython for more details. * Author(s): cefn """ - - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" -__blinka__ = True - - import sys import adafruit_platformdetect.constants.boards as ap_board diff --git a/src/busio.py b/src/busio.py index ea41516..46d0f9b 100755 --- a/src/busio.py +++ b/src/busio.py @@ -7,11 +7,6 @@ See `CircuitPython:busio` in CircuitPython for more details. * Author(s): cefn """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - try: import threading except ImportError: diff --git a/src/digitalio.py b/src/digitalio.py index 2df6081..ad05cb3 100755 --- a/src/digitalio.py +++ b/src/digitalio.py @@ -7,11 +7,6 @@ See `CircuitPython:digitalio` in CircuitPython for more details. * Author(s): cefn """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - from adafruit_blinka.agnostic import board_id, detector # pylint: disable=ungrouped-imports,wrong-import-position diff --git a/src/keypad.py b/src/keypad.py index 0dd05e9..a156d6e 100644 --- a/src/keypad.py +++ b/src/keypad.py @@ -6,11 +6,6 @@ See `CircuitPython:keypad` in CircuitPython for more details. * Author(s): Melissa LeBlanc-Williams """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import time import threading from collections import deque @@ -467,7 +462,7 @@ class ShiftRegisterKeys(_KeysBase): @property def events(self): - """The `EventQueue` associated with this `Keys` object. (read-only)""" + """The ``EventQueue`` associated with this `Keys` object. (read-only)""" return self._events def _keypad_shiftregisterkeys_scan(self): diff --git a/src/microcontroller/__init__.py b/src/microcontroller/__init__.py index 9e05c81..fda16cc 100755 --- a/src/microcontroller/__init__.py +++ b/src/microcontroller/__init__.py @@ -1,4 +1,9 @@ -"""Microcontroller pins""" +""" +`microcontroller` - Pin references and cpu functionality +======================================================== + +* Author(s): Melissa LeBlanc-Williams +""" import sys import time @@ -14,7 +19,12 @@ def delay_us(delay): class Pin(Enum): - """Reference Pin object""" + """ + Identifies an IO pin on the microcontroller. + + They are fixed by the hardware so they cannot be constructed on demand. Instead, use board or + microcontroller.pin to reference the desired pin. + """ def __init__(self, pin_id): """Identifier for pin, referencing platform-specific pin id""" diff --git a/src/micropython.py b/src/micropython.py index 62698c8..843d5a5 100755 --- a/src/micropython.py +++ b/src/micropython.py @@ -1,15 +1,11 @@ """ `micropython` - MicroPython Specific Decorator Functions -================================================= +======================================================== * Author(s): cefn """ -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - def const(x): "Emulate making a constant" return x diff --git a/src/neopixel_write.py b/src/neopixel_write.py index 953a365..2097c84 100644 --- a/src/neopixel_write.py +++ b/src/neopixel_write.py @@ -8,11 +8,6 @@ Currently supported on Raspberry Pi only. * Author(s): ladyada """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import sys from adafruit_blinka.agnostic import detector diff --git a/src/pulseio.py b/src/pulseio.py index c12d189..dc20e3d 100644 --- a/src/pulseio.py +++ b/src/pulseio.py @@ -7,11 +7,6 @@ Not supported by all boards. * Author(s): Melissa LeBlanc-Williams """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import sys from adafruit_blinka.agnostic import detector diff --git a/src/pwmio.py b/src/pwmio.py index 4299f54..f598058 100644 --- a/src/pwmio.py +++ b/src/pwmio.py @@ -7,11 +7,6 @@ Not supported by all boards. * Author(s): Melissa LeBlanc-Williams """ - -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - import sys from adafruit_blinka.agnostic import detector diff --git a/src/rainbowio.py b/src/rainbowio.py index b7bc06a..e852d83 100644 --- a/src/rainbowio.py +++ b/src/rainbowio.py @@ -8,10 +8,6 @@ Not supported by all boards. """ -__version__ = "0.0.0-auto.0" -__repo__ = "https://github.com/adafruit/Adafruit_Blinka.git" - - def colorwheel(color_value): """ A colorwheel. ``0`` and ``255`` are red, ``85`` is green, and ``170`` is blue, with the values