Skip to content

Commit 0a4e0a9

Browse files
author
Kevin J Walters
committed
CircuitPython library for Sensirion SPS30 - i2c implementation.
Follows the style of the Adafruit_CircuitPython_PM25 library.
0 parents  commit 0a4e0a9

27 files changed

+1582
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2021 Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
Thank you for contributing! Before you submit a pull request, please read the following.
6+
7+
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://circuitpython.readthedocs.io/en/latest/docs/design_guide.html
8+
9+
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
10+
11+
Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code
12+
13+
Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues.

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Build CI
6+
7+
on: [pull_request, push]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Dump GitHub context
14+
env:
15+
GITHUB_CONTEXT: ${{ toJson(github) }}
16+
run: echo "$GITHUB_CONTEXT"
17+
- name: Translate Repo Name For Build Tools filename_prefix
18+
id: repo-name
19+
run: |
20+
echo ::set-output name=repo-name::$(
21+
echo ${{ github.repository }} |
22+
awk -F '\/' '{ print tolower($2) }' |
23+
tr '_' '-'
24+
)
25+
- name: Set up Python 3.7
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.7
29+
- name: Versions
30+
run: |
31+
python3 --version
32+
- name: Checkout Current Repo
33+
uses: actions/checkout@v1
34+
with:
35+
submodules: true
36+
- name: Checkout tools repo
37+
uses: actions/checkout@v2
38+
with:
39+
repository: adafruit/actions-ci-circuitpython-libs
40+
path: actions-ci
41+
- name: Install dependencies
42+
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
43+
run: |
44+
source actions-ci/install.sh
45+
- name: Pip install pylint, Sphinx, pre-commit
46+
run: |
47+
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
48+
- name: Library version
49+
run: git describe --dirty --always --tags
50+
- name: Pre-commit hooks
51+
run: |
52+
pre-commit run --all-files
53+
- name: Build assets
54+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
55+
- name: Build docs
56+
working-directory: docs
57+
run: sphinx-build -E -W -b html . _build/html
58+
- name: Check For setup.py
59+
id: need-pypi
60+
run: |
61+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
62+
- name: Build Python package
63+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
64+
run: |
65+
pip install --upgrade setuptools wheel twine readme_renderer testresources
66+
python setup.py sdist
67+
python setup.py bdist_wheel --universal
68+
twine check dist/*
69+
- name: Setup problem matchers
70+
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2021 Scott Shawcroft for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Failure help text
6+
7+
on:
8+
workflow_run:
9+
workflows: ["Build CI"]
10+
types:
11+
- completed
12+
13+
jobs:
14+
post-help:
15+
runs-on: ubuntu-latest
16+
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event == 'pull_request' }}
17+
steps:
18+
- name: Post comment to help
19+
uses: adafruit/circuitpython-action-library-ci-failed@v1

.github/workflows/release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Dump GitHub context
16+
env:
17+
GITHUB_CONTEXT: ${{ toJson(github) }}
18+
run: echo "$GITHUB_CONTEXT"
19+
- name: Translate Repo Name For Build Tools filename_prefix
20+
id: repo-name
21+
run: |
22+
echo ::set-output name=repo-name::$(
23+
echo ${{ github.repository }} |
24+
awk -F '\/' '{ print tolower($2) }' |
25+
tr '_' '-'
26+
)
27+
- name: Set up Python 3.6
28+
uses: actions/setup-python@v1
29+
with:
30+
python-version: 3.6
31+
- name: Versions
32+
run: |
33+
python3 --version
34+
- name: Checkout Current Repo
35+
uses: actions/checkout@v1
36+
with:
37+
submodules: true
38+
- name: Checkout tools repo
39+
uses: actions/checkout@v2
40+
with:
41+
repository: adafruit/actions-ci-circuitpython-libs
42+
path: actions-ci
43+
- name: Install deps
44+
run: |
45+
source actions-ci/install.sh
46+
- name: Build assets
47+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
48+
- name: Upload Release Assets
49+
# the 'official' actions version does not yet support dynamically
50+
# supplying asset names to upload. @csexton's version chosen based on
51+
# discussion in the issue below, as its the simplest to implement and
52+
# allows for selecting files with a pattern.
53+
# https://github.com/actions/upload-release-asset/issues/4
54+
#uses: actions/[email protected]
55+
uses: csexton/release-asset-action@master
56+
with:
57+
pattern: "bundles/*"
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
60+
upload-pypi:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v1
64+
- name: Check For setup.py
65+
id: need-pypi
66+
run: |
67+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
68+
- name: Set up Python
69+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
70+
uses: actions/setup-python@v1
71+
with:
72+
python-version: '3.x'
73+
- name: Install dependencies
74+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
75+
run: |
76+
python -m pip install --upgrade pip
77+
pip install setuptools wheel twine
78+
- name: Build and publish
79+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
80+
env:
81+
TWINE_USERNAME: ${{ secrets.pypi_username }}
82+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
83+
run: |
84+
python setup.py sdist
85+
twine upload dist/*

CODE_OF_CONDUCT.md

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3+
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
4+
5+
SPDX-License-Identifier: CC-BY-4.0
6+
-->
7+
# Adafruit Community Code of Conduct
8+
9+
## Our Pledge
10+
11+
In the interest of fostering an open and welcoming environment, we as
12+
contributors and leaders pledge to making participation in our project and
13+
our community a harassment-free experience for everyone, regardless of age, body
14+
size, disability, ethnicity, gender identity and expression, level or type of
15+
experience, education, socio-economic status, nationality, personal appearance,
16+
race, religion, or sexual identity and orientation.
17+
18+
## Our Standards
19+
20+
We are committed to providing a friendly, safe and welcoming environment for
21+
all.
22+
23+
Examples of behavior that contributes to creating a positive environment
24+
include:
25+
26+
* Be kind and courteous to others
27+
* Using welcoming and inclusive language
28+
* Being respectful of differing viewpoints and experiences
29+
* Collaborating with other community members
30+
* Gracefully accepting constructive criticism
31+
* Focusing on what is best for the community
32+
* Showing empathy towards other community members
33+
34+
Examples of unacceptable behavior by participants include:
35+
36+
* The use of sexualized language or imagery and sexual attention or advances
37+
* The use of inappropriate images, including in a community member's avatar
38+
* The use of inappropriate language, including in a community member's nickname
39+
* Any spamming, flaming, baiting or other attention-stealing behavior
40+
* Excessive or unwelcome helping; answering outside the scope of the question
41+
asked
42+
* Trolling, insulting/derogatory comments, and personal or political attacks
43+
* Promoting or spreading disinformation, lies, or conspiracy theories against
44+
a person, group, organisation, project, or community
45+
* Public or private harassment
46+
* Publishing others' private information, such as a physical or electronic
47+
address, without explicit permission
48+
* Other conduct which could reasonably be considered inappropriate
49+
50+
The goal of the standards and moderation guidelines outlined here is to build
51+
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.
53+
54+
We value many things beyond technical expertise, including collaboration and
55+
supporting others within our community. Providing a positive experience for
56+
other community members can have a much more significant impact than simply
57+
providing the correct answer.
58+
59+
## Our Responsibilities
60+
61+
Project leaders are responsible for clarifying the standards of acceptable
62+
behavior and are expected to take appropriate and fair corrective action in
63+
response to any instances of unacceptable behavior.
64+
65+
Project leaders have the right and responsibility to remove, edit, or
66+
reject messages, comments, commits, code, issues, and other contributions
67+
that are not aligned to this Code of Conduct, or to ban temporarily or
68+
permanently any community member for other behaviors that they deem
69+
inappropriate, threatening, offensive, or harmful.
70+
71+
## Moderation
72+
73+
Instances of behaviors that violate the Adafruit Community Code of Conduct
74+
may be reported by any member of the community. Community members are
75+
encouraged to report these situations, including situations they witness
76+
involving other community members.
77+
78+
You may report in the following ways:
79+
80+
In any situation, you may send an email to <[email protected]>.
81+
82+
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, @danh#1614, @cater#2442,
86+
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
87+
88+
Email and direct message reports will be kept confidential.
89+
90+
In situations on Discord where the issue is particularly egregious, possibly
91+
illegal, requires immediate action, or violates the Discord terms of service,
92+
you should also report the message directly to Discord.
93+
94+
These are the steps for upholding our community’s standards of conduct.
95+
96+
1. Any member of the community may report any situation that violates the
97+
Adafruit Community Code of Conduct. All reports will be reviewed and
98+
investigated.
99+
2. If the behavior is an egregious violation, the community member who
100+
committed the violation may be banned immediately, without warning.
101+
3. Otherwise, moderators will first respond to such behavior with a warning.
102+
4. Moderators follow a soft "three strikes" policy - the community member may
103+
be given another chance, if they are receptive to the warning and change their
104+
behavior.
105+
5. If the community member is unreceptive or unreasonable when warned by a
106+
moderator, or the warning goes unheeded, they may be banned for a first or
107+
second offense. Repeated offenses will result in the community member being
108+
banned.
109+
110+
## Scope
111+
112+
This Code of Conduct and the enforcement policies listed above apply to all
113+
Adafruit Community venues. This includes but is not limited to any community
114+
spaces (both public and private), the entire Adafruit Discord server, and
115+
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
116+
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
117+
interaction at a conference.
118+
119+
This Code of Conduct applies both within project spaces and in public spaces
120+
when an individual is representing the project or its community. As a community
121+
member, you are representing our community, and are expected to behave
122+
accordingly.
123+
124+
## Attribution
125+
126+
This Code of Conduct is adapted from the [Contributor Covenant],
127+
version 1.4, available at
128+
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
129+
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
130+
131+
For other projects adopting the Adafruit Community Code of
132+
Conduct, please contact the maintainers of those projects for enforcement.
133+
If you wish to use this code of conduct for your own project, consider
134+
explicitly mentioning your moderation policy or making a copy with your
135+
own moderation policy so as to avoid confusion.
136+
137+
[Contributor Covenant]: https://www.contributor-covenant.org

LICENSE

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

0 commit comments

Comments
 (0)