Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Commit a3af469

Browse files
committed
first commit
0 parents  commit a3af469

27 files changed

+1163
-0
lines changed

.github/workflows/release_pypi.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: PyPI 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: Run PyPI Release CI workflow
16+
uses: jposada202020/workflows-circuitpython-libs/release-pypi@main
17+
with:
18+
pypi-username: ${{ secrets.pypi_username }}
19+
pypi-password: ${{ secrets.pypi_password }}

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# Do not include files and directories created by your personal work environment, such as the IDE
6+
# you use, except for those already listed here. Pull requests including changes to this file will
7+
# not be accepted.
8+
9+
# This .gitignore file contains rules for files generated by working with MicroPython libraries,
10+
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
11+
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.
12+
13+
# If you find that there are files being generated on your machine that should not be included in
14+
# your git commit, you should create a .gitignore_global file on your computer to include the
15+
# files created by your personal setup. To do so, follow the two steps below.
16+
17+
# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
18+
# the files you want to exclude from git commits.
19+
20+
# Second, configure Git to use the exclude file for all Git repositories by running the
21+
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
22+
# .gitignore_global file:
23+
# git config --global core.excludesfile path/to/your/.gitignore_global
24+
25+
# MicroPython-specific files
26+
*.mpy
27+
28+
# Python-specific files
29+
__pycache__
30+
*.pyc
31+
32+
# Sphinx build-specific files
33+
_build
34+
35+
# This file results from running `pip -e install .` in a local repository
36+
*.egg-info
37+
38+
# Virtual environment-specific files
39+
.env
40+
.venv
41+
42+
# MacOS-specific files
43+
*.DS_Store
44+
45+
# IDE-specific files
46+
.idea
47+
.vscode
48+
*~

.pre-commit-config.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
repos:
6+
- repo: https://github.com/python/black
7+
rev: 22.3.0
8+
hooks:
9+
- id: black
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.2.0
12+
hooks:
13+
- id: check-yaml
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
- repo: https://github.com/pycqa/pylint
17+
rev: v2.15.5
18+
hooks:
19+
- id: pylint
20+
name: pylint (library code)
21+
types: [python]
22+
args:
23+
- --disable=consider-using-f-string
24+
exclude: "^(docs/|examples/|tests/|setup.py$)"
25+
- id: pylint
26+
name: pylint (example code)
27+
description: Run pylint rules on "examples/*.py" files
28+
types: [python]
29+
files: "^examples/"
30+
args:
31+
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
32+
- id: pylint
33+
name: pylint (test code)
34+
description: Run pylint rules on "tests/*.py" files
35+
types: [python]
36+
files: "^tests/"
37+
args:
38+
- --disable=missing-docstring,consider-using-f-string,duplicate-code

.pylintrc

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
[MASTER]
6+
extension-pkg-whitelist=
7+
ignore=CVS
8+
ignore-patterns=
9+
#init-hook=
10+
jobs=1
11+
load-plugins=pylint.extensions.no_self_use
12+
persistent=yes
13+
unsafe-load-any-extension=no
14+
15+
[MESSAGES CONTROL]
16+
confidence=
17+
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding
18+
enable=
19+
20+
[REPORTS]
21+
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
22+
#msg-template=
23+
output-format=text
24+
reports=no
25+
score=yes
26+
27+
[REFACTORING]
28+
max-nested-blocks=5
29+
30+
[LOGGING]
31+
logging-modules=logging
32+
33+
[SPELLING]
34+
spelling-dict=
35+
spelling-ignore-words=
36+
spelling-private-dict-file=
37+
spelling-store-unknown-words=no
38+
39+
[TYPECHECK]
40+
contextmanager-decorators=contextlib.contextmanager
41+
generated-members=
42+
ignore-mixin-members=yes
43+
ignore-on-opaque-inference=yes
44+
ignored-classes=optparse.Values,thread._local,_thread._local
45+
ignored-modules=board
46+
missing-member-hint=yes
47+
missing-member-hint-distance=1
48+
missing-member-max-choices=1
49+
50+
[VARIABLES]
51+
additional-builtins=
52+
callbacks=cb_,_cb
53+
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
54+
ignored-argument-names=_.*|^ignored_|^unused_
55+
init-import=no
56+
redefining-builtins-modules=six.moves,future.builtins
57+
58+
[FORMAT]
59+
expected-line-ending-format=LF
60+
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
61+
indent-after-paren=4
62+
indent-string=' '
63+
max-line-length=100
64+
max-module-lines=1000
65+
single-line-class-stmt=no
66+
single-line-if-stmt=no
67+
68+
[SIMILARITIES]
69+
ignore-comments=yes
70+
ignore-docstrings=yes
71+
ignore-imports=yes
72+
min-similarity-lines=12
73+
74+
[BASIC]
75+
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
76+
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
77+
bad-names=foo,bar,baz,toto,tutu,tata
78+
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
79+
class-rgx=[A-Z_][a-zA-Z0-9_]+$
80+
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
81+
docstring-min-length=-1
82+
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
83+
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs
84+
include-naming-hint=no
85+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
86+
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
87+
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
88+
name-group=
89+
no-docstring-rgx=^_
90+
property-classes=abc.abstractproperty
91+
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
92+
93+
[IMPORTS]
94+
allow-wildcard-with-all=no
95+
analyse-fallback-blocks=no
96+
deprecated-modules=optparse,tkinter.tix
97+
ext-import-graph=
98+
import-graph=
99+
int-import-graph=
100+
known-standard-library=
101+
known-third-party=enchant
102+
103+
[CLASSES]
104+
defining-attr-methods=__init__,__new__,setUp
105+
exclude-protected=_asdict,_fields,_replace,_source,_make
106+
valid-classmethod-first-arg=cls
107+
valid-metaclass-classmethod-first-arg=mcs
108+
109+
[DESIGN]
110+
max-args=5
111+
max-attributes=30
112+
max-bool-expr=5
113+
max-branches=12
114+
max-locals=15
115+
max-parents=7
116+
max-public-methods=20
117+
max-returns=6
118+
max-statements=50
119+
min-public-methods=1
120+
121+
[EXCEPTIONS]
122+
overgeneral-exceptions=Exception

.readthedocs.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
version: 2
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3"
11+
12+
python:
13+
install:
14+
- requirements: docs/requirements.txt

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) 2023 Jose D. Montoya
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.

README.rst

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
Introduction
2+
============
3+
4+
5+
.. image:: https://readthedocs.org/projects/micropython-mpl3115a2/badge/?version=latest
6+
:target: https://micropython-mpl3115a2.readthedocs.io/en/latest/
7+
:alt: Documentation Status
8+
9+
10+
.. image:: https://img.shields.io/badge/micropython-Ok-purple.svg
11+
:target: https://micropython.org
12+
:alt: micropython
13+
14+
.. image:: https://img.shields.io/pypi/v/micropython-mpl3115a2.svg
15+
:alt: latest version on PyPI
16+
:target: https://pypi.python.org/pypi/micropython-mpl3115a2
17+
18+
.. image:: https://static.pepy.tech/personalized-badge/micropython-mpl3115a2?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Pypi%20Downloads
19+
:alt: Total PyPI downloads
20+
:target: https://pepy.tech/project/micropython-mpl3115a2
21+
22+
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
23+
:target: https://github.com/psf/black
24+
:alt: Code Style: Black
25+
26+
MicroPython driver for the NXP MPL3115A2 Pressure and Temperature sensor
27+
28+
29+
Installing with mip
30+
====================
31+
To install using mpremote
32+
33+
.. code-block:: shell
34+
35+
mpremote mip install github:jposada202020/MicroPython_MPL3115A2
36+
37+
To install directly using a WIFI capable board
38+
39+
.. code-block:: shell
40+
41+
mip install github:jposada202020/MicroPython_MPL3115A2
42+
43+
44+
Installing Library Examples
45+
============================
46+
47+
If you want to install library examples:
48+
49+
.. code-block:: shell
50+
51+
mpremote mip install github:jposada202020/MicroPython_MPL3115A2/examples.json
52+
53+
To install directly using a WIFI capable board
54+
55+
.. code-block:: shell
56+
57+
mip install github:jposada202020/MicroPython_MPL3115A2/examples.json
58+
59+
60+
Installing from PyPI
61+
=====================
62+
63+
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
64+
PyPI <https://pypi.org/project/micropython-mpl3115a2/>`_.
65+
To install for current user:
66+
67+
.. code-block:: shell
68+
69+
pip3 install micropython-mpl3115a2
70+
71+
To install system-wide (this may be required in some cases):
72+
73+
.. code-block:: shell
74+
75+
sudo pip3 install micropython-mpl3115a2
76+
77+
To install in a virtual environment in your current project:
78+
79+
.. code-block:: shell
80+
81+
mkdir project-name && cd project-name
82+
python3 -m venv .venv
83+
source .env/bin/activate
84+
pip3 install micropython-mpl3115a2
85+
86+
87+
Usage Example
88+
=============
89+
90+
Take a look at the examples directory
91+
92+
Documentation
93+
=============
94+
API documentation for this library can be found on `Read the Docs <https://micropython-mpl3115a2.readthedocs.io/en/latest/>`_.

docs/_static/Logo.png

2.5 KB
Loading

docs/_static/Logo.png.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Sphinx-immaterial
2+
3+
SPDX-License-Identifier: MIT

docs/_static/extra_css.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
th {
3+
background-color: var(--md-default-fg-color--lightest);
4+
}
5+
6+
.md-nav.md-nav--primary > label {
7+
white-space: normal;
8+
line-height: inherit;
9+
padding-top: 3.5rem;
10+
}

docs/_static/extra_css.css.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Sphinx-immaterial
2+
3+
SPDX-License-Identifier: MIT

docs/_static/favicon.ico

10.8 KB
Binary file not shown.

docs/_static/favicon.ico.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Sphinx-immaterial
2+
3+
SPDX-License-Identifier: CC-BY-4.0

docs/api.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MicroPython MPL3115A2 Library
2+
=====================================================================
3+
4+
5+
.. automodule:: micropython_mpl3115a2
6+
:members:
7+
8+
.. automodule:: micropython_mpl3115a2.mpl3115a2
9+
:members:

0 commit comments

Comments
 (0)