Skip to content

Using python 3.7 so sphinx is ok with __future__ #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 10, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,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
Expand Down
15 changes: 10 additions & 5 deletions adafruit_ble_broadcastnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"""

import struct
import os
import time
from micropython import const
import adafruit_ble
Expand All @@ -56,12 +57,16 @@ def broadcast(measurement, *, broadcast_time=0.1, extended=False):
_sequence_number = (_sequence_number + 1) % 256


device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name
*reversed(
list(_ble._adapter.address.address_bytes) # pylint: disable=protected-access
# This line causes issues with Sphinx, so we won't run it in the CI
if "GITHUB_ACTION" not in os.environ and "READTHEDOCS" not in os.environ:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I steered you a little wrong here. There is no os.environ in CircuitPython, only in regular CPython, so this will throw an exception. So I'd add hasattr(os, "environ") to the beginning of the if`. Also, could you test importing this library on CircuitPython

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. I'll test that as soon as I make that change

device_address = "{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}".format( # pylint: disable=invalid-name
*reversed(
list(
_ble._adapter.address.address_bytes # pylint: disable=protected-access
)
)
)
)
"""Device address as a string."""
"""Device address as a string."""

_MANUFACTURING_DATA_ADT = const(0xFF)
_ADAFRUIT_COMPANY_ID = const(0x0822)
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,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 = ["digitalio", "busio"]
autodoc_mock_imports = ["bleak", "digitalio", "busio"]


intersphinx_mapping = {
Expand Down