Skip to content

Update more files for new build processs #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

*.mpy
.idea
__pycache__
_build
*.pyc
.env
build*
.python-version
build*/
bundles
*.DS_Store
.eggs
dist
**/*.egg-info
**/*.egg-info
.vscode
17 changes: 10 additions & 7 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

[MASTER]

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=

# Add files or directories to the blacklist. They should be base names, not
# Add files or directories to the ignore-list. They should be base names, not
# paths.
ignore=CVS

# Add files or directories matching the regex patterns to the blacklist. The
# Add files or directories matching the regex patterns to the ignore-list. The
# regex matches against base names, not paths.
ignore-patterns=

Expand All @@ -18,8 +22,7 @@ ignore-patterns=
#init-hook=

# Use multiple processes to speed up Pylint.
# jobs=1
jobs=2
jobs=1

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
Expand Down Expand Up @@ -52,7 +55,7 @@ confidence=
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,pointless-string-statement

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -246,10 +249,10 @@ ignore-comments=yes
ignore-docstrings=yes

# Ignore imports when computing similarities.
ignore-imports=no
ignore-imports=yes

# Minimum lines number of a similarity.
min-similarity-lines=4
min-similarity-lines=12


[BASIC]
Expand Down
90 changes: 51 additions & 39 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@ Introduction
:target: https://sparkfun-circuitpython-qwiictwist.readthedocs.io/en/latest/
:alt: Documentation Status


.. image:: https://img.shields.io/discord/327254708534116352.svg
:target: https://adafru.it/discord
:alt: Discord

.. image:: https://travis-ci.org/fourstix/Sparkfun_CircuitPython_QwiicTwist.svg?branch=master
:target: https://travis-ci.org/fourstix/Sparkfun_CircuitPython_QwiicTwist

.. image:: https://github.com/fourstix/Sparkfun_CircuitPython_QwiicTwist/workflows/Build%20CI/badge.svg
:target: https://github.com/fourstix/Sparkfun_CircuitPython_QwiicTwist/actions
:alt: Build Status


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

CircuitPython library for Sparkfun Qwiic Twist RGB Rotary Encoder. This library is ported from
`SparkFun Qwiic Twist Arduino Library <https://github.com/sparkfun/SparkFun_Qwiic_Twist_Arduino_Library>`_

Expand All @@ -22,8 +29,6 @@ CircuitPython library for Sparkfun Qwiic Twist RGB Rotary Encoder. This library

`SparkFun Qwiic Twist RGB Rotary Encoder (DEV-15083) <https://www.sparkfun.com/products/15083>`_



Dependencies
=============
This driver depends on:
Expand All @@ -34,7 +39,9 @@ This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem.
This is easily achieved by downloading
`the Adafruit library and driver bundle <https://github.com/adafruit/Adafruit_CircuitPython_Bundle>`_.
`the Adafruit library and driver bundle <https://circuitpython.org/libraries>`_
or individual libraries can be installed using
`circup <https://github.com/adafruit/circup>`_.

Raspberry Pi Setup
------------------
Expand Down Expand Up @@ -78,23 +85,21 @@ Quick Start Summary:
pip3 install adafruit-blinka

Installing from PyPI
--------------------
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
PyPI <https://pypi.org/project/sparkfun-circuitpython-qwiictwist/>`_.

Installing this library will also install the dependency adafruit-circuitpython-busdevice.
=====================

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

.. code-block:: shell

pip install git+https://github.com/FAR-Lab/Sparkfun_CircuitPython_QwiicTwist.git
pip3 install Sparkfun-circuitpython-qwiictwist

To install system-wide (this may be required in some cases):

.. code-block:: shell

sudo pip3 install sparkfun-circuitpython-qwiictwist
sudo pip3 install Sparkfun-circuitpython-qwiictwist

To install in a virtual environment in your current project:

Expand All @@ -103,7 +108,32 @@ To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install sparkfun-circuitpython-qwiictwist
pip3 install Sparkfun-circuitpython-qwiictwist



Installing to a Connected CircuitPython Device with Circup
==========================================================

Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:

.. code-block:: shell

pip3 install circup

With ``circup`` installed and your CircuitPython device connected use the
following command to install:

.. code-block:: shell

circup install qwiictwist

Or the following command to update an existing version:

.. code-block:: shell

circup update

Usage Example
=============
Expand All @@ -125,14 +155,19 @@ Usage Example
# For a different address use QwiicTwist(i2c, address)
# twist = QwiicTwist(i2c, 0x3E)


Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/fourstix/Sparkfun_CircuitPython_QwiicTwist/blob/master/CODE_OF_CONDUCT.md>`_
<https://github.com/fourstix/Sparkfun_CircuitPython_QwiicTwist/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

Documentation
=============

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

Building locally
================

Expand Down Expand Up @@ -160,29 +195,6 @@ Then run the build:

circuitpython-build-bundles --filename_prefix sparkfun-circuitpython-qwiictwist --library_location .

Sphinx documentation
-----------------------

Sphinx is used to build the documentation based on rST files and comments in the code. First,
install dependencies (feel free to reuse the virtual environment from above):

.. code-block:: shell

python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme

Now, once you have the virtual environment activated:

.. code-block:: shell

cd docs
sphinx-build -E -W -b html . _build/html

This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.

License Information
-----------------------
This product is **open source**!
Expand Down
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: 2018 Phillip Torrone for Adafruit Industries

SPDX-License-Identifier: CC-BY-4.0
2 changes: 1 addition & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
.. use this format as the module name: "adafruit_foo.foo"
.. automodule:: sparkfun_qwiictwist
:members:
:members:
4 changes: 4 additions & 0 deletions docs/api.rst.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2021 Gaston Williams

SPDX-License-Identifier: MIT
Loading