From: James Carr Date: Mon, 20 Sep 2021 22:00:25 +0000 (+0100) Subject: Add versioning to the top-level Python files X-Git-Tag: 6.13.1~4^2~1 X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/commitdiff_plain/21aaad6dfe5d9b38d7b536486c821365a0d8e76c Add versioning to the top-level Python files --- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 220e398..ce2635b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,5 +29,8 @@ 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/setup.py b/setup.py index 576afbd..72a2a41 100755 --- a/setup.py +++ b/setup.py @@ -33,8 +33,13 @@ if os.path.exists("/proc/device-tree/compatible"): board_reqs = ["RPi.GPIO", "rpi_ws281x>=4.0.0", "sysv_ipc>=1.1.0"] setup( - name="Adafruit-Blinka", - use_scm_version=True, + # name="Adafruit-Blinka", + name="samourai-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", + }, setup_requires=["setuptools_scm"], description="CircuitPython APIs for non-CircuitPython versions of Python such as CPython on Linux and MicroPython.", long_description=long_description, @@ -53,10 +58,11 @@ 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 0016505..6d5821a 100644 --- a/src/analogio.py +++ b/src/analogio.py @@ -7,6 +7,11 @@ 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 d13b743..e63168f 100755 --- a/src/bitbangio.py +++ b/src/bitbangio.py @@ -7,6 +7,11 @@ 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 af73c13..e4c5184 100755 --- a/src/board.py +++ b/src/board.py @@ -27,6 +27,12 @@ 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" + + import sys import adafruit_platformdetect.constants.boards as ap_board diff --git a/src/busio.py b/src/busio.py index 46d0f9b..ea41516 100755 --- a/src/busio.py +++ b/src/busio.py @@ -7,6 +7,11 @@ 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 ad05cb3..2df6081 100755 --- a/src/digitalio.py +++ b/src/digitalio.py @@ -7,6 +7,11 @@ 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 97c58e7..0dd05e9 100644 --- a/src/keypad.py +++ b/src/keypad.py @@ -6,6 +6,11 @@ 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 diff --git a/src/micropython.py b/src/micropython.py index 5f369e3..62698c8 100755 --- a/src/micropython.py +++ b/src/micropython.py @@ -6,6 +6,10 @@ """ +__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 2097c84..953a365 100644 --- a/src/neopixel_write.py +++ b/src/neopixel_write.py @@ -8,6 +8,11 @@ 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 dc20e3d..c12d189 100644 --- a/src/pulseio.py +++ b/src/pulseio.py @@ -7,6 +7,11 @@ 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 f598058..4299f54 100644 --- a/src/pwmio.py +++ b/src/pwmio.py @@ -7,6 +7,11 @@ 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 e852d83..b7bc06a 100644 --- a/src/rainbowio.py +++ b/src/rainbowio.py @@ -8,6 +8,10 @@ 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