From 0e8fc0d8ed75dd459e50c7eb7be6eab5af502d23 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jan 2020 10:43:57 -0800 Subject: [PATCH 1/5] Remove board import. It isn't used. --- adafruit_ble/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/adafruit_ble/__init__.py b/adafruit_ble/__init__.py index f3facc7..2b7d761 100755 --- a/adafruit_ble/__init__.py +++ b/adafruit_ble/__init__.py @@ -33,7 +33,6 @@ "This release is not compatible with CircuitPython 4.x; use library release 1.x.x") #pylint: enable=wrong-import-position -import board import _bleio from .services import Service From 656e50348a45e2e5a77257e2d14603998a9abe1a Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jan 2020 10:45:17 -0800 Subject: [PATCH 2/5] Ignore python build output. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 2e24c88..7702655 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ _build .env bundles .DS_Store +.eggs +*.egg-info +build +dist From 4fb04ed48d817cd33154979c6b198694175ebcd0 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jan 2020 10:54:56 -0800 Subject: [PATCH 3/5] Use find_packages to find subpackages. --- setup.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/setup.py b/setup.py index cf7fc1a..730c78f 100644 --- a/setup.py +++ b/setup.py @@ -55,9 +55,5 @@ # What does your project relate to? keywords='adafruit blinka circuitpython micropython ble bluetooth', - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - # TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER, - # CHANGE `py_modules=['...']` TO `packages=['...']` - packages=['adafruit_ble'], + packages=find_packages(include=["adafruit_ble.*"]), ) From d6993c476a4f38f20d4a734af5d993cd24c774a8 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jan 2020 12:29:36 -0800 Subject: [PATCH 4/5] Remove use of mocks for sphinx. Blinka should be enough. --- docs/conf.py | 1 - docs/mocks/_bleio.py | 20 -------------------- docs/mocks/microcontroller.py | 1 - docs/mocks/micropython.py | 2 -- 4 files changed, 24 deletions(-) delete mode 100644 docs/mocks/_bleio.py delete mode 100644 docs/mocks/microcontroller.py delete mode 100644 docs/mocks/micropython.py diff --git a/docs/conf.py b/docs/conf.py index 5f4535c..2574b7e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,7 +3,6 @@ import os import sys sys.path.insert(0, os.path.abspath('..')) -sys.path.insert(0, os.path.abspath('mocks')) # -- General configuration ------------------------------------------------ diff --git a/docs/mocks/_bleio.py b/docs/mocks/_bleio.py deleted file mode 100644 index 60887a8..0000000 --- a/docs/mocks/_bleio.py +++ /dev/null @@ -1,20 +0,0 @@ -class Attribute: - NO_ACCESS = 0 - OPEN = 0 - ENCRYPT_NO_MITM = 0 - ENCRYPT_WITH_MITM = 0 - LESC_ENCRYPT_WITH_MITM = 0 - SIGNED_NO_MITM = 0 - SIGNED_WITH_MITM = 0 - -class UUID: - def __init__(self, uuid): - pass - -class Characteristic: - BROADCAST = 0 - READ = 0 - WRITE = 0 - NOTIFY = 0 - INDICATE = 0 - WRITE_NO_RESPONSE = 0 diff --git a/docs/mocks/microcontroller.py b/docs/mocks/microcontroller.py deleted file mode 100644 index 8b13789..0000000 --- a/docs/mocks/microcontroller.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/mocks/micropython.py b/docs/mocks/micropython.py deleted file mode 100644 index b5af9b3..0000000 --- a/docs/mocks/micropython.py +++ /dev/null @@ -1,2 +0,0 @@ -def const(x): - return x From d99232ad0d855927c7ecead0e77cbc99fbf41fd2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 21 Jan 2020 14:35:05 -0800 Subject: [PATCH 5/5] Mock microcontroller so we don't use Blinka's board detect. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 2574b7e..8485cc8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,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"] +autodoc_mock_imports = ["board", "microcontroller"] autodoc_member_order = "bysource" add_module_names = False