Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Jun 26, 2023
0 parents commit a3af469
Show file tree
Hide file tree
Showing 27 changed files with 1,163 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: MIT

name: PyPI Release Actions

on:
release:
types: [published]

jobs:
upload-release-assets:
runs-on: ubuntu-latest
steps:
- name: Run PyPI Release CI workflow
uses: jposada202020/workflows-circuitpython-libs/release-pypi@main
with:
pypi-username: ${{ secrets.pypi_username }}
pypi-password: ${{ secrets.pypi_password }}
48 changes: 48 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

# Do not include files and directories created by your personal work environment, such as the IDE
# you use, except for those already listed here. Pull requests including changes to this file will
# not be accepted.

# This .gitignore file contains rules for files generated by working with MicroPython libraries,
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.

# If you find that there are files being generated on your machine that should not be included in
# your git commit, you should create a .gitignore_global file on your computer to include the
# files created by your personal setup. To do so, follow the two steps below.

# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
# the files you want to exclude from git commits.

# Second, configure Git to use the exclude file for all Git repositories by running the
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
# .gitignore_global file:
# git config --global core.excludesfile path/to/your/.gitignore_global

# MicroPython-specific files
*.mpy

# Python-specific files
__pycache__
*.pyc

# Sphinx build-specific files
_build

# This file results from running `pip -e install .` in a local repository
*.egg-info

# Virtual environment-specific files
.env
.venv

# MacOS-specific files
*.DS_Store

# IDE-specific files
.idea
.vscode
*~
38 changes: 38 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: Unlicense

repos:
- repo: https://github.com/python/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/pylint
rev: v2.15.5
hooks:
- id: pylint
name: pylint (library code)
types: [python]
args:
- --disable=consider-using-f-string
exclude: "^(docs/|examples/|tests/|setup.py$)"
- id: pylint
name: pylint (example code)
description: Run pylint rules on "examples/*.py" files
types: [python]
files: "^examples/"
args:
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
- id: pylint
name: pylint (test code)
description: Run pylint rules on "tests/*.py" files
types: [python]
files: "^tests/"
args:
- --disable=missing-docstring,consider-using-f-string,duplicate-code
122 changes: 122 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: Unlicense

[MASTER]
extension-pkg-whitelist=
ignore=CVS
ignore-patterns=
#init-hook=
jobs=1
load-plugins=pylint.extensions.no_self_use
persistent=yes
unsafe-load-any-extension=no

[MESSAGES CONTROL]
confidence=
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding
enable=

[REPORTS]
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
#msg-template=
output-format=text
reports=no
score=yes

[REFACTORING]
max-nested-blocks=5

[LOGGING]
logging-modules=logging

[SPELLING]
spelling-dict=
spelling-ignore-words=
spelling-private-dict-file=
spelling-store-unknown-words=no

[TYPECHECK]
contextmanager-decorators=contextlib.contextmanager
generated-members=
ignore-mixin-members=yes
ignore-on-opaque-inference=yes
ignored-classes=optparse.Values,thread._local,_thread._local
ignored-modules=board
missing-member-hint=yes
missing-member-hint-distance=1
missing-member-max-choices=1

[VARIABLES]
additional-builtins=
callbacks=cb_,_cb
dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_
ignored-argument-names=_.*|^ignored_|^unused_
init-import=no
redefining-builtins-modules=six.moves,future.builtins

[FORMAT]
expected-line-ending-format=LF
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
indent-after-paren=4
indent-string=' '
max-line-length=100
max-module-lines=1000
single-line-class-stmt=no
single-line-if-stmt=no

[SIMILARITIES]
ignore-comments=yes
ignore-docstrings=yes
ignore-imports=yes
min-similarity-lines=12

[BASIC]
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
bad-names=foo,bar,baz,toto,tutu,tata
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
class-rgx=[A-Z_][a-zA-Z0-9_]+$
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
docstring-min-length=-1
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_,cs
include-naming-hint=no
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
name-group=
no-docstring-rgx=^_
property-classes=abc.abstractproperty
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$

[IMPORTS]
allow-wildcard-with-all=no
analyse-fallback-blocks=no
deprecated-modules=optparse,tkinter.tix
ext-import-graph=
import-graph=
int-import-graph=
known-standard-library=
known-third-party=enchant

[CLASSES]
defining-attr-methods=__init__,__new__,setUp
exclude-protected=_asdict,_fields,_replace,_source,_make
valid-classmethod-first-arg=cls
valid-metaclass-classmethod-first-arg=mcs

[DESIGN]
max-args=5
max-attributes=30
max-bool-expr=5
max-branches=12
max-locals=15
max-parents=7
max-public-methods=20
max-returns=6
max-statements=50
min-public-methods=1

[EXCEPTIONS]
overgeneral-exceptions=Exception
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
#
# SPDX-License-Identifier: Unlicense

version: 2

build:
os: ubuntu-20.04
tools:
python: "3"

python:
install:
- requirements: docs/requirements.txt
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2023 Jose D. Montoya

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
94 changes: 94 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Introduction
============


.. image:: https://readthedocs.org/projects/micropython-mpl3115a2/badge/?version=latest
:target: https://micropython-mpl3115a2.readthedocs.io/en/latest/
:alt: Documentation Status


.. image:: https://img.shields.io/badge/micropython-Ok-purple.svg
:target: https://micropython.org
:alt: micropython

.. image:: https://img.shields.io/pypi/v/micropython-mpl3115a2.svg
:alt: latest version on PyPI
:target: https://pypi.python.org/pypi/micropython-mpl3115a2

.. image:: https://static.pepy.tech/personalized-badge/micropython-mpl3115a2?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Pypi%20Downloads
:alt: Total PyPI downloads
:target: https://pepy.tech/project/micropython-mpl3115a2

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code Style: Black

MicroPython driver for the NXP MPL3115A2 Pressure and Temperature sensor


Installing with mip
====================
To install using mpremote

.. code-block:: shell
mpremote mip install github:jposada202020/MicroPython_MPL3115A2
To install directly using a WIFI capable board

.. code-block:: shell
mip install github:jposada202020/MicroPython_MPL3115A2
Installing Library Examples
============================

If you want to install library examples:

.. code-block:: shell
mpremote mip install github:jposada202020/MicroPython_MPL3115A2/examples.json
To install directly using a WIFI capable board

.. code-block:: shell
mip install github:jposada202020/MicroPython_MPL3115A2/examples.json
Installing from PyPI
=====================

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/micropython-mpl3115a2/>`_.
To install for current user:

.. code-block:: shell
pip3 install micropython-mpl3115a2
To install system-wide (this may be required in some cases):

.. code-block:: shell
sudo pip3 install micropython-mpl3115a2
To install in a virtual environment in your current project:

.. code-block:: shell
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install micropython-mpl3115a2
Usage Example
=============

Take a look at the examples directory

Documentation
=============
API documentation for this library can be found on `Read the Docs <https://micropython-mpl3115a2.readthedocs.io/en/latest/>`_.
Binary file added docs/_static/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/_static/Logo.png.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Sphinx-immaterial

SPDX-License-Identifier: MIT
10 changes: 10 additions & 0 deletions docs/_static/extra_css.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

th {
background-color: var(--md-default-fg-color--lightest);
}

.md-nav.md-nav--primary > label {
white-space: normal;
line-height: inherit;
padding-top: 3.5rem;
}
3 changes: 3 additions & 0 deletions docs/_static/extra_css.css.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Sphinx-immaterial

SPDX-License-Identifier: MIT
Binary file added docs/_static/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/_static/favicon.ico.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Sphinx-immaterial

SPDX-License-Identifier: CC-BY-4.0
9 changes: 9 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MicroPython MPL3115A2 Library
=====================================================================


.. automodule:: micropython_mpl3115a2
:members:

.. automodule:: micropython_mpl3115a2.mpl3115a2
:members:
Loading

0 comments on commit a3af469

Please sign in to comment.