Compare commits
113 commits
master
...
ansys-cook
| Author | SHA1 | Date | |
|---|---|---|---|
| 11090de1dd | |||
| 6d94330763 | |||
|
|
e52ff90e65 | ||
|
|
5249bf3fb1 | ||
|
|
d1d4621a59 | ||
|
|
ed5472337b | ||
|
|
348b5b22b9 | ||
|
|
e0897a3586 | ||
| c9b7899099 | |||
| 52badab314 | |||
| f31e73700a | |||
|
|
6675a7d766 | ||
|
|
ef5e3f71e1 | ||
|
|
ff3caf6f6c | ||
|
|
9eec9be1b3 | ||
|
|
4aea673a10 | ||
|
|
cf5cd61e9e | ||
|
|
5f47325360 | ||
|
|
0978a63d0e | ||
|
|
5e20bc3b89 | ||
|
|
f25b525bb5 | ||
|
|
f046c3af19 | ||
|
|
7b763601fb | ||
|
|
3159041a2b | ||
|
|
12dfdb9e82 | ||
|
|
100c6d01e6 | ||
|
|
05daa18c3b | ||
|
|
d98e8a75a7 | ||
| cdb5fbb35e | |||
| 4631bfc982 | |||
| 0cb80a8235 | |||
| 9aeef85a9c | |||
| b78f6e847c | |||
| 1552f15001 | |||
| 26e3896e2f | |||
| ac4b448dd3 | |||
| 978f35d316 | |||
|
|
871e0a43e5 | ||
|
|
9eb05470d3 | ||
|
|
ee545a64ed | ||
|
|
65d445d716 | ||
|
|
876c936b4d | ||
|
|
c95c074cba | ||
|
|
d3d88ece29 | ||
|
|
507287ffc7 | ||
|
|
0c2f38ca2f | ||
|
|
26e2e42cc3 | ||
|
|
a40308fbc1 | ||
|
|
46e5e6795f | ||
|
|
483ec38ef9 | ||
|
|
43b12b80a3 | ||
|
|
35e17dc619 | ||
|
|
3c5481339b | ||
|
|
b413f72300 | ||
|
|
63e7324b56 | ||
|
|
0d967606bd | ||
|
|
a54bbd2a00 | ||
|
|
d9db2c122e | ||
|
|
84faf428c8 | ||
|
|
c1716ef43f | ||
|
|
202022abd2 | ||
|
|
8054491d78 | ||
|
|
fe0abf2f9b | ||
|
|
f1a402f790 | ||
|
|
893ce305ab | ||
|
|
c01da412a4 | ||
|
|
23cb8ec52e | ||
|
|
c8a9cf54de | ||
|
|
502247dec0 | ||
|
|
feb75dcd7c | ||
|
|
d5de7e3fed | ||
|
|
6117569a32 | ||
|
|
8c0c34b839 | ||
|
|
00c6af5f64 | ||
|
|
555d825957 | ||
|
|
c5f128e35c | ||
|
|
1df5c0a5a0 | ||
|
|
f2ef52fc96 | ||
|
|
e40236a65d | ||
|
|
6166a5fdd9 | ||
|
|
2630bdd29a | ||
|
|
53bcfc9633 | ||
|
|
82e712cbe9 | ||
|
|
ab3a00b4f0 | ||
|
|
12f29c3e58 | ||
|
|
82557e8f38 | ||
|
|
82ea666e85 | ||
|
|
c628d93c61 | ||
|
|
f796c35552 | ||
|
|
23f519c414 | ||
|
|
8c2f5f9b5d | ||
|
|
ba0ec42859 | ||
|
|
baa039dc87 | ||
|
|
ba293be61c | ||
|
|
0903c4a520 | ||
|
|
98c81c549f | ||
|
|
8f5a674be0 | ||
|
|
5eb23614bd | ||
|
|
fcd64a093f | ||
|
|
0b88c22b62 | ||
|
|
af4c229603 | ||
|
|
e0d8cd3367 | ||
|
|
dcc915b825 | ||
|
|
edbe971849 | ||
|
|
daecc0fd09 | ||
|
|
0312eb9626 | ||
|
|
8decc4a0aa | ||
|
|
5696cfd036 | ||
|
|
bc3e31e7ba | ||
|
|
6fca832f61 | ||
|
|
288894d77b | ||
|
|
e7ffa3a3f9 | ||
| 36cffbb4ff |
48 changed files with 608 additions and 363 deletions
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
|
|
@ -13,7 +13,7 @@ jobs:
|
|||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/setup-python@v1
|
||||
- uses: actions/setup-python@v2
|
||||
- name: set PY
|
||||
run: echo >>$GITHUB_ENV "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
|
||||
- uses: actions/cache@v1
|
||||
|
|
|
|||
21
.github/workflows/test.yml
vendored
21
.github/workflows/test.yml
vendored
|
|
@ -8,16 +8,27 @@ on: [pull_request, push]
|
|||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version:
|
||||
- '3.7'
|
||||
- '3.x'
|
||||
|
||||
os-version:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
- macos-latest
|
||||
|
||||
runs-on: ${{ matrix.os-version }}
|
||||
steps:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||
run: echo "$GITHUB_CONTEXT"
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v1
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Versions
|
||||
run: |
|
||||
python3 --version
|
||||
|
|
@ -28,7 +39,7 @@ jobs:
|
|||
- name: Install deps
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install -r $GITHUB_WORKSPACE/tests_requirements.txt
|
||||
pip install -r tests_requirements.txt
|
||||
- name: Run cookiecutter tests
|
||||
run: |
|
||||
pytest -v
|
||||
|
|
|
|||
33
.gitignore
vendored
33
.gitignore
vendored
|
|
@ -1,16 +1,31 @@
|
|||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
.venv
|
||||
.env
|
||||
.python-version
|
||||
# cookiecutter-specific files
|
||||
.cookie_test/
|
||||
.pytest*
|
||||
|
||||
# CircuitPython-specific files
|
||||
*.mpy
|
||||
|
||||
# Python-specific files
|
||||
__pycache__
|
||||
*.pyc
|
||||
|
||||
.pytest*
|
||||
__pycache__
|
||||
# Sphinx build-specific files
|
||||
_build
|
||||
|
||||
.cookie_test/
|
||||
# This file results from running `pip -e install .` in a local repository
|
||||
*.egg-info
|
||||
|
||||
.vscode/
|
||||
# Virtual environment-specific files
|
||||
.env
|
||||
|
||||
# MacOS-specific files
|
||||
*.DS_Store
|
||||
|
||||
# IDE-specific files
|
||||
.idea
|
||||
.vscode
|
||||
*~
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/fsfe/reuse-tool
|
||||
rev: v0.12.1
|
||||
hooks:
|
||||
- id: reuse
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/fsfe/reuse-tool
|
||||
rev: v0.14.0
|
||||
hooks:
|
||||
- id: reuse
|
||||
- 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
|
||||
|
|
|
|||
12
.reuse/dep5
Normal file
12
.reuse/dep5
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: cookiecutter-adafruit-circuitpython
|
||||
Upstream-Contact: support@adafruit.com
|
||||
Source: https://github.com/adafruit/cookiecutter-adafruit-circuitpython/
|
||||
|
||||
Files: {{ cookiecutter.__dirname }}/docs
|
||||
Copyright: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||
License: MIT
|
||||
|
||||
Files: {{ cookiecutter.__dirname }}/docs/_static
|
||||
Copyright: 2018 Phillip Torrone for Adafruit Industries
|
||||
License: MIT
|
||||
|
|
@ -82,8 +82,7 @@ In any situation, you may send an email to <support@adafruit.com>.
|
|||
On the Adafruit Discord, you may send an open message from any channel
|
||||
to all Community Moderators by tagging @community moderators. You may
|
||||
also send an open message from any channel, or a direct message to
|
||||
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
|
||||
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
||||
any Community Moderator.
|
||||
|
||||
Email and direct message reports will be kept confidential.
|
||||
|
||||
|
|
@ -94,18 +93,18 @@ you should also report the message directly to Discord.
|
|||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is an egregious violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
|
||||
## Scope
|
||||
|
||||
|
|
|
|||
188
README.rst
188
README.rst
|
|
@ -1,95 +1,93 @@
|
|||
Introduction
|
||||
============
|
||||
|
||||
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||
:target: https://adafru.it/discord
|
||||
:alt: Discord
|
||||
|
||||
This cookiecutter creates a project structure for a Adafruit CircuitPython
|
||||
library.
|
||||
|
||||
See this Adafruit Learn Guide for an explanation of creating a CircuitPython library: `Creating and sharing a CircuitPython library <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview>`_ The section for using cookiecutter is `here <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library#cookie-cutter>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
The above Learn Guide is directed towards creating a library for the Community Bundle. For libraries meant for the Adafruit Bundle, contact the CircuitPython Helpers (@circuitpython helpers) on Discord or put in a new issue on the Adafruit_CircuitPython_Bundle GitHub repository.
|
||||
|
||||
Cookiecutter Usage
|
||||
===================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# The first time
|
||||
pip install cookiecutter
|
||||
|
||||
cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
|
||||
|
||||
Then, fill in the prompts and accomplish some post generation cleanup:
|
||||
|
||||
Prompts
|
||||
--------
|
||||
|
||||
* ``target_bundle`` - Adafruit bundle or Community library bundle
|
||||
* ``github_user`` - GitHub user or organization which will host this repo. For example, Adafruit funded libraries should say "adafruit" here.
|
||||
* ``author_name`` - Who you are! Sets the copyright to you.
|
||||
* ``company`` - Used to give Copyright credit to the company funding the library. For example, Adafruit funded libraries should say "Adafruit Industries" here.
|
||||
* ``library_name`` - Shortest name for the library. Usually a chip name such as LIS3DH.
|
||||
* ``library_description`` - Write a sentence describing the purpose of this library (e.g. ``CircuitPython helper library for the DC & Stepper Motor FeatherWing, Shield and Pi Hat kits.``).
|
||||
* ``library_keywords`` - Used to populate keywords for PyPi. Enter a string of keywords (e.g ``dht temp humidity``) NOTE: The following are included by default: ``adafruit``, ``blinka``, ``circuitpython``, ``micropython``, and the ``library_name`` you enter.
|
||||
* ``library_prefix`` - Used to prefix the code to the organization creating the library. For example, Adafruit supported libraries should say "adafruit" here. Do not add a - or _.
|
||||
* ``adafruit_pid`` - The product ID for the Adafruit product includes a link to the product in the README. Only applies to Adafruit Bundle.
|
||||
* ``requires_bus_device`` - Determines whether to add comments about a dependency on `BusDevice <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_.
|
||||
If the library uses BusDevice, enter ``y`` or ``yes`` to include. If the library doesn't use BusDevice, all other entries including empty, will not include BusDevice.
|
||||
* ``requires_register`` - Determines whether to add comments about a dependency on `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_.
|
||||
If the library uses Register, enter ``y`` or ``yes`` to include. If the library doesn't use Register, all other entries including empty, will not include Register.
|
||||
* ``other_requirements`` - Adds any other module dependencies for PyPi. Enter a comma separated string of modules
|
||||
(e.g. ``adafruit-circuitpython-pca9685, adafruit-circuitpython-motor``). NOTE: ``Adafruit-Blinka`` is always included, so no need to include it here.
|
||||
* ``pypi_release`` - Will this library be releaased on PyPI? If so, enter ``y`` or ``yes`` to include the setup.py. For Adafruit libraries this defaults to Yes.
|
||||
* ``sphinx_docs`` - Should the Sphinx based documentation be included in your repo? If so, enter ``y`` or ``yes`` to include the setup.py. For Adafruit libraries this defaults to Yes.
|
||||
* ``default_branch`` - What is the default branch used in your Githiub repos? Choice of Master or Main. For Adafruit libraries this defaults to Master.
|
||||
|
||||
|
||||
Post Generation Cleanup
|
||||
------------------------
|
||||
|
||||
After generation, make sure to glance over the files to make sure they
|
||||
autogenerated as you expect (such as capitalization). There are a few places
|
||||
with ``.. todo::`` that should also be taken care of. After adding or updating
|
||||
the information requested, make sure the ``.. todo::`` text is removed. Like this:
|
||||
|
||||
.. code::
|
||||
|
||||
# Before Cleanup
|
||||
.. todo:: Describe what the module does
|
||||
|
||||
.. code::
|
||||
|
||||
# After Cleanup
|
||||
This library talks to the AM4Z-1NG sensor. Typical use is for robot friends.
|
||||
|
||||
Windows Users
|
||||
==============
|
||||
|
||||
Due to the development nature of cookiecutter, there are some limitations when using with Windows.
|
||||
|
||||
Cookiecutter Installation
|
||||
--------------------------
|
||||
|
||||
The Python enviornment can be tricky sometimes in Windows. Use this documentation page for steps and tips on Windows installation: `Cookiecutter Installation - Windows <https://cookiecutter.readthedocs.io/en/latest/installation.html#windows>`_
|
||||
|
||||
|
||||
<library>.py & /examples/<library>_simpletest.py File Generation
|
||||
------------------------------------------------------------------
|
||||
|
||||
Cookiecutter was developed for use in \*\nix/OSX enviornments. When implementing prompt based configuration for things like filenames, special characters were used for programmatic detection and formatting.
|
||||
|
||||
.. code-block::
|
||||
|
||||
{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower }}.py
|
||||
|
||||
As such, Windows will block the use of these special characters in filenames. So when cookiecutter pulls the Adafruit CircuitPython template, the <library>.py and /examples/<library>_simpletest.py files are not created. This adds an extra step. Simply copy an existing library's .py files (and structure if making a "package"), and change the prompted values (e.g. author name, library name, documentation information, etc).
|
||||
|
||||
.. note::
|
||||
The above is from experience with using cookiecutter within a Windows native setup. This may not be applicable when using Windows Subsystem for Linux (WSL) or any *nix-For-Windows utilities.
|
||||
|
||||
We are always exploring ways to make things easier, so this workflow may change. Also, ideas and solutions are always welcome!
|
||||
Introduction
|
||||
============
|
||||
|
||||
.. image :: https://img.shields.io/discord/327254708534116352.svg
|
||||
:target: https://adafru.it/discord
|
||||
:alt: Discord
|
||||
|
||||
This cookiecutter creates a project structure for an Adafruit CircuitPython library.
|
||||
|
||||
See this Adafruit Learn Guide for an explanation of creating a CircuitPython library: `Creating and sharing a CircuitPython library <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/overview>`_ The section for using cookiecutter is `here <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/creating-a-library#cookie-cutter>`_.
|
||||
|
||||
.. note::
|
||||
|
||||
The above Learn Guide is directed towards creating a library for the Community Bundle. For libraries meant for the Adafruit Bundle, contact the CircuitPython Helpers (@circuitpython helpers) on Discord or put in a new issue on the Adafruit_CircuitPython_Bundle GitHub repository.
|
||||
|
||||
Cookiecutter Usage
|
||||
===================
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# The first time
|
||||
pip install cookiecutter@https://github.com/cookiecutter/cookiecutter/archive/2.0.2.zip
|
||||
|
||||
cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
|
||||
|
||||
Then, fill in the prompts and accomplish some post generation cleanup:
|
||||
|
||||
Prompts
|
||||
--------
|
||||
|
||||
* ``target_bundle`` - Adafruit bundle or Community library bundle
|
||||
* ``github_user`` - GitHub user or organization which will host this repo. For example, Adafruit funded libraries should say "adafruit" here.
|
||||
* ``author_name`` - Who you are! Sets the copyright to you.
|
||||
* ``company`` - Used to give Copyright credit to the company funding the library. For example, Adafruit funded libraries should say "Adafruit Industries" here.
|
||||
* ``library_name`` - Shortest name for the library. Usually a chip name such as LIS3DH.
|
||||
* ``library_description`` - Write a sentence describing the purpose of this library (e.g. ``CircuitPython helper library for the DC & Stepper Motor FeatherWing, Shield and Pi Hat kits.``).
|
||||
* ``library_keywords`` - Used to populate keywords for PyPi. Enter a string of keywords (e.g ``dht temp humidity``) NOTE: The following are included by default: ``adafruit``, ``blinka``, ``circuitpython``, ``micropython``, and the ``library_name`` you enter.
|
||||
* ``library_prefix`` - Used to prefix the code to the organization creating the library. For example, Adafruit supported libraries should say "adafruit" here. Do not add a - or _.
|
||||
* ``adafruit_product_id`` - The product ID for the Adafruit product includes a link to the product in the README. Only applies to Adafruit Bundle.
|
||||
* ``requires_bus_device`` - Determines whether to add comments about a dependency on `BusDevice <https://github.com/adafruit/Adafruit_CircuitPython_BusDevice>`_.
|
||||
If the library uses BusDevice, enter ``y`` or ``yes`` to include. If the library doesn't use BusDevice, all other entries including empty, will not include BusDevice.
|
||||
* ``requires_register`` - Determines whether to add comments about a dependency on `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_.
|
||||
If the library uses Register, enter ``y`` or ``yes`` to include. If the library doesn't use Register, all other entries including empty, will not include Register.
|
||||
* ``other_requirements`` - Adds any other module dependencies for PyPi. Enter a comma separated string of modules
|
||||
(e.g. ``adafruit-circuitpython-pca9685, adafruit-circuitpython-motor``). NOTE: ``Adafruit-Blinka`` is always included, so no need to include it here.
|
||||
* ``pypi_release`` - Will this library be releaased on PyPI? If so, enter ``y`` or ``yes`` to include the setup.py. For Adafruit libraries this defaults to Yes.
|
||||
* ``sphinx_docs`` - Should the Sphinx based documentation be included in your repo? If so, enter ``y`` or ``yes`` to include the setup.py. For Adafruit libraries this defaults to Yes.
|
||||
|
||||
|
||||
Post Generation Cleanup
|
||||
------------------------
|
||||
|
||||
After generation, make sure to glance over the files to make sure they
|
||||
autogenerated as you expect (such as capitalization). There are a few places
|
||||
with ``.. todo::`` that should also be taken care of. After adding or updating
|
||||
the information requested, make sure the ``.. todo::`` text is removed. Like this:
|
||||
|
||||
.. code::
|
||||
|
||||
# Before Cleanup
|
||||
.. todo:: Describe what the module does
|
||||
|
||||
.. code::
|
||||
|
||||
# After Cleanup
|
||||
This library talks to the AM4Z-1NG sensor. Typical use is for robot friends.
|
||||
|
||||
Windows Users
|
||||
==============
|
||||
|
||||
Due to the development nature of cookiecutter, there are some limitations when using with Windows.
|
||||
|
||||
Cookiecutter Installation
|
||||
--------------------------
|
||||
|
||||
The Python enviornment can be tricky sometimes in Windows. Use this documentation page for steps and tips on Windows installation: `Cookiecutter Installation - Windows <https://cookiecutter.readthedocs.io/en/latest/installation.html#windows>`_
|
||||
|
||||
|
||||
<library>.py & /examples/<library>_simpletest.py File Generation
|
||||
------------------------------------------------------------------
|
||||
|
||||
Cookiecutter was developed for use in \*\nix/OSX enviornments. When implementing prompt based configuration for things like filenames, special characters were used for programmatic detection and formatting.
|
||||
|
||||
.. code-block::
|
||||
|
||||
{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower }}.py
|
||||
|
||||
As such, Windows will block the use of these special characters in filenames. So when cookiecutter pulls the Adafruit CircuitPython template, the <library>.py and /examples/<library>_simpletest.py files are not created. This adds an extra step. Simply copy an existing library's .py files (and structure if making a "package"), and change the prompted values (e.g. author name, library name, documentation information, etc).
|
||||
|
||||
.. note::
|
||||
The above is from experience with using cookiecutter within a Windows native setup. This may not be applicable when using Windows Subsystem for Linux (WSL) or any *nix-For-Windows utilities.
|
||||
|
||||
We are always exploring ways to make things easier, so this workflow may change. Also, ideas and solutions are always welcome!
|
||||
|
|
|
|||
4
conf.py
4
conf.py
|
|
@ -356,5 +356,5 @@ texinfo_documents = [
|
|||
#
|
||||
# texinfo_no_detailmenu = False
|
||||
|
||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
|
||||
'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
||||
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
|
||||
'CircuitPython': ('https://docs.circuitpython.org/en/latest/', None)}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,26 @@
|
|||
{
|
||||
"target_bundle": [
|
||||
"Adafruit",
|
||||
"Community"
|
||||
"Community",
|
||||
"CircuitPython Org",
|
||||
"test"
|
||||
],
|
||||
"github_user": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} adafruit {%- endif -%}",
|
||||
"github_user": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} adafruit {%- elif cookiecutter.target_bundle == 'CircuitPython Org' -%} circuitpython {%- endif -%}",
|
||||
"author_name": null,
|
||||
"company": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} Adafruit Industries {%- endif -%}",
|
||||
"company": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} Adafruit Industries {%- elif cookiecutter.target_bundle == 'CircuitPython Org' -%} CircuitPython Organization{%- endif -%}",
|
||||
"library_name": null,
|
||||
"library_description": "",
|
||||
"library_keywords": "",
|
||||
"library_prefix": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} adafruit {%- endif -%}",
|
||||
"adafruit_pid": "",
|
||||
"adafruit_product_id": "",
|
||||
"requires_bus_device": "",
|
||||
"requires_register": "",
|
||||
"other_requirements": "",
|
||||
"pypi_release": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} yes {%- else -%} no {%- endif -%}",
|
||||
"sphinx_docs": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} yes {%- else -%} no {%- endif -%}",
|
||||
"default_branch": ["master", "main"],
|
||||
"pypi_release": "{%- if cookiecutter.target_bundle == 'Adafruit' or cookiecutter.target_bundle == 'CircuitPython Org' -%} yes {%- else -%} no {%- endif -%}",
|
||||
"sphinx_docs": "{%- if cookiecutter.target_bundle == 'Adafruit' or cookiecutter.target_bundle == 'CircuitPython Org' -%} yes {%- else -%} no {%- endif -%}",
|
||||
"_extensions": ["jinja2.ext.do"],
|
||||
"_copy_without_render": ["*.github/*"]
|
||||
"_copy_without_render": ["*.github/*"],
|
||||
"__dirname": "{% if cookiecutter.target_bundle != 'CircuitPython Org' %}{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_CircuitPython{% else %}CircuitPython{% endif %}_{{ cookiecutter.library_name|replace(' ', '_')}}{% else %}CircuitPython_Org_{{ cookiecutter.library_name|replace(' ', '_')}}{% endif %}",
|
||||
"__libname": "{{ cookiecutter.library_name | lower | replace(' ', '_') }}",
|
||||
"__libprefix": "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace(' ', '_') }}_{% endif %}"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2021 Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Hooks that run before the template is rendered.
|
||||
"""
|
||||
import pathlib
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
|
||||
base_folder = pathlib.PosixPath().resolve()
|
||||
docs_dir = base_folder / "docs"
|
||||
sphinx_docs = "{{cookiecutter.sphinx_docs}}"
|
||||
|
||||
if sphinx_docs.lower() in ["n", "no"]:
|
||||
"""
|
||||
Remove the Docs folder if the user doesn't want docs.
|
||||
"""
|
||||
try:
|
||||
shutil.rmtree(docs_dir)
|
||||
except OSError as e:
|
||||
print("Error: %s : %s" % (docs_dir, e.strerror))
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2021 Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""
|
||||
Hooks that run before the template is rendered.
|
||||
"""
|
||||
|
||||
import sys
|
||||
|
||||
github_user = '{{cookiecutter.github_user}}'
|
||||
|
||||
if github_user in ["", None]:
|
||||
print("ERROR: github_user is a required field.")
|
||||
# exits with status 1 to indicate failure
|
||||
sys.exit(1)
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
import shutil
|
||||
import sys
|
||||
|
|
@ -10,10 +11,6 @@ import sys
|
|||
from cookiecutter.main import cookiecutter
|
||||
|
||||
|
||||
# only verified on linux and MacOS
|
||||
if not (sys.platform.startswith('linux') or sys.platform.startswith('darwin')):
|
||||
raise RuntimeError('These tests are only verified to run on Linux and MacOS systems.')
|
||||
|
||||
working_dir = pathlib.Path()
|
||||
output_dir = working_dir / '.cookie_test'
|
||||
|
||||
|
|
@ -44,7 +41,7 @@ def compare_template_dirs(*, library_name='test', library_prefix=None):
|
|||
`library_prefix` prompt. Default: None
|
||||
"""
|
||||
|
||||
cookie_template_path = working_dir / '{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name}}'
|
||||
cookie_template_path = working_dir / "{{ cookiecutter.__dirname }}"
|
||||
if library_prefix:
|
||||
generated_folder_name = "{}_CircuitPython_{}".format(library_prefix, library_name)
|
||||
else:
|
||||
|
|
@ -86,10 +83,9 @@ def test_new_cookiecutter_only_required_entries():
|
|||
|
||||
test_context = {}
|
||||
for key, value in cookie_json.items():
|
||||
if value == None:
|
||||
test_context[key] = 'test'
|
||||
if key.startswith('_'):
|
||||
test_context[key] = value
|
||||
if not key.startswith('_'):
|
||||
if value == None:
|
||||
test_context[key] = 'test'
|
||||
|
||||
new_cookie = cookiecutter(
|
||||
str(working_dir.resolve()),
|
||||
|
|
@ -99,7 +95,7 @@ def test_new_cookiecutter_only_required_entries():
|
|||
extra_context=test_context
|
||||
)
|
||||
|
||||
assert new_cookie == '{}/Adafruit_CircuitPython_test'.format(output_dir.resolve())
|
||||
assert os.listdir(output_dir)[0] == 'Adafruit_CircuitPython_test'
|
||||
assert compare_template_dirs(library_prefix="Adafruit")
|
||||
|
||||
def test_new_cookiecutter_all_entries():
|
||||
|
|
@ -115,15 +111,11 @@ def test_new_cookiecutter_all_entries():
|
|||
for key, value in cookie_json.items():
|
||||
if not key.startswith('_'):
|
||||
if key == "target_bundle":
|
||||
test_context[key] = 'community'
|
||||
if key == "pypi_release":
|
||||
test_context[key] = 'Community'
|
||||
elif key == "pypi_release":
|
||||
test_context[key] = 'yes'
|
||||
if key == "default_branch":
|
||||
test_context[key] = 'master'
|
||||
else:
|
||||
test_context[key] = 'test'
|
||||
else:
|
||||
test_context[key] = value
|
||||
|
||||
new_cookie = cookiecutter(
|
||||
str(working_dir.resolve()),
|
||||
|
|
@ -133,5 +125,5 @@ def test_new_cookiecutter_all_entries():
|
|||
extra_context=test_context
|
||||
)
|
||||
|
||||
assert new_cookie == '{}/Test_CircuitPython_test'.format(output_dir.resolve())
|
||||
assert os.listdir(output_dir)[0] == 'Test_CircuitPython_test'
|
||||
assert compare_template_dirs(library_prefix='Test')
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
cookiecutter
|
||||
cookiecutter >= 2.1.0
|
||||
pytest
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
*.mpy
|
||||
.idea
|
||||
__pycache__
|
||||
_build
|
||||
*.pyc
|
||||
.env
|
||||
.python-version
|
||||
build*/
|
||||
bundles
|
||||
*.DS_Store
|
||||
.eggs
|
||||
dist
|
||||
**/*.egg-info
|
||||
.vscode
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/python/black
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/fsfe/reuse-tool
|
||||
rev: v0.12.1
|
||||
hooks:
|
||||
- id: reuse
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v2.3.0
|
||||
hooks:
|
||||
- id: check-yaml
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- repo: https://github.com/pycqa/pylint
|
||||
rev: pylint-2.7.1
|
||||
hooks:
|
||||
- id: pylint
|
||||
name: pylint (library code)
|
||||
types: [python]
|
||||
exclude: "^(docs/|examples/|tests/|setup.py$)"
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pylint_examples
|
||||
name: pylint (examples code)
|
||||
description: Run pylint rules on "examples/*.py" files
|
||||
entry: /usr/bin/env bash -c
|
||||
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
|
||||
language: system
|
||||
- id: pylint_tests
|
||||
name: pylint (tests code)
|
||||
description: Run pylint rules on "tests/*.py" files
|
||||
entry: /usr/bin/env bash -c
|
||||
args: ['([[ ! -d "tests" ]] || for test in $(find . -path "./tests/*.py"); do pylint --disable=missing-docstring $test; done)']
|
||||
language: system
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
python:
|
||||
version: 3
|
||||
requirements_file: requirements.txt
|
||||
13
{{ cookiecutter.__dirname }}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md
vendored
Normal file
13
{{ cookiecutter.__dirname }}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# SPDX-FileCopyrightText: 2021 Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
Thank you for contributing! Before you submit a pull request, please read the following.
|
||||
|
||||
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html
|
||||
|
||||
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
|
||||
|
||||
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
|
||||
|
||||
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.
|
||||
|
|
@ -22,10 +22,10 @@ jobs:
|
|||
awk -F '\/' '{ print tolower($2) }' |
|
||||
tr '_' '-'
|
||||
)
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v1
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: "3.x"
|
||||
- name: Versions
|
||||
run: |
|
||||
python3 --version
|
||||
|
|
@ -42,9 +42,9 @@ jobs:
|
|||
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||
run: |
|
||||
source actions-ci/install.sh
|
||||
- name: Pip install pylint, Sphinx, pre-commit
|
||||
- name: Pip install Sphinx, pre-commit
|
||||
run: |
|
||||
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
|
||||
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
|
||||
- name: Library version
|
||||
run: git describe --dirty --always --tags
|
||||
- name: Setup problem matchers
|
||||
|
|
@ -59,7 +59,7 @@ jobs:
|
|||
with:
|
||||
name: bundles
|
||||
path: ${{ github.workspace }}/bundles/
|
||||
- name: Check For docs folder
|
||||
- name: Check for docs folder
|
||||
id: need-docs
|
||||
run: |
|
||||
echo ::set-output name=docs::$( find . -wholename './docs' )
|
||||
|
|
@ -24,10 +24,10 @@ jobs:
|
|||
awk -F '\/' '{ print tolower($2) }' |
|
||||
tr '_' '-'
|
||||
)
|
||||
- name: Set up Python 3.6
|
||||
uses: actions/setup-python@v1
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.6
|
||||
python-version: "3.x"
|
||||
- name: Versions
|
||||
run: |
|
||||
python3 --version
|
||||
|
|
@ -67,7 +67,7 @@ jobs:
|
|||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||
- name: Set up Python
|
||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||
uses: actions/setup-python@v1
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
|
|
@ -81,5 +81,8 @@ jobs:
|
|||
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
||||
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
||||
run: |
|
||||
for file in $(find -not -path "./.*" -not -path "./docs*" -name "*.py"); do
|
||||
sed -i -e "s/0.0.0-auto.0/${{github.event.release.tag_name}}/" $file;
|
||||
done;
|
||||
python setup.py sdist
|
||||
twine upload dist/*
|
||||
47
{{ cookiecutter.__dirname }}/.gitignore
vendored
Normal file
47
{{ cookiecutter.__dirname }}/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# 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 CircuitPython 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
|
||||
|
||||
# CircuitPython-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
|
||||
|
||||
# MacOS-specific files
|
||||
*.DS_Store
|
||||
|
||||
# IDE-specific files
|
||||
.idea
|
||||
.vscode
|
||||
*~
|
||||
42
{{ cookiecutter.__dirname }}/.pre-commit-config.yaml
Normal file
42
{{ cookiecutter.__dirname }}/.pre-commit-config.yaml
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/python/black
|
||||
rev: 22.3.0
|
||||
hooks:
|
||||
- id: black
|
||||
- repo: https://github.com/fsfe/reuse-tool
|
||||
rev: v0.14.0
|
||||
hooks:
|
||||
- id: reuse
|
||||
- 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.11.1
|
||||
hooks:
|
||||
- id: pylint
|
||||
name: pylint (library code)
|
||||
types: [python]
|
||||
args:
|
||||
- --disable=consider-using-f-string,duplicate-code
|
||||
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
|
||||
|
|
@ -55,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,bad-continuation,pointless-string-statement
|
||||
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,unspecified-encoding
|
||||
|
||||
# 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
|
||||
|
|
@ -1,25 +1,39 @@
|
|||
{% if cookiecutter.library_prefix -%}
|
||||
{% set prefix = cookiecutter.library_prefix | capitalize + "_" -%}
|
||||
{% else -%}
|
||||
{% set prefix = '' -%}
|
||||
{% endif -%}
|
||||
{% set repo_name = prefix + "CircuitPython_" + cookiecutter.library_name -%}
|
||||
{% set full_repo_name = cookiecutter.github_user + "/" + repo_name -%}
|
||||
{%- set pypi_name = cookiecutter.library_name|lower|replace("_", "-") -%}
|
||||
{%- if cookiecutter.target_bundle != 'CircuitPython Org' -%}
|
||||
{%- if cookiecutter.library_prefix -%}
|
||||
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
||||
{%- else -%}
|
||||
{%- set repo_name = 'CircuitPython_' -%}
|
||||
{%- endif -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- else -%}
|
||||
{%- set repo_name = 'CircuitPython_Org_' + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- endif -%}
|
||||
{%- set full_repo_name = cookiecutter.github_user + "/" + repo_name -%}
|
||||
{%- set pypi_name = cookiecutter.library_name|lower|replace("_", "-")|replace(" ", "-") -%}
|
||||
{%- if cookiecutter.target_bundle == 'Adafruit' -%}
|
||||
{%- set docs_url = 'https://docs.circuitpython.org/projects/' + cookiecutter.library_name | lower | replace(" ", "-") + '/en/latest/' -%}
|
||||
{%- else -%}
|
||||
{%- set docs_url = 'https://circuitpython-' + cookiecutter.library_name | lower | replace(" ", "-") | replace("_", "-") + '.readthedocs.io/' -%}
|
||||
{%- endif -%}
|
||||
Introduction
|
||||
============
|
||||
|
||||
{% if cookiecutter.sphinx_docs | lower in ["yes", "y"] %}
|
||||
.. image:: https://readthedocs.org/projects/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace("_", "-")}}-{% endif %}circuitpython-{{ cookiecutter.library_name | lower }}/badge/?version=latest
|
||||
.. image:: https://readthedocs.org/projects/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace("_", "-")}}-{% endif %}circuitpython-{{ cookiecutter.library_name | lower | replace(" ", "-") | replace("_", "-") }}/badge/?version=latest
|
||||
{%- if cookiecutter.target_bundle == 'Adafruit' %}
|
||||
:target: https://circuitpython.readthedocs.io/projects/{{ cookiecutter.library_name | lower }}/en/latest/
|
||||
:target: {{ docs_url }}
|
||||
{%- else %}
|
||||
:target: https://circuitpython-{{ cookiecutter.library_name | lower }}.readthedocs.io/
|
||||
:target: {{ docs_url }}
|
||||
{%- endif %}
|
||||
:alt: Documentation Status
|
||||
{% endif %}
|
||||
|
||||
{% if cookiecutter.target_bundle == 'Adafruit' -%}
|
||||
.. image:: https://github.com/adafruit/Adafruit_CircuitPython_Bundle/blob/main/badges/adafruit_discord.svg
|
||||
{%- else %}
|
||||
.. image:: https://img.shields.io/discord/327254708534116352.svg
|
||||
{%- endif %}
|
||||
:target: https://adafru.it/discord
|
||||
:alt: Discord
|
||||
|
||||
|
|
@ -62,12 +76,10 @@ or individual libraries can be installed using
|
|||
.. todo:: Describe the Adafruit product this library works with. For PCBs, you can also add the
|
||||
image from the assets folder in the PCB's GitHub repo.
|
||||
|
||||
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/{{cookiecutter.adafruit_pid}}>`_
|
||||
|
||||
|
||||
`Purchase one from the Adafruit shop <http://www.adafruit.com/products/{{cookiecutter.adafruit_product_id}}>`_
|
||||
{% endif -%}
|
||||
|
||||
{%- if cookiecutter.pypi_release in ["y", "yes"] -%}
|
||||
{%- if cookiecutter.pypi_release in ["y", "yes"] %}
|
||||
|
||||
Installing from PyPI
|
||||
=====================
|
||||
|
|
@ -77,18 +89,18 @@ Installing from PyPI
|
|||
.. todo:: Remove the above note if PyPI version is/will be available at time of release.
|
||||
|
||||
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
|
||||
PyPI <https://pypi.org/project/adafruit-circuitpython-{{ cookiecutter.library_name|lower }}/>`_.
|
||||
PyPI <https://pypi.org/project/{%- if cookiecutter.library_prefix -%}{{ cookiecutter.library_prefix }}-{%- endif -%}circuitpython-{{ pypi_name }}/>`_.
|
||||
To install for current user:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
pip3 install adafruit-circuitpython-{{ pypi_name }}
|
||||
pip3 install {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix }}-{% endif %}circuitpython-{{ pypi_name }}
|
||||
|
||||
To install system-wide (this may be required in some cases):
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
sudo pip3 install adafruit-circuitpython-{{ pypi_name }}
|
||||
sudo pip3 install {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix }}-{% endif %}circuitpython-{{ pypi_name }}
|
||||
|
||||
To install in a virtual environment in your current project:
|
||||
|
||||
|
|
@ -97,25 +109,49 @@ 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 adafruit-circuitpython-{{ pypi_name }}
|
||||
pip3 install {% if cookiecutter.library_prefix -%}{{ cookiecutter.library_prefix }}-{% endif -%}circuitpython-{{ pypi_name }}
|
||||
|
||||
{% endif %}
|
||||
|
||||
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 {{ cookiecutter.library_name | lower | replace(" ", "-") }}
|
||||
|
||||
Or the following command to update an existing version:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
circup update
|
||||
|
||||
Usage Example
|
||||
=============
|
||||
|
||||
.. todo:: Add a quick, simple example. It and other examples should live in the
|
||||
examples folder and be included in docs/examples.rst.
|
||||
|
||||
Documentation
|
||||
=============
|
||||
API documentation for this library can be found on `Read the Docs <{{ docs_url }}>`_.
|
||||
|
||||
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>`_.
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
Contributions are welcome! Please read our `Code of Conduct
|
||||
<https://github.com/{{ full_repo_name }}/blob/{{cookiecutter.default_branch}}/CODE_OF_CONDUCT.md>`_
|
||||
<https://github.com/{{ full_repo_name }}/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>`_.
|
||||
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
|
@ -4,5 +4,5 @@
|
|||
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
|
||||
.. use this format as the module name: "adafruit_foo.foo"
|
||||
|
||||
.. automodule:: {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower }}
|
||||
.. automodule:: {% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower | replace(" ", "_") }}
|
||||
:members:
|
||||
|
|
@ -29,14 +29,14 @@ extensions = [
|
|||
|
||||
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3.4", None),
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
{%- if cookiecutter.requires_bus_device in ["y", "yes"] -%}
|
||||
"BusDevice": ("https://circuitpython.readthedocs.io/projects/busdevice/en/latest/", None),
|
||||
"BusDevice": ("https://docs.circuitpython.org/projects/busdevice/en/latest/", None),
|
||||
{% endif %}
|
||||
{%- if cookiecutter.requires_register in ["y", "yes"] -%}
|
||||
"Register": ("https://circuitpython.readthedocs.io/projects/register/en/latest/", None),
|
||||
"Register": ("https://docs.circuitpython.org/projects/register/en/latest/", None),
|
||||
{%- endif %}
|
||||
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
|
||||
}
|
||||
|
||||
# Show the docstring from both the class and its __init__() method.
|
||||
|
|
@ -51,7 +51,7 @@ source_suffix = ".rst"
|
|||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %} CircuitPython {{ cookiecutter.library_name }} Library"
|
||||
project = "{% if cookiecutter.target_bundle != 'CircuitPython Org' %}{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}{% endif %}CircuitPython {{ cookiecutter.library_name }} Library"
|
||||
copyright = "{% now 'utc', '%Y' %} {{ cookiecutter.author_name }}"
|
||||
author = "{{ cookiecutter.author_name }}"
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ release = "1.0"
|
|||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = None
|
||||
language = "en"
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
|
|
@ -133,7 +133,7 @@ html_static_path = ["_static"]
|
|||
html_favicon = "_static/favicon.ico"
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | capitalize }}Librarydoc"
|
||||
htmlhelp_basename = "{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | capitalize | replace(' ', '_')}}_Librarydoc"
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ latex_elements = {
|
|||
latex_documents = [
|
||||
(
|
||||
master_doc,
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}Library.tex",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | replace(' ', '_')}}_Library.tex",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||
author,
|
||||
"manual",
|
||||
|
|
@ -168,7 +168,7 @@ latex_documents = [
|
|||
man_pages = [
|
||||
(
|
||||
master_doc,
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}Library",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | replace(' ', '_')}}_Library",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||
[author],
|
||||
1,
|
||||
|
|
@ -183,10 +183,10 @@ man_pages = [
|
|||
texinfo_documents = [
|
||||
(
|
||||
master_doc,
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}Library",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | replace(' ', '_') }}_Library",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||
author,
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}Library",
|
||||
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }}_{% endif %}CircuitPython_{{ cookiecutter.library_name | replace(' ', '_')}}_Library",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
),
|
||||
|
|
@ -3,6 +3,6 @@ Simple test
|
|||
|
||||
Ensure your device works with this simple test.
|
||||
|
||||
.. literalinclude:: ../examples/{{ cookiecutter.library_name | lower }}_simpletest.py
|
||||
:caption: examples/{{ cookiecutter.library_name | lower }}_simpletest.py
|
||||
.. literalinclude:: ../examples/{{ cookiecutter.library_name | lower | replace(" ", "_") }}_simpletest.py
|
||||
:caption: examples/{{ cookiecutter.library_name | lower | replace(" ", "_") }}_simpletest.py
|
||||
:linenos:
|
||||
|
|
@ -36,8 +36,9 @@ Table of Contents
|
|||
.. toctree::
|
||||
:caption: Other Links
|
||||
|
||||
Download <https://github.com/{{ cookiecutter.github_user }}/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize}}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}/releases/latest>
|
||||
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
|
||||
Download from GitHub <https://github.com/{{ cookiecutter.github_user }}/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize}}_{% endif %}CircuitPython_{{ cookiecutter.library_name | replace(" ", "_") }}/releases/latest>
|
||||
Download Library Bundle <https://circuitpython.org/libraries>
|
||||
CircuitPython Reference Documentation <https://docs.circuitpython.org>
|
||||
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
|
||||
Discord Chat <https://adafru.it/discord>
|
||||
Adafruit Learning System <https://learn.adafruit.com>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
sphinx>=4.0.0
|
||||
|
|
@ -17,19 +17,24 @@
|
|||
{%- endif -%}
|
||||
{# put keywords into an iterable list, based on word wrapping #}
|
||||
{%- set kw_list = namespace(kw_list=[], default=["adafruit", "blinka", "circuitpython", "micropython"]) -%}
|
||||
{%- do kw_list.default.append(cookiecutter.library_name|lower) -%}
|
||||
{%- do kw_list.default.append(cookiecutter.library_name|lower|replace(" ", "-")) -%}
|
||||
{%- do kw_list.default.extend(cookiecutter.library_keywords.split(" ")) -%}
|
||||
{%- set wrapped = kw_list.default|unique|join(" ")|wordwrap(break_long_words=False) -%}
|
||||
{%- do kw_list.kw_list.extend(wrapped.split("\n")) -%}
|
||||
{# create repo and pypi names #}
|
||||
{%- if cookiecutter.library_prefix -%}
|
||||
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name -%}
|
||||
{%- if cookiecutter.target_bundle != 'CircuitPython Org' -%}
|
||||
{%- if cookiecutter.library_prefix -%}
|
||||
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- else -%}
|
||||
{%- set repo_name = 'CircuitPython_' -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- endif -%}
|
||||
{%- else -%}
|
||||
{%- set repo_name = 'CircuitPython_' + cookiecutter.library_name -%}
|
||||
{%- set repo_name = 'CircuitPython_Org_' + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- endif -%}
|
||||
{%- set pypi_name = repo_name|lower|replace("_", "-") -%}
|
||||
{%- set pypi_name = repo_name|lower|replace("_", "-")|replace(" ", "-")|replace("circuitpython-org-", "circuitpython-") -%}
|
||||
"""A setuptools based setup module.
|
||||
|
||||
See:
|
||||
|
|
@ -50,10 +55,13 @@ with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
|||
long_description = f.read()
|
||||
|
||||
setup(
|
||||
{% if cookiecutter.target_bundle == 'Adafruit' -%}
|
||||
# Adafruit Bundle Information
|
||||
# {{ cookiecutter.target_bundle }} Bundle Information
|
||||
name="{{ pypi_name }}",
|
||||
use_scm_version=True,
|
||||
use_scm_version={
|
||||
# This is needed for the PyPI version munging in the Github Actions release.yml
|
||||
"git_describe_command": "git describe --tags --long",
|
||||
"local_scheme": "no-local-version",
|
||||
},
|
||||
setup_requires=["setuptools_scm"],
|
||||
description="{{ cookiecutter.library_description }}",
|
||||
long_description=long_description,
|
||||
|
|
@ -61,21 +69,12 @@ setup(
|
|||
# The project's main homepage.
|
||||
url="https://github.com/{{ cookiecutter.github_user }}/{{ repo_name }}.git",
|
||||
# Author details
|
||||
{% if cookiecutter.target_bundle == 'Adafruit' -%}
|
||||
author="Adafruit Industries",
|
||||
author_email="circuitpython@adafruit.com",
|
||||
{%- else -%}
|
||||
# Community Bundle Information
|
||||
name="{{ pypi_name }}",
|
||||
use_scm_version=True,
|
||||
setup_requires=["setuptools_scm"],
|
||||
description="{{ cookiecutter.library_description }}",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/x-rst",
|
||||
# The project's main homepage.
|
||||
url="https://github.com/{{ cookiecutter.github_user }}/{{ repo_name }}.git",
|
||||
# Author details
|
||||
author="{{ cookiecutter.author_name }}",
|
||||
author_email="",
|
||||
author_email="", # TODO: Add your email here
|
||||
{%- endif %}
|
||||
install_requires=[
|
||||
"{{ req_list.items|sort|unique|join('",\n"')|indent(width=8) }}",
|
||||
|
|
@ -90,14 +89,13 @@ setup(
|
|||
"Topic :: System :: Hardware",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.4",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
],
|
||||
# What does your project relate to?
|
||||
keywords="{{ kw_list.kw_list|sort|unique|join(' "\n"')|indent(width=13) }}",
|
||||
|
||||
# You can just specify the packages manually here if your project is
|
||||
# simple. Or you can use find_packages().
|
||||
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
|
||||
# CHANGE `py_modules=['...']` TO `packages=['...']`
|
||||
py_modules=["{%- if cookiecutter.library_prefix != '' -%}{{ cookiecutter.library_prefix|lower }}_{%- endif -%}{{- cookiecutter.library_name|lower -}}"],
|
||||
py_modules=["{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace(" ", "_") }}_{% endif %}{{ cookiecutter.library_name | lower | replace(" ", "_") }}"],
|
||||
)
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
|
||||
#
|
||||
# SPDX-License-Identifier: Unlicense
|
||||
|
||||
# Read the Docs configuration file
|
||||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||
|
||||
# Required
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-20.04
|
||||
tools:
|
||||
python: "3"
|
||||
|
||||
python:
|
||||
install:
|
||||
- requirements: docs/requirements.txt
|
||||
- requirements: requirements.txt
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
|
||||
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
|
||||
SPDX-FileCopyrightText: 2019-2021 Kattni Rembor for Adafruit Industries
|
||||
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
-->
|
||||
|
|
@ -39,6 +39,8 @@ Examples of unacceptable behavior by participants include:
|
|||
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||
asked
|
||||
* Discussion or promotion of activities or projects that intend or pose a risk of
|
||||
significant harm
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
||||
a person, group, organisation, project, or community
|
||||
|
|
@ -77,35 +79,40 @@ involving other community members.
|
|||
|
||||
You may report in the following ways:
|
||||
|
||||
In any situation, you may send an email to <support@adafruit.com>.
|
||||
In any situation, you may email <support@adafruit.com>.
|
||||
|
||||
On the Adafruit Discord, you may send an open message from any channel
|
||||
to all Community Moderators by tagging @community moderators. You may
|
||||
also send an open message from any channel, or a direct message to
|
||||
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
|
||||
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
||||
any Community Moderator.
|
||||
|
||||
Email and direct message reports will be kept confidential.
|
||||
|
||||
In situations on Discord where the issue is particularly egregious, possibly
|
||||
In situations on Discord where the issue is particularly offensive, possibly
|
||||
illegal, requires immediate action, or violates the Discord terms of service,
|
||||
you should also report the message directly to Discord.
|
||||
you should also report the message directly to [Discord](https://discord.com/safety).
|
||||
|
||||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is an egregious violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
CircuitPython Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is a severe violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
6. Disciplinary actions (warnings, bans, etc) for Code of Conduct violations apply
|
||||
to the platform where the violation occurred. However, depending on the severity
|
||||
of the violation, the disciplinary action may be applied across Adafruit's other
|
||||
community platforms. For example, a severe violation on the Adafruit Discord
|
||||
server may result in a ban on not only the Adafruit Discord server, but also on
|
||||
the Adafruit GitHub organisation, Adafruit Forums, Adafruit Twitter, etc.
|
||||
|
||||
## Scope
|
||||
|
||||
|
|
@ -123,9 +130,8 @@ accordingly.
|
|||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant],
|
||||
version 1.4, available at
|
||||
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
|
||||
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
|
||||
version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html),
|
||||
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||
|
||||
For other projects adopting the Adafruit Community Code of
|
||||
|
|
@ -133,5 +139,3 @@ Conduct, please contact the maintainers of those projects for enforcement.
|
|||
If you wish to use this code of conduct for your own project, consider
|
||||
explicitly mentioning your moderation policy or making a copy with your
|
||||
own moderation policy so as to avoid confusion.
|
||||
|
||||
[Contributor Covenant]: https://www.contributor-covenant.org
|
||||
|
|
@ -0,0 +1,138 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
|
||||
SPDX-FileCopyrightText: 2019-2021 Kattni Rembor
|
||||
|
||||
SPDX-License-Identifier: CC-BY-4.0
|
||||
-->
|
||||
# CircuitPython Community Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and leaders pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, gender identity and expression, level or type of
|
||||
experience, education, socio-economic status, nationality, personal appearance,
|
||||
race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
We are committed to providing a friendly, safe and welcoming environment for
|
||||
all.
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Be kind and courteous to others
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Collaborating with other community members
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and sexual attention or advances
|
||||
* The use of inappropriate images, including in a community member's avatar
|
||||
* The use of inappropriate language, including in a community member's nickname
|
||||
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||
asked
|
||||
* Discussion or promotion of activities or projects that intend or pose a risk of
|
||||
significant harm
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
||||
a person, group, organisation, project, or community
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate
|
||||
|
||||
The goal of the standards and moderation guidelines outlined here is to build
|
||||
and maintain a respectful community. We ask that you don’t just aim to be
|
||||
"technically unimpeachable", but rather try to be your best self.
|
||||
|
||||
We value many things beyond technical expertise, including collaboration and
|
||||
supporting others within our community. Providing a positive experience for
|
||||
other community members can have a much more significant impact than simply
|
||||
providing the correct answer.
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project leaders are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project leaders have the right and responsibility to remove, edit, or
|
||||
reject messages, comments, commits, code, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any community member for other behaviors that they deem
|
||||
inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Moderation
|
||||
|
||||
Instances of behaviors that violate the CircuitPython Community Code of Conduct
|
||||
may be reported by any member of the community. Community members are
|
||||
encouraged to report these situations, including situations they witness
|
||||
involving other community members.
|
||||
|
||||
You may report in the following ways:
|
||||
|
||||
In any situation, you may email the project maintainer.
|
||||
|
||||
Email reports will be kept confidential.
|
||||
|
||||
In situations on GitHub where the issue is particularly offensive, possibly
|
||||
illegal, requires immediate action, or violates the GitHub terms of service,
|
||||
you should also report the message directly to GitHub via the comment, or via
|
||||
[GitHub Support](https://support.github.com/contact/report-abuse?category=report-abuse&report=other&report_type=unspecified).
|
||||
|
||||
These are the steps for upholding our community’s standards of conduct.
|
||||
|
||||
1. Any member of the community may report any situation that violates the
|
||||
CircuitPython Community Code of Conduct. All reports will be reviewed and
|
||||
investigated.
|
||||
2. If the behavior is a severe violation, the community member who
|
||||
committed the violation may be banned immediately, without warning.
|
||||
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
||||
be given another chance, if they are receptive to the warning and change their
|
||||
behavior.
|
||||
5. If the community member is unreceptive or unreasonable when warned by a
|
||||
moderator, or the warning goes unheeded, they may be banned for a first or
|
||||
second offense. Repeated offenses will result in the community member being
|
||||
banned.
|
||||
6. Disciplinary actions (warnings, bans, etc) for Code of Conduct violations apply
|
||||
to the platform where the violation occurred. However, depending on the severity
|
||||
of the violation, the disciplinary action may be applied across CircuitPython's
|
||||
other community platforms. For example, a severe violation in one Community forum
|
||||
may result in a ban on not only the CircuitPython GitHub organisation,
|
||||
but also on the CircuitPython Twitter, live stream text chats, etc.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct and the enforcement policies listed above apply to all
|
||||
CircuitPython Community venues. This includes but is not limited to any community
|
||||
spaces (both public and private), and CircuitPython repositories. Examples of
|
||||
CircuitPython Community spaces include but are not limited to meet-ups, issue
|
||||
threads on GitHub, text chats during a live stream, or interaction at a conference.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. As a community
|
||||
member, you are representing our community, and are expected to behave
|
||||
accordingly.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the
|
||||
[Adafruit Community Code of Conduct](https://github.com/adafruit/Adafruit_Community_Code_of_Conduct),
|
||||
which is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
|
||||
version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html),
|
||||
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||
|
||||
For other projects adopting the CircuitPython Community Code of
|
||||
Conduct, please contact the maintainers of those projects for enforcement.
|
||||
If you wish to use this code of conduct for your own project, consider
|
||||
explicitly mentioning your moderation policy or making a copy with your
|
||||
own moderation policy so as to avoid confusion.
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
"""
|
||||
`{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower }}_{% endif %}{{ cookiecutter.library_name | lower }}`
|
||||
`{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | lower | replace(" ", "_") }}_{% endif %}{{ cookiecutter.library_name | lower | replace(" ", "_") }}`
|
||||
================================================================================
|
||||
|
||||
{% if cookiecutter.library_description != "" %}
|
||||
|
|
@ -25,7 +25,7 @@ Implementation Notes
|
|||
**Software and Dependencies:**
|
||||
|
||||
* Adafruit CircuitPython firmware for the supported boards:
|
||||
https://github.com/adafruit/circuitpython/releases
|
||||
https://circuitpython.org/downloads
|
||||
|
||||
.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies
|
||||
based on the library's use of either.
|
||||
|
|
@ -36,5 +36,18 @@ Implementation Notes
|
|||
|
||||
# imports
|
||||
|
||||
{% if cookiecutter.target_bundle != 'CircuitPython Org' -%}
|
||||
{%- if cookiecutter.library_prefix -%}
|
||||
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- else -%}
|
||||
{%- set repo_name = 'CircuitPython_' -%}
|
||||
{%- set repo_name = repo_name + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{%- endif -%}
|
||||
{% else -%}
|
||||
{%- set repo_name = 'CircuitPython_Org_' + cookiecutter.library_name | replace(" ", "_") -%}
|
||||
{% endif -%}
|
||||
|
||||
__version__ = "0.0.0-auto.0"
|
||||
__repo__ = "https://github.com/{{ cookiecutter.github_user }}/{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize}}_{% endif %}CircuitPython_{{ cookiecutter.library_name }}.git"
|
||||
__repo__ = "https://github.com/{{ cookiecutter.github_user }}/{{ repo_name }}.git"
|
||||
Loading…
Reference in a new issue