Skip to content

Commit 9328f16

Browse files
authored
Merge pull request adafruit#37 from adafruit/REUSE
Ran pre-commit, added licenses
2 parents 94c23f9 + ff6c5c4 commit 9328f16

12 files changed

+410
-43
lines changed

.github/workflows/build.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,36 @@ jobs:
4242
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
4343
run: |
4444
source actions-ci/install.sh
45-
- name: Pip install pylint, black, & Sphinx
45+
- name: Pip install pylint, Sphinx, pre-commit
4646
run: |
47-
pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
47+
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
4848
- name: Library version
4949
run: git describe --dirty --always --tags
50-
- name: Check formatting
50+
- name: Pre-commit hooks
5151
run: |
52-
black --check --target-version=py35 .
52+
pre-commit run --all-files
5353
- name: PyLint
5454
run: |
5555
pylint $( find . -path './adafruit*.py' )
5656
([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
5757
- name: Build assets
5858
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
59+
- name: Archive bundles
60+
uses: actions/upload-artifact@v2
61+
with:
62+
name: bundles
63+
path: ${{ github.workspace }}/bundles/
5964
- name: Build docs
6065
working-directory: docs
6166
run: sphinx-build -E -W -b html . _build/html
67+
- name: Check For setup.py
68+
id: need-pypi
69+
run: |
70+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
71+
- name: Build Python package
72+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
73+
run: |
74+
pip install --upgrade setuptools wheel twine readme_renderer testresources
75+
python setup.py sdist
76+
python setup.py bdist_wheel --universal
77+
twine check dist/*

CODE_OF_CONDUCT.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Examples of unacceptable behavior by participants include:
4949

5050
The goal of the standards and moderation guidelines outlined here is to build
5151
and maintain a respectful community. We ask that you don’t just aim to be
52-
"technically unimpeachable", but rather try to be your best self.
52+
"technically unimpeachable", but rather try to be your best self.
5353

5454
We value many things beyond technical expertise, including collaboration and
5555
supporting others within our community. Providing a positive experience for
@@ -80,9 +80,9 @@ You may report in the following ways:
8080
In any situation, you may send an email to <[email protected]>.
8181

8282
On the Adafruit Discord, you may send an open message from any channel
83-
to all Community Moderators by tagging @community moderators. You may
84-
also send an open message from any channel, or a direct message to
85-
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
83+
to all Community Moderators by tagging @community moderators. You may
84+
also send an open message from any channel, or a direct message to
85+
@kattni#1507, @tannewt#4653, @Dan Halbert#1614, @cater#2442,
8686
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
8787

8888
Email and direct message reports will be kept confidential.

LICENSES/CC-BY-4.0.txt

+324
Large diffs are not rendered by default.

LICENSES/MIT.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
MIT License Copyright (c) <year> <copyright holders>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice (including the next
11+
paragraph) shall be included in all copies or substantial portions of the
12+
Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19+
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/Unlicense.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or distribute
4+
this software, either in source code form or as a compiled binary, for any
5+
purpose, commercial or non-commercial, and by any means.
6+
7+
In jurisdictions that recognize copyright laws, the author or authors of this
8+
software dedicate any and all copyright interest in the software to the public
9+
domain. We make this dedication for the benefit of the public at large and
10+
to the detriment of our heirs and successors. We intend this dedication to
11+
be an overt act of relinquishment in perpetuity of all present and future
12+
rights to this software under copyright law.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
17+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
19+
THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information,
20+
please refer to <https://unlicense.org/>

adafruit_clue.py

+6-26
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,7 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2020 Kattni Rembor for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2020 Kattni Rembor for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
4-
# The MIT License (MIT)
5-
#
6-
# Copyright (c) 2020 Kattni Rembor for Adafruit Industries
7-
#
8-
# Permission is hereby granted, free of charge, to any person obtaining a copy
9-
# of this software and associated documentation files (the "Software"), to deal
10-
# in the Software without restriction, including without limitation the rights
11-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12-
# copies of the Software, and to permit persons to whom the Software is
13-
# furnished to do so, subject to the following conditions:
14-
#
15-
# The above copyright notice and this permission notice shall be included in
16-
# all copies or substantial portions of the Software.
17-
#
18-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24-
# THE SOFTWARE.
4+
255
"""
266
`adafruit_clue`
277
================================================================================
@@ -409,7 +389,7 @@ def shake(self, shake_threshold=30, avg_count=10, total_delay=0.1):
409389
410390
:param total_delay: The total time in seconds it takes to obtain avg_count
411391
readings from acceleration. (Default 0.1)
412-
"""
392+
"""
413393
shake_accel = (0, 0, 0)
414394
for _ in range(avg_count):
415395
# shake_accel creates a list of tuples from acceleration data.
@@ -742,7 +722,7 @@ def _generate_sample(self, length=100):
742722
self._sine_wave_sample = audiocore.RawSample(self._sine_wave)
743723

744724
def play_tone(self, frequency, duration):
745-
""" Produce a tone using the speaker. Try changing frequency to change
725+
"""Produce a tone using the speaker. Try changing frequency to change
746726
the pitch of the tone.
747727
748728
:param int frequency: The frequency of the tone in Hz
@@ -767,7 +747,7 @@ def play_tone(self, frequency, duration):
767747
self.stop_tone()
768748

769749
def start_tone(self, frequency):
770-
""" Produce a tone using the speaker. Try changing frequency to change
750+
"""Produce a tone using the speaker. Try changing frequency to change
771751
the pitch of the tone.
772752
773753
:param int frequency: The frequency of the tone in Hz
@@ -802,7 +782,7 @@ def start_tone(self, frequency):
802782
self._sample.play(self._sine_wave_sample, loop=True)
803783

804784
def stop_tone(self):
805-
""" Use with start_tone to stop the tone produced.
785+
"""Use with start_tone to stop the tone produced.
806786
807787
.. image :: ../docs/_static/speaker.jpg
808788
:alt: Speaker

docs/api.rst.license

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
3-
SPDX-License-Identifier: MIT
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/examples.rst.license

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
3-
SPDX-License-Identifier: MIT
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

docs/index.rst.license

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
3-
SPDX-License-Identifier: MIT
1+
# SPDX-FileCopyrightText: 2020 ladyada for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT

examples/advanced_examples/clue_ams_remote_advanced.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# SPDX-FileCopyrightText: 2020 Dylan Herrada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
13
""" This example solicits that apple devices that provide notifications connect to it, initiates
24
pairing, then allows the user to use a CLUE board as a media remote through both the buttons
35
and capacitive touch pads.

examples/clue_ams_remote.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2020 Dylan Herrada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
"""
25
This example solicits that apple devices that provide notifications connect to it, initiates
36
pairing, then allows the user to use a CLUE board as a media remote through both the buttons

examples/clue_temperature_humidity_monitor.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2+
# SPDX-License-Identifier: MIT
3+
14
"""Monitor customisable temperature and humidity ranges, with an optional audible alarm tone."""
25
from adafruit_clue import clue
36

0 commit comments

Comments
 (0)