From c1ddb259ef5265406e7201d0bf1f2ad3fcbdf38c Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Thu, 2 Aug 2018 19:31:31 -0400 Subject: [PATCH 01/16] Updated travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 93f71bc..58273ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: cache: pip: true deploy: - provider: releases +- provider: releases api_key: "$GITHUB_TOKEN" file_glob: true file: "$TRAVIS_BUILD_DIR/bundles/*" @@ -23,6 +23,7 @@ deploy: install: - pip install -r requirements.txt - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme +- pip install --force-reinstall pylint==1.9.2 script: - pylint adafruit_featherwing/*.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/**/*.py) From 1343688c3229110b3f59e4df738dac1072dc90d5 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Thu, 2 Aug 2018 19:33:03 -0400 Subject: [PATCH 02/16] Fixed busdevice --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d73e889..cdcb244 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ Adafruit-Blinka -adafruit-circuitpython-bus-device +adafruit-circuitpython-busdevice adafruit-circuitpython-register adafruit-circuitpython-pca9685 adafruit-circuitpython-motor From 499ad2486bdc6114892e2e4a4895e80cc2981248 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Fri, 3 Aug 2018 19:41:12 -0400 Subject: [PATCH 03/16] Updated requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index cdcb244..3218acd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ Adafruit-Blinka adafruit-circuitpython-busdevice adafruit-circuitpython-register -adafruit-circuitpython-pca9685 adafruit-circuitpython-motor adafruit-ina219 adafruit-seesaw +adafruit-circuitpython-pca9685 From e63b9d86d7ee5438df7fc1c90b880bde1c38895a Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Sat, 4 Aug 2018 12:50:04 -0400 Subject: [PATCH 04/16] Updated requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 3218acd..7ad7eee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ Adafruit-Blinka adafruit-circuitpython-busdevice adafruit-circuitpython-register adafruit-circuitpython-motor -adafruit-ina219 +Adafruit-circuitpython-ina219 adafruit-seesaw adafruit-circuitpython-pca9685 From 0091ab66be150fb3dd122eb331a21e98ffc72862 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Sat, 4 Aug 2018 13:07:31 -0400 Subject: [PATCH 05/16] linting --- adafruit_featherwing/joy_featherwing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_featherwing/joy_featherwing.py b/adafruit_featherwing/joy_featherwing.py index c864980..7189962 100644 --- a/adafruit_featherwing/joy_featherwing.py +++ b/adafruit_featherwing/joy_featherwing.py @@ -31,9 +31,9 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" +from micropython import const import adafruit_seesaw.seesaw from adafruit_featherwing import shared -from micropython import const BUTTON_A = const(1 << 6) BUTTON_B = const(1 << 7) From 731bcb08c1a0c117f912a4cce44e2457ec2505ed Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 19:46:48 -0400 Subject: [PATCH 06/16] Add automock --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 21f407e..6c67b19 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,6 +18,7 @@ # 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 = ["board", "machine"] intersphinx_mapping = { 'python': ('https://docs.python.org/3.4', None), From 7a81c3680b39b4da3a5062959ed5b14747afe8fd Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 19:56:14 -0400 Subject: [PATCH 07/16] Testing without shared I2C module. --- adafruit_featherwing/ina219_featherwing.py | 8 +++++--- adafruit_featherwing/joy_featherwing.py | 7 +++++-- adafruit_featherwing/motor_featherwing.py | 10 ++++++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/adafruit_featherwing/ina219_featherwing.py b/adafruit_featherwing/ina219_featherwing.py index c762b79..91864ed 100644 --- a/adafruit_featherwing/ina219_featherwing.py +++ b/adafruit_featherwing/ina219_featherwing.py @@ -32,8 +32,9 @@ __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" import adafruit_ina219 -from adafruit_featherwing import shared - +# from adafruit_featherwing import shared +import board +import busio class INA219FeatherWing: """Class representing an `Adafruit INA219 FeatherWing @@ -41,7 +42,8 @@ class INA219FeatherWing: Automatically uses the feather's I2C bus.""" def __init__(self): - self._ina219 = adafruit_ina219.INA219(shared.I2C_BUS) + self._i2c = busio.I2C(board.SCL, board.SDA) + self._ina219 = adafruit_ina219.INA219(self._i2c) @property def bus_voltage(self): diff --git a/adafruit_featherwing/joy_featherwing.py b/adafruit_featherwing/joy_featherwing.py index 7189962..63c96eb 100644 --- a/adafruit_featherwing/joy_featherwing.py +++ b/adafruit_featherwing/joy_featherwing.py @@ -33,7 +33,9 @@ from micropython import const import adafruit_seesaw.seesaw -from adafruit_featherwing import shared +# from adafruit_featherwing import shared +import board +import busio BUTTON_A = const(1 << 6) BUTTON_B = const(1 << 7) @@ -47,7 +49,8 @@ class JoyFeatherWing: Automatically uses the feather's I2C bus.""" def __init__(self): - self._seesaw = adafruit_seesaw.seesaw.Seesaw(shared.I2C_BUS) + self._i2c = busio.I2C(board.SCL, board.SDA) + self._seesaw = adafruit_seesaw.seesaw.Seesaw(self._i2c) self._seesaw.pin_mode_bulk(BUTTON_A | BUTTON_B | BUTTON_Y | BUTTON_X | BUTTON_SELECT, self._seesaw.INPUT_PULLUP) diff --git a/adafruit_featherwing/motor_featherwing.py b/adafruit_featherwing/motor_featherwing.py index fe3434c..cf8f261 100644 --- a/adafruit_featherwing/motor_featherwing.py +++ b/adafruit_featherwing/motor_featherwing.py @@ -33,7 +33,12 @@ from adafruit_pca9685 import PCA9685 -from adafruit_featherwing import shared +# from adafruit_featherwing import shared + +import board +import busio + + class MotorFeatherWing: """Class representing an `Adafruit Motor FeatherWing `_. @@ -46,7 +51,8 @@ def __init__(self): self._motor4 = None self._stepper1 = None self._stepper2 = None - self._pca = PCA9685(shared.I2C_BUS, address=0x60) + self._i2c = busio.I2C(board.SCL, board.SDA) + self._pca = PCA9685(self._i2c, address=0x60) self._pca.frequency = 1600 # We can save memory usage (~300 bytes) by deduplicating the construction of the objects for From 4f7a292008d6a59e7346360e401974853119820e Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 19:58:43 -0400 Subject: [PATCH 08/16] linting --- adafruit_featherwing/ina219_featherwing.py | 4 ++-- adafruit_featherwing/joy_featherwing.py | 4 ++-- adafruit_featherwing/motor_featherwing.py | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/adafruit_featherwing/ina219_featherwing.py b/adafruit_featherwing/ina219_featherwing.py index 91864ed..b681fe4 100644 --- a/adafruit_featherwing/ina219_featherwing.py +++ b/adafruit_featherwing/ina219_featherwing.py @@ -31,10 +31,10 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" -import adafruit_ina219 -# from adafruit_featherwing import shared import board import busio +import adafruit_ina219 +# from adafruit_featherwing import shared class INA219FeatherWing: """Class representing an `Adafruit INA219 FeatherWing diff --git a/adafruit_featherwing/joy_featherwing.py b/adafruit_featherwing/joy_featherwing.py index 63c96eb..0acbfcb 100644 --- a/adafruit_featherwing/joy_featherwing.py +++ b/adafruit_featherwing/joy_featherwing.py @@ -31,11 +31,11 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" +import board +import busio from micropython import const import adafruit_seesaw.seesaw # from adafruit_featherwing import shared -import board -import busio BUTTON_A = const(1 << 6) BUTTON_B = const(1 << 7) diff --git a/adafruit_featherwing/motor_featherwing.py b/adafruit_featherwing/motor_featherwing.py index cf8f261..c533571 100644 --- a/adafruit_featherwing/motor_featherwing.py +++ b/adafruit_featherwing/motor_featherwing.py @@ -31,13 +31,11 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" -from adafruit_pca9685 import PCA9685 - -# from adafruit_featherwing import shared - import board import busio +from adafruit_pca9685 import PCA9685 +# from adafruit_featherwing import shared class MotorFeatherWing: From 7e18b3f263673fe03998b1b3b23ac93d569b7ce4 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 20:03:00 -0400 Subject: [PATCH 09/16] added to automock --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 6c67b19..df7f814 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # 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 = ["board", "machine"] +autodoc_mock_imports = ["adafruit-seesaw"] intersphinx_mapping = { 'python': ('https://docs.python.org/3.4', None), From c91ea3ba09206837ce4ec540b3510abb690c4052 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 20:07:41 -0400 Subject: [PATCH 10/16] fixed typo --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index df7f814..2fe2382 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # 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 = ["adafruit-seesaw"] +autodoc_mock_imports = ["adafruit_seesaw"] intersphinx_mapping = { 'python': ('https://docs.python.org/3.4', None), From 6bf1c0430fdefc3ec1324747fda6dc38725cd9f1 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 20:14:42 -0400 Subject: [PATCH 11/16] Testing different automock --- adafruit_featherwing/ina219_featherwing.py | 8 +++----- adafruit_featherwing/joy_featherwing.py | 7 ++----- adafruit_featherwing/motor_featherwing.py | 8 ++------ docs/conf.py | 2 +- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/adafruit_featherwing/ina219_featherwing.py b/adafruit_featherwing/ina219_featherwing.py index b681fe4..c762b79 100644 --- a/adafruit_featherwing/ina219_featherwing.py +++ b/adafruit_featherwing/ina219_featherwing.py @@ -31,10 +31,9 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" -import board -import busio import adafruit_ina219 -# from adafruit_featherwing import shared +from adafruit_featherwing import shared + class INA219FeatherWing: """Class representing an `Adafruit INA219 FeatherWing @@ -42,8 +41,7 @@ class INA219FeatherWing: Automatically uses the feather's I2C bus.""" def __init__(self): - self._i2c = busio.I2C(board.SCL, board.SDA) - self._ina219 = adafruit_ina219.INA219(self._i2c) + self._ina219 = adafruit_ina219.INA219(shared.I2C_BUS) @property def bus_voltage(self): diff --git a/adafruit_featherwing/joy_featherwing.py b/adafruit_featherwing/joy_featherwing.py index 0acbfcb..7189962 100644 --- a/adafruit_featherwing/joy_featherwing.py +++ b/adafruit_featherwing/joy_featherwing.py @@ -31,11 +31,9 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" -import board -import busio from micropython import const import adafruit_seesaw.seesaw -# from adafruit_featherwing import shared +from adafruit_featherwing import shared BUTTON_A = const(1 << 6) BUTTON_B = const(1 << 7) @@ -49,8 +47,7 @@ class JoyFeatherWing: Automatically uses the feather's I2C bus.""" def __init__(self): - self._i2c = busio.I2C(board.SCL, board.SDA) - self._seesaw = adafruit_seesaw.seesaw.Seesaw(self._i2c) + self._seesaw = adafruit_seesaw.seesaw.Seesaw(shared.I2C_BUS) self._seesaw.pin_mode_bulk(BUTTON_A | BUTTON_B | BUTTON_Y | BUTTON_X | BUTTON_SELECT, self._seesaw.INPUT_PULLUP) diff --git a/adafruit_featherwing/motor_featherwing.py b/adafruit_featherwing/motor_featherwing.py index c533571..fe3434c 100644 --- a/adafruit_featherwing/motor_featherwing.py +++ b/adafruit_featherwing/motor_featherwing.py @@ -31,12 +31,9 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_FeatherWing.git" -import board -import busio from adafruit_pca9685 import PCA9685 -# from adafruit_featherwing import shared - +from adafruit_featherwing import shared class MotorFeatherWing: """Class representing an `Adafruit Motor FeatherWing `_. @@ -49,8 +46,7 @@ def __init__(self): self._motor4 = None self._stepper1 = None self._stepper2 = None - self._i2c = busio.I2C(board.SCL, board.SDA) - self._pca = PCA9685(self._i2c, address=0x60) + self._pca = PCA9685(shared.I2C_BUS, address=0x60) self._pca.frequency = 1600 # We can save memory usage (~300 bytes) by deduplicating the construction of the objects for diff --git a/docs/conf.py b/docs/conf.py index 2fe2382..f9d6ba4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # 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 = ["adafruit_seesaw"] +autodoc_mock_imports = ["adafruit_featherwing", "shared"] intersphinx_mapping = { 'python': ('https://docs.python.org/3.4', None), From 0111fdc6072fee2dc451eb991ceeb762d1ec13e0 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 20:28:17 -0400 Subject: [PATCH 12/16] Added members to api.rst --- docs/api.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 98affa6..40d040b 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2,6 +2,10 @@ .. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_featherwing.motor_featherwing + :members: + .. automodule:: adafruit_featherwing.ina219_featherwing + :members: + .. automodule:: adafruit_featherwing.joy_featherwing :members: From e6132ce2e5487a1a19b212fbbbd93b908f31386b Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 7 Aug 2018 20:57:03 -0400 Subject: [PATCH 13/16] Add intersphinx mappings, fix typos. --- docs/conf.py | 8 +++++--- docs/index.rst | 2 +- requirements.txt | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f9d6ba4..5b0f305 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -25,7 +25,9 @@ 'BusDevice': ('https://circuitpython.readthedocs.io/projects/bus_device/en/latest/', None), 'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None), 'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None), - 'motor': ('https://circuitpython.readthedocs.io/projects/motor/en/latest/', None)} + 'motor': ('https://circuitpython.readthedocs.io/projects/motor/en/latest/', None), + 'seesae': ('https://circuitpython.readthedocs.io/projects/seesaw/en/latest/', None), + 'INA219': ('https://circuitpython.readthedocs.io/projects/ina219/en/latest/', None)} # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -36,9 +38,9 @@ master_doc = 'index' # General information about the project. -project = u'Adafruit featherwing Library' +project = u'Adafruit Featherwing Library' copyright = u'2017 Scott Shawcroft' -author = u'Scott Shawcroft' +author = u'Scott Shawcroft, Kattni Rembor' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/docs/index.rst b/docs/index.rst index 1750daf..9f8a996 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -26,7 +26,7 @@ Table of Contents .. toctree:: :caption: Related Products - Adafruit Feather Wings + Adafruit FeatherWings .. toctree:: :caption: Other Links diff --git a/requirements.txt b/requirements.txt index 7ad7eee..7c4952d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ Adafruit-Blinka adafruit-circuitpython-busdevice adafruit-circuitpython-register adafruit-circuitpython-motor -Adafruit-circuitpython-ina219 +adafruit-circuitpython-ina219 adafruit-seesaw adafruit-circuitpython-pca9685 From cf7f33efb61a31bb62469e20efdd454663457d97 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 8 Aug 2018 11:24:01 -0400 Subject: [PATCH 14/16] Removed shared from automock --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 5b0f305..250ee44 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # 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 = ["adafruit_featherwing", "shared"] +autodoc_mock_imports = ["adafruit_featherwing"] intersphinx_mapping = { 'python': ('https://docs.python.org/3.4', None), From f16255e153a24e4daa6fb380c400151566388c2f Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Wed, 8 Aug 2018 11:37:05 -0400 Subject: [PATCH 15/16] fixed typo --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 250ee44..8b5f02a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,7 +26,7 @@ 'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None), 'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None), 'motor': ('https://circuitpython.readthedocs.io/projects/motor/en/latest/', None), - 'seesae': ('https://circuitpython.readthedocs.io/projects/seesaw/en/latest/', None), + 'seesaw': ('https://circuitpython.readthedocs.io/projects/seesaw/en/latest/', None), 'INA219': ('https://circuitpython.readthedocs.io/projects/ina219/en/latest/', None)} # Add any paths that contain templates here, relative to this directory. From e0b5b77dc10e010a5004ccd1089852bb866de973 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Thu, 9 Aug 2018 13:04:49 -0400 Subject: [PATCH 16/16] Testing api.rst with title --- docs/api.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index 40d040b..0a79f28 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,3 +1,5 @@ +FeatherWing Modules +------------------- .. If you created a package, create one automodule per module in the package.