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
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/setup-python@v1
|
- uses: actions/setup-python@v2
|
||||||
- name: set PY
|
- name: set PY
|
||||||
run: echo >>$GITHUB_ENV "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
|
run: echo >>$GITHUB_ENV "PY=$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')"
|
||||||
- uses: actions/cache@v1
|
- 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:
|
jobs:
|
||||||
test:
|
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:
|
steps:
|
||||||
- name: Dump GitHub context
|
- name: Dump GitHub context
|
||||||
env:
|
env:
|
||||||
GITHUB_CONTEXT: ${{ toJson(github) }}
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
||||||
run: echo "$GITHUB_CONTEXT"
|
run: echo "$GITHUB_CONTEXT"
|
||||||
- name: Set up Python 3.6
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.6
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Versions
|
- name: Versions
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
|
|
@ -28,7 +39,7 @@ jobs:
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip
|
||||||
pip install -r $GITHUB_WORKSPACE/tests_requirements.txt
|
pip install -r tests_requirements.txt
|
||||||
- name: Run cookiecutter tests
|
- name: Run cookiecutter tests
|
||||||
run: |
|
run: |
|
||||||
pytest -v
|
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
|
# cookiecutter-specific files
|
||||||
.env
|
.cookie_test/
|
||||||
.python-version
|
.pytest*
|
||||||
|
|
||||||
|
# CircuitPython-specific files
|
||||||
|
*.mpy
|
||||||
|
|
||||||
|
# Python-specific files
|
||||||
|
__pycache__
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
||||||
.pytest*
|
# Sphinx build-specific files
|
||||||
__pycache__
|
_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
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/fsfe/reuse-tool
|
- repo: https://github.com/fsfe/reuse-tool
|
||||||
rev: v0.12.1
|
rev: v0.14.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: reuse
|
- id: reuse
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.3.0
|
rev: v4.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- 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
|
On the Adafruit Discord, you may send an open message from any channel
|
||||||
to all Community Moderators by tagging @community moderators. You may
|
to all Community Moderators by tagging @community moderators. You may
|
||||||
also send an open message from any channel, or a direct message to
|
also send an open message from any channel, or a direct message to
|
||||||
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
|
any Community Moderator.
|
||||||
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
|
||||||
|
|
||||||
Email and direct message reports will be kept confidential.
|
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.
|
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
|
1. Any member of the community may report any situation that violates the
|
||||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
Adafruit Community Code of Conduct. All reports will be reviewed and
|
||||||
investigated.
|
investigated.
|
||||||
2. If the behavior is an egregious violation, the community member who
|
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.
|
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
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
|
be given another chance, if they are receptive to the warning and change their
|
||||||
behavior.
|
behavior.
|
||||||
5. If the community member is unreceptive or unreasonable when warned by a
|
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
|
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
|
second offense. Repeated offenses will result in the community member being
|
||||||
banned.
|
banned.
|
||||||
|
|
||||||
## Scope
|
## Scope
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ Introduction
|
||||||
:target: https://adafru.it/discord
|
:target: https://adafru.it/discord
|
||||||
:alt: Discord
|
:alt: Discord
|
||||||
|
|
||||||
This cookiecutter creates a project structure for a Adafruit CircuitPython
|
This cookiecutter creates a project structure for an Adafruit CircuitPython library.
|
||||||
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>`_.
|
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>`_.
|
||||||
|
|
||||||
|
|
@ -20,7 +19,7 @@ Cookiecutter Usage
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
# The first time
|
# The first time
|
||||||
pip install cookiecutter
|
pip install cookiecutter@https://github.com/cookiecutter/cookiecutter/archive/2.0.2.zip
|
||||||
|
|
||||||
cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
|
cookiecutter gh:adafruit/cookiecutter-adafruit-circuitpython
|
||||||
|
|
||||||
|
|
@ -37,7 +36,7 @@ Prompts
|
||||||
* ``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_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_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 _.
|
* ``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.
|
* ``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>`_.
|
* ``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.
|
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>`_.
|
* ``requires_register`` - Determines whether to add comments about a dependency on `Register <https://github.com/adafruit/Adafruit_CircuitPython_Register>`_.
|
||||||
|
|
@ -46,7 +45,6 @@ Prompts
|
||||||
(e.g. ``adafruit-circuitpython-pca9685, adafruit-circuitpython-motor``). NOTE: ``Adafruit-Blinka`` is always included, so no need to include it here.
|
(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.
|
* ``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.
|
* ``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
|
Post Generation Cleanup
|
||||||
|
|
|
||||||
4
conf.py
4
conf.py
|
|
@ -356,5 +356,5 @@ texinfo_documents = [
|
||||||
#
|
#
|
||||||
# texinfo_no_detailmenu = False
|
# texinfo_no_detailmenu = False
|
||||||
|
|
||||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),
|
intersphinx_mapping = {'python': ('https://docs.python.org/3', None),
|
||||||
'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
'CircuitPython': ('https://docs.circuitpython.org/en/latest/', None)}
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,26 @@
|
||||||
{
|
{
|
||||||
"target_bundle": [
|
"target_bundle": [
|
||||||
"Adafruit",
|
"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,
|
"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_name": null,
|
||||||
"library_description": "",
|
"library_description": "",
|
||||||
"library_keywords": "",
|
"library_keywords": "",
|
||||||
"library_prefix": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} adafruit {%- endif -%}",
|
"library_prefix": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} adafruit {%- endif -%}",
|
||||||
"adafruit_pid": "",
|
"adafruit_product_id": "",
|
||||||
"requires_bus_device": "",
|
"requires_bus_device": "",
|
||||||
"requires_register": "",
|
"requires_register": "",
|
||||||
"other_requirements": "",
|
"other_requirements": "",
|
||||||
"pypi_release": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} yes {%- else -%} no {%- endif -%}",
|
"pypi_release": "{%- if cookiecutter.target_bundle == 'Adafruit' or cookiecutter.target_bundle == 'CircuitPython Org' -%} yes {%- else -%} no {%- endif -%}",
|
||||||
"sphinx_docs": "{%- if cookiecutter.target_bundle == 'Adafruit' -%} yes {%- else -%} no {%- endif -%}",
|
"sphinx_docs": "{%- if cookiecutter.target_bundle == 'Adafruit' or cookiecutter.target_bundle == 'CircuitPython Org' -%} yes {%- else -%} no {%- endif -%}",
|
||||||
"default_branch": ["master", "main"],
|
|
||||||
"_extensions": ["jinja2.ext.do"],
|
"_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
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
@ -10,10 +11,6 @@ import sys
|
||||||
from cookiecutter.main import cookiecutter
|
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()
|
working_dir = pathlib.Path()
|
||||||
output_dir = working_dir / '.cookie_test'
|
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
|
`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:
|
if library_prefix:
|
||||||
generated_folder_name = "{}_CircuitPython_{}".format(library_prefix, library_name)
|
generated_folder_name = "{}_CircuitPython_{}".format(library_prefix, library_name)
|
||||||
else:
|
else:
|
||||||
|
|
@ -86,10 +83,9 @@ def test_new_cookiecutter_only_required_entries():
|
||||||
|
|
||||||
test_context = {}
|
test_context = {}
|
||||||
for key, value in cookie_json.items():
|
for key, value in cookie_json.items():
|
||||||
if value == None:
|
if not key.startswith('_'):
|
||||||
test_context[key] = 'test'
|
if value == None:
|
||||||
if key.startswith('_'):
|
test_context[key] = 'test'
|
||||||
test_context[key] = value
|
|
||||||
|
|
||||||
new_cookie = cookiecutter(
|
new_cookie = cookiecutter(
|
||||||
str(working_dir.resolve()),
|
str(working_dir.resolve()),
|
||||||
|
|
@ -99,7 +95,7 @@ def test_new_cookiecutter_only_required_entries():
|
||||||
extra_context=test_context
|
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")
|
assert compare_template_dirs(library_prefix="Adafruit")
|
||||||
|
|
||||||
def test_new_cookiecutter_all_entries():
|
def test_new_cookiecutter_all_entries():
|
||||||
|
|
@ -115,15 +111,11 @@ def test_new_cookiecutter_all_entries():
|
||||||
for key, value in cookie_json.items():
|
for key, value in cookie_json.items():
|
||||||
if not key.startswith('_'):
|
if not key.startswith('_'):
|
||||||
if key == "target_bundle":
|
if key == "target_bundle":
|
||||||
test_context[key] = 'community'
|
test_context[key] = 'Community'
|
||||||
if key == "pypi_release":
|
elif key == "pypi_release":
|
||||||
test_context[key] = 'yes'
|
test_context[key] = 'yes'
|
||||||
if key == "default_branch":
|
|
||||||
test_context[key] = 'master'
|
|
||||||
else:
|
else:
|
||||||
test_context[key] = 'test'
|
test_context[key] = 'test'
|
||||||
else:
|
|
||||||
test_context[key] = value
|
|
||||||
|
|
||||||
new_cookie = cookiecutter(
|
new_cookie = cookiecutter(
|
||||||
str(working_dir.resolve()),
|
str(working_dir.resolve()),
|
||||||
|
|
@ -133,5 +125,5 @@ def test_new_cookiecutter_all_entries():
|
||||||
extra_context=test_context
|
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')
|
assert compare_template_dirs(library_prefix='Test')
|
||||||
|
|
|
||||||
|
|
@ -2,5 +2,5 @@
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Unlicense
|
# SPDX-License-Identifier: Unlicense
|
||||||
|
|
||||||
cookiecutter
|
cookiecutter >= 2.1.0
|
||||||
pytest
|
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) }' |
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
tr '_' '-'
|
tr '_' '-'
|
||||||
)
|
)
|
||||||
- name: Set up Python 3.6
|
- name: Set up Python 3.x
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.6
|
python-version: "3.x"
|
||||||
- name: Versions
|
- name: Versions
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
|
|
@ -42,9 +42,9 @@ jobs:
|
||||||
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||||
run: |
|
run: |
|
||||||
source actions-ci/install.sh
|
source actions-ci/install.sh
|
||||||
- name: Pip install pylint, Sphinx, pre-commit
|
- name: Pip install Sphinx, pre-commit
|
||||||
run: |
|
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
|
- name: Library version
|
||||||
run: git describe --dirty --always --tags
|
run: git describe --dirty --always --tags
|
||||||
- name: Setup problem matchers
|
- name: Setup problem matchers
|
||||||
|
|
@ -59,7 +59,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: bundles
|
name: bundles
|
||||||
path: ${{ github.workspace }}/bundles/
|
path: ${{ github.workspace }}/bundles/
|
||||||
- name: Check For docs folder
|
- name: Check for docs folder
|
||||||
id: need-docs
|
id: need-docs
|
||||||
run: |
|
run: |
|
||||||
echo ::set-output name=docs::$( find . -wholename './docs' )
|
echo ::set-output name=docs::$( find . -wholename './docs' )
|
||||||
|
|
@ -24,10 +24,10 @@ jobs:
|
||||||
awk -F '\/' '{ print tolower($2) }' |
|
awk -F '\/' '{ print tolower($2) }' |
|
||||||
tr '_' '-'
|
tr '_' '-'
|
||||||
)
|
)
|
||||||
- name: Set up Python 3.6
|
- name: Set up Python 3.x
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: 3.6
|
python-version: "3.x"
|
||||||
- name: Versions
|
- name: Versions
|
||||||
run: |
|
run: |
|
||||||
python3 --version
|
python3 --version
|
||||||
|
|
@ -67,7 +67,7 @@ jobs:
|
||||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
||||||
uses: actions/setup-python@v1
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: '3.x'
|
python-version: '3.x'
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
@ -81,5 +81,8 @@ jobs:
|
||||||
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
TWINE_USERNAME: ${{ secrets.pypi_username }}
|
||||||
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
TWINE_PASSWORD: ${{ secrets.pypi_password }}
|
||||||
run: |
|
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
|
python setup.py sdist
|
||||||
twine upload dist/*
|
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
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
# --disable=W"
|
# --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=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
|
# 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
|
# either give multiple identifier separated by comma (,) or put this option
|
||||||
|
|
@ -1,25 +1,39 @@
|
||||||
{% if cookiecutter.library_prefix -%}
|
{%- if cookiecutter.target_bundle != 'CircuitPython Org' -%}
|
||||||
{% set prefix = cookiecutter.library_prefix | capitalize + "_" -%}
|
{%- if cookiecutter.library_prefix -%}
|
||||||
{% else -%}
|
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||||
{% set prefix = '' -%}
|
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
||||||
{% endif -%}
|
{%- else -%}
|
||||||
{% set repo_name = prefix + "CircuitPython_" + cookiecutter.library_name -%}
|
{%- set repo_name = 'CircuitPython_' -%}
|
||||||
{% set full_repo_name = cookiecutter.github_user + "/" + repo_name -%}
|
{%- endif -%}
|
||||||
{%- set pypi_name = cookiecutter.library_name|lower|replace("_", "-") -%}
|
{%- 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
|
Introduction
|
||||||
============
|
============
|
||||||
|
|
||||||
{% if cookiecutter.sphinx_docs | lower in ["yes", "y"] %}
|
{% 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' %}
|
{%- if cookiecutter.target_bundle == 'Adafruit' %}
|
||||||
:target: https://circuitpython.readthedocs.io/projects/{{ cookiecutter.library_name | lower }}/en/latest/
|
:target: {{ docs_url }}
|
||||||
{%- else %}
|
{%- else %}
|
||||||
:target: https://circuitpython-{{ cookiecutter.library_name | lower }}.readthedocs.io/
|
:target: {{ docs_url }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
:alt: Documentation Status
|
:alt: Documentation Status
|
||||||
{% endif %}
|
{% 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
|
.. image:: https://img.shields.io/discord/327254708534116352.svg
|
||||||
|
{%- endif %}
|
||||||
:target: https://adafru.it/discord
|
:target: https://adafru.it/discord
|
||||||
:alt: 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
|
.. 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.
|
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 -%}
|
{% endif -%}
|
||||||
|
|
||||||
{%- if cookiecutter.pypi_release in ["y", "yes"] -%}
|
{%- if cookiecutter.pypi_release in ["y", "yes"] %}
|
||||||
|
|
||||||
Installing from PyPI
|
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.
|
.. 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
|
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:
|
To install for current user:
|
||||||
|
|
||||||
.. code-block:: shell
|
.. 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):
|
To install system-wide (this may be required in some cases):
|
||||||
|
|
||||||
.. code-block:: shell
|
.. 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:
|
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
|
mkdir project-name && cd project-name
|
||||||
python3 -m venv .env
|
python3 -m venv .env
|
||||||
source .env/bin/activate
|
source .env/bin/activate
|
||||||
pip3 install adafruit-circuitpython-{{ pypi_name }}
|
pip3 install {% if cookiecutter.library_prefix -%}{{ cookiecutter.library_prefix }}-{% endif -%}circuitpython-{{ pypi_name }}
|
||||||
|
|
||||||
{% endif %}
|
{% 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
|
Usage Example
|
||||||
=============
|
=============
|
||||||
|
|
||||||
.. todo:: Add a quick, simple example. It and other examples should live in the
|
.. todo:: Add a quick, simple example. It and other examples should live in the
|
||||||
examples folder and be included in docs/examples.rst.
|
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
|
Contributing
|
||||||
============
|
============
|
||||||
|
|
||||||
Contributions are welcome! Please read our `Code of Conduct
|
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.
|
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)
|
.. 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"
|
.. 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:
|
:members:
|
||||||
|
|
@ -29,14 +29,14 @@ extensions = [
|
||||||
|
|
||||||
|
|
||||||
intersphinx_mapping = {
|
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"] -%}
|
{%- 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 %}
|
{% endif %}
|
||||||
{%- if cookiecutter.requires_register in ["y", "yes"] -%}
|
{%- 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 %}
|
{%- 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.
|
# Show the docstring from both the class and its __init__() method.
|
||||||
|
|
@ -51,7 +51,7 @@ source_suffix = ".rst"
|
||||||
master_doc = "index"
|
master_doc = "index"
|
||||||
|
|
||||||
# General information about the project.
|
# 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 }}"
|
copyright = "{% now 'utc', '%Y' %} {{ cookiecutter.author_name }}"
|
||||||
author = "{{ 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.
|
# This is also used if you do content translation via gettext catalogs.
|
||||||
# Usually you set "language" from the command line for these cases.
|
# 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
|
# List of patterns, relative to source directory, that match files and
|
||||||
# directories to ignore when looking for source files.
|
# directories to ignore when looking for source files.
|
||||||
|
|
@ -133,7 +133,7 @@ html_static_path = ["_static"]
|
||||||
html_favicon = "_static/favicon.ico"
|
html_favicon = "_static/favicon.ico"
|
||||||
|
|
||||||
# Output file base name for HTML help builder.
|
# 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 ---------------------------------------------
|
# -- Options for LaTeX output ---------------------------------------------
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ latex_elements = {
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
(
|
(
|
||||||
master_doc,
|
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",
|
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||||
author,
|
author,
|
||||||
"manual",
|
"manual",
|
||||||
|
|
@ -168,7 +168,7 @@ latex_documents = [
|
||||||
man_pages = [
|
man_pages = [
|
||||||
(
|
(
|
||||||
master_doc,
|
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",
|
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||||
[author],
|
[author],
|
||||||
1,
|
1,
|
||||||
|
|
@ -183,10 +183,10 @@ man_pages = [
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
(
|
(
|
||||||
master_doc,
|
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",
|
"{% if cookiecutter.library_prefix %}{{ cookiecutter.library_prefix | capitalize }} {% endif %}CircuitPython {{ cookiecutter.library_name }} Library Documentation",
|
||||||
author,
|
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.",
|
"One line description of project.",
|
||||||
"Miscellaneous",
|
"Miscellaneous",
|
||||||
),
|
),
|
||||||
|
|
@ -3,6 +3,6 @@ Simple test
|
||||||
|
|
||||||
Ensure your device works with this simple test.
|
Ensure your device works with this simple test.
|
||||||
|
|
||||||
.. literalinclude:: ../examples/{{ cookiecutter.library_name | lower }}_simpletest.py
|
.. literalinclude:: ../examples/{{ cookiecutter.library_name | lower | replace(" ", "_") }}_simpletest.py
|
||||||
:caption: examples/{{ cookiecutter.library_name | lower }}_simpletest.py
|
:caption: examples/{{ cookiecutter.library_name | lower | replace(" ", "_") }}_simpletest.py
|
||||||
:linenos:
|
:linenos:
|
||||||
|
|
@ -36,8 +36,9 @@ Table of Contents
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:caption: Other Links
|
: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>
|
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>
|
||||||
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
|
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>
|
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
|
||||||
Discord Chat <https://adafru.it/discord>
|
Discord Chat <https://adafru.it/discord>
|
||||||
Adafruit Learning System <https://learn.adafruit.com>
|
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 -%}
|
{%- endif -%}
|
||||||
{# put keywords into an iterable list, based on word wrapping #}
|
{# put keywords into an iterable list, based on word wrapping #}
|
||||||
{%- set kw_list = namespace(kw_list=[], default=["adafruit", "blinka", "circuitpython", "micropython"]) -%}
|
{%- 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(" ")) -%}
|
{%- do kw_list.default.extend(cookiecutter.library_keywords.split(" ")) -%}
|
||||||
{%- set wrapped = kw_list.default|unique|join(" ")|wordwrap(break_long_words=False) -%}
|
{%- set wrapped = kw_list.default|unique|join(" ")|wordwrap(break_long_words=False) -%}
|
||||||
{%- do kw_list.kw_list.extend(wrapped.split("\n")) -%}
|
{%- do kw_list.kw_list.extend(wrapped.split("\n")) -%}
|
||||||
{# create repo and pypi names #}
|
{# create repo and pypi names #}
|
||||||
{%- if cookiecutter.library_prefix -%}
|
{%- if cookiecutter.target_bundle != 'CircuitPython Org' -%}
|
||||||
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
{%- if cookiecutter.library_prefix -%}
|
||||||
{%- set repo_name = repo_name + '_CircuitPython_' -%}
|
{%- set repo_name = (cookiecutter.library_prefix | capitalize) -%}
|
||||||
{%- set repo_name = repo_name + cookiecutter.library_name -%}
|
{%- 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 -%}
|
{%- else -%}
|
||||||
{%- set repo_name = 'CircuitPython_' + cookiecutter.library_name -%}
|
{%- set repo_name = 'CircuitPython_Org_' + cookiecutter.library_name | replace(" ", "_") -%}
|
||||||
{%- endif -%}
|
{%- 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.
|
"""A setuptools based setup module.
|
||||||
|
|
||||||
See:
|
See:
|
||||||
|
|
@ -50,10 +55,13 @@ with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||||
long_description = f.read()
|
long_description = f.read()
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
{% if cookiecutter.target_bundle == 'Adafruit' -%}
|
# {{ cookiecutter.target_bundle }} Bundle Information
|
||||||
# Adafruit Bundle Information
|
|
||||||
name="{{ pypi_name }}",
|
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"],
|
setup_requires=["setuptools_scm"],
|
||||||
description="{{ cookiecutter.library_description }}",
|
description="{{ cookiecutter.library_description }}",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
|
|
@ -61,21 +69,12 @@ setup(
|
||||||
# The project's main homepage.
|
# The project's main homepage.
|
||||||
url="https://github.com/{{ cookiecutter.github_user }}/{{ repo_name }}.git",
|
url="https://github.com/{{ cookiecutter.github_user }}/{{ repo_name }}.git",
|
||||||
# Author details
|
# Author details
|
||||||
|
{% if cookiecutter.target_bundle == 'Adafruit' -%}
|
||||||
author="Adafruit Industries",
|
author="Adafruit Industries",
|
||||||
author_email="circuitpython@adafruit.com",
|
author_email="circuitpython@adafruit.com",
|
||||||
{%- else -%}
|
{%- 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="{{ cookiecutter.author_name }}",
|
||||||
author_email="",
|
author_email="", # TODO: Add your email here
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"{{ req_list.items|sort|unique|join('",\n"')|indent(width=8) }}",
|
"{{ req_list.items|sort|unique|join('",\n"')|indent(width=8) }}",
|
||||||
|
|
@ -90,14 +89,13 @@ setup(
|
||||||
"Topic :: System :: Hardware",
|
"Topic :: System :: Hardware",
|
||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.4",
|
|
||||||
"Programming Language :: Python :: 3.5",
|
|
||||||
],
|
],
|
||||||
# What does your project relate to?
|
# What does your project relate to?
|
||||||
keywords="{{ kw_list.kw_list|sort|unique|join(' "\n"')|indent(width=13) }}",
|
keywords="{{ kw_list.kw_list|sort|unique|join(' "\n"')|indent(width=13) }}",
|
||||||
|
|
||||||
# You can just specify the packages manually here if your project is
|
# You can just specify the packages manually here if your project is
|
||||||
# simple. Or you can use find_packages().
|
# simple. Or you can use find_packages().
|
||||||
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
|
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
|
||||||
# CHANGE `py_modules=['...']` TO `packages=['...']`
|
# 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: 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
|
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
|
* Any spamming, flaming, baiting or other attention-stealing behavior
|
||||||
* Excessive or unwelcome helping; answering outside the scope of the question
|
* Excessive or unwelcome helping; answering outside the scope of the question
|
||||||
asked
|
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
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
* Promoting or spreading disinformation, lies, or conspiracy theories against
|
||||||
a person, group, organisation, project, or community
|
a person, group, organisation, project, or community
|
||||||
|
|
@ -77,35 +79,40 @@ involving other community members.
|
||||||
|
|
||||||
You may report in the following ways:
|
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
|
On the Adafruit Discord, you may send an open message from any channel
|
||||||
to all Community Moderators by tagging @community moderators. You may
|
to all Community Moderators by tagging @community moderators. You may
|
||||||
also send an open message from any channel, or a direct message to
|
also send an open message from any channel, or a direct message to
|
||||||
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
|
any Community Moderator.
|
||||||
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
|
|
||||||
|
|
||||||
Email and direct message reports will be kept confidential.
|
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,
|
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.
|
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
|
1. Any member of the community may report any situation that violates the
|
||||||
Adafruit Community Code of Conduct. All reports will be reviewed and
|
CircuitPython Community Code of Conduct. All reports will be reviewed and
|
||||||
investigated.
|
investigated.
|
||||||
2. If the behavior is an egregious violation, the community member who
|
2. If the behavior is a severe 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.
|
3. Otherwise, moderators will first respond to such behavior with a warning.
|
||||||
4. Moderators follow a soft "three strikes" policy - the community member may
|
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
|
be given another chance, if they are receptive to the warning and change their
|
||||||
behavior.
|
behavior.
|
||||||
5. If the community member is unreceptive or unreasonable when warned by a
|
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
|
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
|
second offense. Repeated offenses will result in the community member being
|
||||||
banned.
|
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
|
## Scope
|
||||||
|
|
||||||
|
|
@ -123,9 +130,8 @@ accordingly.
|
||||||
|
|
||||||
## Attribution
|
## Attribution
|
||||||
|
|
||||||
This Code of Conduct is adapted from the [Contributor Covenant],
|
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
|
||||||
version 1.4, available at
|
version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html),
|
||||||
<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).
|
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
|
||||||
|
|
||||||
For other projects adopting the Adafruit Community Code of
|
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
|
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
|
explicitly mentioning your moderation policy or making a copy with your
|
||||||
own moderation policy so as to avoid confusion.
|
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
|
# 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 != "" %}
|
{% if cookiecutter.library_description != "" %}
|
||||||
|
|
@ -25,7 +25,7 @@ Implementation Notes
|
||||||
**Software and Dependencies:**
|
**Software and Dependencies:**
|
||||||
|
|
||||||
* Adafruit CircuitPython firmware for the supported boards:
|
* 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
|
.. todo:: Uncomment or remove the Bus Device and/or the Register library dependencies
|
||||||
based on the library's use of either.
|
based on the library's use of either.
|
||||||
|
|
@ -36,5 +36,18 @@ Implementation Notes
|
||||||
|
|
||||||
# imports
|
# 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"
|
__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