Skip to content

Commit e197ba5

Browse files
committed
updated build and doc config files
1 parent 9048051 commit e197ba5

File tree

8 files changed

+105
-22
lines changed

8 files changed

+105
-22
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ python:
1111
cache:
1212
pip: true
1313

14-
# TODO: if deployment to PyPi is desired, change 'DEPLOY_PYPI' to "true",
15-
# or remove the env block entirely and remove the condition in the
16-
# deploy block.
1714
env:
18-
- DEPLOY_PYPI="false"
15+
- DEPLOY_PYPI="true"
1916

2017
deploy:
2118
- provider: releases
@@ -29,9 +26,9 @@ deploy:
2926
# TODO: Use 'travis encrypt --com -r adafruit/<repo slug>' to generate
3027
# the encrypted password for adafruit-travis. Paste result below.
3128
- provider: pypi
32-
user: adafruit-travis
29+
user: fourstix
3330
password:
34-
secure: #-- PASTE ENCRYPTED PASSWORD HERE --#
31+
secure: uYIy80a9qoGtRUQsczO8b7HRwhd2PELYjBpHuFGCgbj9nMsPyiwgHwREZhF7sr1Mbw3uI2DQaqqVvhax/9inncO9pX1228Iaw8bfgxVrnhhiRr4ruUleGr9z7Fp1TxLFfo2/bZVSq0NJ2abZ7JuCAkB9KxL50eeoo5vtVk8ZUlsi1DOxdiU9VgrGZ3cVemiBH49RZzZ/n3sTAkWmFIzzpc2daTU0yX9UOBTNwXUf8aL+g+jOgAGN8XLbRwgd/HU09evnaQh93U1cxb+3QC9TbM3tLTEWCmB/YN1AtGYj1z8+PvBKtbuzcH0TktBZ2yFiOXbD7ikeq7nJApD2uLc/t7Y4UTSjOvoeqy/YTbCEgQxo75hVFuZe5PIQH4/hFGULY/7FTW0T36qdVtLkwNSUP7ZYSX6rZFVo9FdZSPaKB5g4Ve+gQRJzOepK8faTyGfUgl7LlQqI7xPogNlXYsn9RxzRr2ZU5vC9qKu8Pk7/mBGF9pvPKx1CE3lYi41CePDxRFMDrbdtLEHyfQ2K+qt7Nlk4mzyqFgo8kb+LFfRzSRbDdEmHC9htaEA1cAk/UJJhNMNRZKYYuVfJHBbaQhnT7ponK1Gjmrhen9d+fZ7ojyHG5baKdYMtAtfTYsgU3O/7GzaEBPYjBow69ESlKFWUBh4Ik8KJNNa8Qmd0VhMzPIc=
3532
on:
3633
tags: true
3734
condition: $DEPLOY_PYPI = "true"

docs/conf.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@
1616
'sphinx.ext.todo',
1717
]
1818

19-
# TODO: Please Read!
20-
# Uncomment the below if you use native CircuitPython modules such as
21-
# digitalio, micropython and busio. List the modules you use. Without it, the
22-
# autodoc module docs will fail to generate with a warning.
23-
# autodoc_mock_imports = ["digitalio", "busio"]
19+
autodoc_mock_imports = ["digitalio", "busio"]
2420

2521

2622
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

docs/examples.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,45 @@ Ensure your device works with this simple test.
66
.. literalinclude:: ../examples/qwiicas3935_simpletest.py
77
:caption: examples/qwiicas3935_simpletest.py
88
:linenos:
9+
10+
Examples (I2C)
11+
---------
12+
13+
1. Basic Lightning (I2C) - Show lightning events.
14+
15+
.. literalinclude:: ../examples/example1_basic_lightning_i2c.py
16+
:caption: examples/example1_basic_lightning_i2c.py
17+
:linenos:
18+
19+
2. More Lightning Features (I2C) - Functions that prevent noise and false events.
20+
21+
.. literalinclude:: ../examples/example2_more_lightning_features_i2c.py
22+
:caption: examples/example2_more_lightning_features_i2c.py
23+
:linenos:
24+
25+
3. Tune Antenna (I2C) - Tune the resonance frequency of the antenna.
26+
27+
.. literalinclude:: ../examples/example3_tune_antenna_i2c.py
28+
:caption: examples/example3_tune_antenna_i2c.py
29+
:linenos:
30+
31+
Examples (SPI)
32+
---------
33+
34+
1. Basic Lightning (SPI) - Show lightning events.
35+
36+
.. literalinclude:: ../examples/example1_basic_lightning_spi.py
37+
:caption: examples/example1_basic_lightning_spi.py
38+
:linenos:
39+
40+
2. More Lightning Features (SPI) - Functions that prevent noise and false events.
41+
42+
.. literalinclude:: ../examples/example2_more_lightning_features_spi.py
43+
:caption: examples/example2_more_lightning_features_spi.py
44+
:linenos:
45+
46+
3. Tune Antenna (SPI) - Tune the resonance frequency of the antenna.
47+
48+
.. literalinclude:: ../examples/example3_tune_antenna_spi.py
49+
:caption: examples/example3_tune_antenna_spi.py
50+
:linenos:

docs/index.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@ Table of Contents
2323
.. toctree::
2424
:caption: Tutorials
2525

26-
.. todo:: Add any Learn guide links here. If there are none, then simply delete this todo and leave
27-
the toctree above for use later.
26+
Sparkfun Qwiic Lightning Detector Hookup Guide <https://learn.sparkfun.com/tutorials/sparkfun-qwiic-as3935-lightning-detector-hookup-guide>
2827

2928
.. toctree::
3029
:caption: Related Products
3130

32-
.. todo:: Add any product links here. If there are none, then simply delete this todo and leave
33-
the toctree above for use later.
31+
Sparkfun Qwiic Lightning Detector <https://www.sparkfun.com/products/15276>
3432

3533
.. toctree::
3634
:caption: Other Links

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Adafruit-Blinka
2+
adafruit-circuitpython-busdevice

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
long_description = f.read()
1818

1919
setup(
20-
name='adafruit-circuitpython-qwiicas3935',
20+
name='sparkfun-circuitpython-qwiicas3935',
2121

2222
use_scm_version=True,
2323
setup_requires=['setuptools_scm'],
@@ -27,14 +27,15 @@
2727
long_description_content_type='text/x-rst',
2828

2929
# The project's main homepage.
30-
url='https://github.com/adafruit/Adafruit_CircuitPython_QwiicAS3935',
30+
url='https://github.com/fourstix/Sparkfun_CircuitPython_QwiicAS3935',
3131

3232
# Author details
33-
author='Adafruit Industries',
34-
author_email='circuitpython@adafruit.com',
33+
author='Gaston Williams',
34+
author_email='fourstix@gmail.com',
3535

3636
install_requires=[
37-
'Adafruit-Blinka'
37+
'Adafruit-Blinka',
38+
'adafruit-circuitpython-busdevice'
3839
],
3940

4041
# Choose your license

sparkfun_qwiicas3935.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
* Based on the Arduino library for the Qwiic AS3935 Lightning Detector
3232
* Written by Elias Santistevan @ SparkFun Electronics in January, 2019
33-
* Register read function based on code written by Phil Fenstermacher
33+
* I2C Register read functions based on code written by Phil Fenstermacher
3434
* on December, 2014 as part of the RPi_AS3935 python library.
3535
3636
Implementation Notes
@@ -543,7 +543,7 @@ def _read_register(self, register):
543543

544544
def _read_byte(self, register):
545545
# Read all the registers and get byte values above 0x08. This range
546-
# contains the lightning look-up tables and calibration regisers.
546+
# contains the lightning look-up tables and calibration registers.
547547
# The read_register is more efficent for more frequent data registers.
548548
with self._i2c as i2c:
549549
i2c.write(bytes([0x00]),stop=False)

travis.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This is a common .travis.yml for generating library release zip files for
2+
# CircuitPython library releases using circuitpython-build-tools.
3+
# See https://github.com/adafruit/circuitpython-build-tools for detailed setup
4+
# instructions.
5+
6+
dist: xenial
7+
language: python
8+
python:
9+
- "3.6"
10+
11+
cache:
12+
pip: true
13+
14+
# if deployment to PyPi is desired, change 'DEPLOY_PYPI' to "true",
15+
# or remove the env block entirely and remove the condition in the
16+
# deploy block.
17+
env:
18+
- DEPLOY_PYPI="true"
19+
20+
deploy:
21+
- provider: releases
22+
api_key: "$GITHUB_TOKEN"
23+
file_glob: true
24+
file: "$TRAVIS_BUILD_DIR/bundles/*"
25+
skip_cleanup: true
26+
overwrite: true
27+
on:
28+
tags: true
29+
# TODO: Use 'travis encrypt --com -r adafruit/<repo slug>' to generate
30+
# the encrypted password for adafruit-travis. Paste result below.
31+
- provider: pypi
32+
user: fourstix
33+
password:
34+
secure: MgHwILmPMRF+gn/Xo+9jbTLFD/GIrkdR8TPrxxUU8iAlCjoqoRWV5WDe4Q9itLyP2qkSvSg+24l30NC9IqYzUH8OzSy9dIMUzv3mUJOryr1cnhT7QhR+8PJafegEPiYtP1g9Laq3b6du6tYjBhOY2yA0uZmp3OY0vhL18ZbWOYwKzEf6GXiruhTY2BrC+4O8SjFaQJC/qBQCQ1LoyM947q2DFGhamYVfxwExLWsEcUHA8eNXYWDz9PTi/l+0qmN89uDDFpZMWTXRnnuhlJ6bbirG+Dz+Z8crBKNh/GT840OzqF5zyEUR7QQz2Eg932dulRuPiJgT6TXpgplwlzHl+sa6kke3LuCUoZB5GXHG4DwR84SQlSGvAEAzN6lMzRzduqJal202xlOVS529ASV+72OtLtMNAAOHEhbg/pAiY0rYZFK7yHDQnJRrIzaaMs7EzYA+ZqrclIuGrY2PENM59uGybm4BX2BCI9FTGWIatfC70RdnCzDrTF6EE12ikwcYPZfErYFXabqQhcWMDGYnJw86HYi5K5xGmGfwnfxwoa4vGBW1gtx6uOHU57VmN2gXUICWgtrmLsx3jhIIVAYIY5J+eCI4c3rJh2OwyEGE1VR4RCSXJ5XBJXoKzcvvjYsOxq7upywcL9zOHlyf8e2WGJ3BoreVPFdPRV3eFWSgD0U=
35+
on:
36+
tags: true
37+
condition: $DEPLOY_PYPI = "true"
38+
39+
install:
40+
- pip install -r requirements.txt
41+
- pip install circuitpython-build-tools Sphinx sphinx-rtd-theme
42+
- pip install --force-reinstall pylint==1.9.2
43+
44+
script:
45+
- pylint sparkfun_qwiictwist.py
46+
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
47+
- circuitpython-build-bundles --filename_prefix sparkfun-circuitpython-qwiictwist --library_location .
48+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

0 commit comments

Comments
 (0)