From bebf32ad6fa894ad45895fd1595ba10d8437e486 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 16 Apr 2019 16:40:16 -0700 Subject: [PATCH 1/4] Doc updates for 4.0.0 * Fixes PDF generation on RTD * Adds links to circuitpython.org for boards * Adds branding guidelines --- CONTRIBUTING.md | 10 +- README.rst | 198 +++++++++++-------------------- conf.py | 1 + logo/license-MIT-brightgreen.svg | 1 - 4 files changed, 79 insertions(+), 131 deletions(-) delete mode 100644 logo/license-MIT-brightgreen.svg diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6feed085c5..7477df61cf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,15 @@ If you have an employment contract with your employer please make sure that they don't automatically own your work product. Make sure to get any necessary approvals before contributing. Another term for this contribution off-hours is moonlighting. -## Getting started +## Ways to contribute +As CircuitPython grows, there are more and more ways to contribute. Here are some ideas: + +* Build a project with CircuitPython and share how to do it online. +* Test the latest libraries and CircuitPython versions with your projects and file issues for any bugs you find. +* Contribute Python code to CircuitPython libraries that support new devices or features of an existing device. +* Contribute C code to CircuitPython which fixes an open issue or adds a new feature. + +## Getting started with C CircuitPython developer Dan Halbert (@dhalbert) has written up build instructions using native build tools [here](https://learn.adafruit.com/building-circuitpython). diff --git a/README.rst b/README.rst index cf09648637..2d0e78f492 100644 --- a/README.rst +++ b/README.rst @@ -1,94 +1,45 @@ -Adafruit CircuitPython -====================== +CircuitPython +============= -.. image:: https://github.com/adafruit/circuitpython/blob/master/logo/CircuitPython_Repo_header_logo.png +.. image:: https://s3.amazonaws.com/adafruit-circuit-python/CircuitPython_Repo_header_logo.png |Build Status| |Doc Status| |License| |Discord| -`Status <#status>`__ \| `Supported Boards <#supported-boards>`__ -\| `Download <#download>`__ \| -`Documentation <#documentation>`__ \| -`Contributing <#contributing>`__ \| `Differences from -Micropython <#differences-from-micropython>`__ \| `Project -Structure <#project-structure>`__ +`circuitpython.org `_ \| `Get CircuitPython <#get-circuitpython>`__ \| +`Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \| +`Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \| +`Project Structure <#project-structure>`__ -**CircuitPython** is an *education friendly* open source derivative of -`MicroPython `_. CircuitPython supports use -on educational development boards designed and sold by -`Adafruit `_. Adafruit CircuitPython features -unified Python core APIs and a growing list of Adafruit libraries and -drivers of that work with it. +**CircuitPython** is an *beginner friendly*, open source version of Python for tiny, inexpensive +computers called microcontrollers. Microcontrollers are the brains of many electronics including a +wide variety of development boards used to build hobby projects and prototypes. CircuitPython in +electronics is one of the best ways to learn to code because it connects code to reality. Simply +install CircuitPython on a supported board via drag and drop and then edit a ``code.py`` file on +the CIRCUITPY drive. The code will automatically reload. No software installs are needed besides a +text editor (we recommend `Mu `_ for beginners.) -Status ------- +CircuitPython features unified Python core APIs and a growing list of 150+ device libraries and +drivers that work with it. These libraries also work on single board computers with regular +Python via the `Adafruit Blinka Library `_. -This project is stable. Most APIs should be stable going forward. Those -that change will change on major version numbers such as 2.0.0 and -3.0.0. +CircuitPython is a beginner focused derivative of `MicroPython `_. +CircuitPython development is sponsored by `Adafruit `_ and is available on +their educational development boards. Please support both MicroPython and Adafruit. -Supported Boards ----------------- +Get CircuitPython +------------------ -Designed for CircuitPython -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -**M0 Boards** - -- `Adafruit CircuitPlayground Express `__ (`CircuitPython Guide `__) -- `Adafruit Feather M0 Express `__ (`CircuitPython Guide `__) -- `Adafruit Gemma M0 `__ (`CircuitPython Guide `__) -- `Adafruit Hallowing M0 Express `__ (`CircuitPython Guide `__) -- `Adafruit ItsyBitsy M0 Express `_ (`CircuitPython Guide `__) -- `Adafruit Metro M0 Express `_ (`CircuitPython Guide `__) -- `Adafruit Trinket M0 `__ (`CircuitPython Guide `__) - -**M4 Boards** - -- `Adafruit Feather M4 Express `__ (`CircuitPython Guide `__) -- `Adafruit ItsyBitsy M4 Express `__ (`CircuitPython Guide `__) -- `Adafruit Metro M4 Express `__ (`CircuitPython Guide `__) - -Other -~~~~~ - -- `Adafruit Feather HUZZAH `__ -- `Adafruit Feather M0 - Basic `__ -- `Adafruit Feather M0 Bluefruit - LE `__ (uses M0 Basic - binaries) -- `Adafruit Feather M0 - Adalogger `__ (MicroSD card - supported using the `Adafruit CircuitPython SD - library `__) -- `Arduino Zero `__ -- `Arduino MKR Zero `__ (MicroSD card - supported using the `Adafruit CircuitPython SD - library `__) - -"Third-party" or "non-Adafruit" boards -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- `Electronic Cats Meow Meow `__ -- `Electronic Cats CatWAN USB Stick `__ - -Download --------- - -Official binaries are available through the `latest GitHub -releases `__. -Continuous (one per commit) builds are available -`here `__ -and includes experimental hardware support. +Official binaries for all supported boards are available through +`circuitpython.org `_. The site includes both stable, unstable +and continuous builds. Full release notes and assets are available through +`GitHub releases `_ as well. Documentation ------------- Guides and videos are available through the `Adafruit Learning System `__ under the `CircuitPython -category `__ and -`MicroPython -category `__. An API +category `__. An API reference is also available on `Read the Docs `__. A collection of awesome resources can be found at `Awesome CircuitPython `__. @@ -113,6 +64,27 @@ are welcome to submit pull requests and they will be promptly reviewed by project admins. Please join the `Discord `__ too. +Branding +------------ + +While we are happy to see CircuitPython forked and modified, we'd appreciate it if forked releases +not use the name "CircuitPython" or the Blinka logo. "CircuitPython" means something special to +us and those who learn about it. As a result, we'd like to make sure products referring to it meet a +common set of requirements. + +If you'd like to use the term "CircuitPython" and Blinka for your product here is what we ask: + +* Your product is supported by the primary + `"adafruit/circuitpython" `_ repo. This way we can + update any custom code as we update the CircuitPython internals. +* Your product is listed on circuitpython.org. This is to ensure that a user of your product can + always download the latest version of CircuitPython from the standard place. +* Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. + +If you choose not to meet these requirements, then we ask you call your version of CircuitPython +something else (for example, SuperDuperPython) and not use the Blinka logo. You can say it is +"CircuitPython-compatible" if most CircuitPython drivers will work with it. + -------------- Differences from `MicroPython `__ @@ -120,15 +92,12 @@ Differences from `MicroPython `__ CircuitPython: -- includes a ports for MicroChip SAMD21 (Commonly known as M0 in Adafruit +- includes ports for MicroChip SAMD21 (Commonly known as M0 in Adafruit product names) and SAMD51 (M4). -- supports only SAMD21, SAMD51, and ESP8266 ports. An nRF port is under - development. +- supports only SAMD21, SAMD51, and nRF52840 ports. - tracks MicroPython's releases (not master). -- Longints (arbitrary-length integers) are enabled for most M0 - Express boards (those boards with SPI flash chips external - to the microcontroller), and for all M4 builds. - Longints are disabled on other boards due to lack of flash space. +- floats (aka decimals) are enabled for all builds. +- error messages are translated into 10+ languages. Behavior ~~~~~~~~ @@ -153,12 +122,21 @@ Behavior causes nasty crashes by making it available through mass storage after the crash. A reset (the button) is needed after its fixed to get back into normal mode. +- RGB status LED +- Auto-reload after file write over mass storage. (Disable with + ``samd.disable_autoreload()``) +- Wait state after boot and main run, before REPL. +- Main is one of these: ``code.txt``, ``code.py``, ``main.py``, + ``main.txt`` +- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``, + ``boot.txt`` API ~~~ - Unified hardware APIs: `audioio `_, `analogio `_, `bleio `_, `busio `_, `digitalio `_, `pulseio `_, `touchio `_, `microcontroller `_, `board `_, `bitbangio `_ -- No ``machine`` API on Atmel SAMD21 port. +- API docs are rST within the C files in ``shared-bindings``. +- No ``machine`` API. Modules ~~~~~~~ @@ -178,18 +156,6 @@ Modules - tick count is available as `time.monotonic() `__ -atmel-samd21 features -~~~~~~~~~~~~~~~~~~~~~ - -- RGB status LED -- Auto-reload after file write over mass storage. (Disable with - ``samd.disable_autoreload()``) -- Wait state after boot and main run, before REPL. -- Main is one of these: ``code.txt``, ``code.py``, ``main.py``, - ``main.txt`` -- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``, - ``boot.txt`` - -------------- Project Structure @@ -231,38 +197,12 @@ Ports Ports include the code unique to a microcontroller line and also variations based on the board. -- ``atmel-samd`` Support for SAMD21 based boards such as `Arduino - Zero `__, `Adafruit - Feather M0 Basic `__, and - `Adafruit Feather M0 Bluefruit - LE `__. -- ``bare-arm`` A bare minimum version of MicroPython for ARM MCUs. -- ``cc3200`` Support for boards based - `CC3200 `__ from TI such as the - `WiPy 1.0 `__. -- ``esp8266`` Support for boards based on ESP8266 WiFi modules such as - the `Adafruit Feather - HUZZAH `__. -- ``minimal`` A minimal MicroPython port. Start with this if you want - to port MicroPython to another microcontroller. -- ``pic16bit`` Support for 16-bit PIC microcontrollers. -- ``qemu-arm`` Support for ARM emulation through - `QEMU `__. -- ``stmhal`` Support for boards based on STM32 microcontrollers - including the MicroPython flagship - `PyBoard `__. -- ``teensy`` Support for the Teensy line of boards such as the `Teensy - 3.1 `__. -- ``unix`` Support for UNIX. -- ``windows`` Support for - `Windows `__. -- ``zephyr`` Support for `Zephyr `__, a - real-time operating system by the Linux Foundation. +- ``atmel-samd`` Support for SAMD21 and SAMD51 based boards. +- ``nrf`` Support for the nRF52840 based boards. +- ``unix`` Support for UNIX. Only used for automated testing. -CircuitPython only maintains the ``atmel-samd`` and ``esp8266`` ports. -The rest are here to maintain compatibility with the -`MicroPython `__ parent -project. +The remaining, unlisted directories are in the repo to maintain compatibility with the +`MicroPython `__ parent project. `⬆ back to top <#adafruit-circuitpython>`__ @@ -272,5 +212,5 @@ project. :target: http://circuitpython.readthedocs.io/ .. |Discord| image:: https://img.shields.io/discord/327254708534116352.svg :target: https://adafru.it/discord -.. |License| image:: https://github.com/adafruit/circuitpython/blob/master/logo/license-MIT-brightgreen.svg - :target: https://opensource.org/licenses/MIT +.. |License| image:: https://img.shields.io/badge/License-MIT-brightgreen.svg + :target: https://choosealicense.com/licenses/mit/ diff --git a/conf.py b/conf.py index 4da3c26860..8586573887 100644 --- a/conf.py +++ b/conf.py @@ -37,6 +37,7 @@ needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', + 'sphinxcontrib.rsvgconverter', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage' diff --git a/logo/license-MIT-brightgreen.svg b/logo/license-MIT-brightgreen.svg deleted file mode 100644 index e28c04bbc5..0000000000 --- a/logo/license-MIT-brightgreen.svg +++ /dev/null @@ -1 +0,0 @@ - licenselicenseMITMIT \ No newline at end of file From 8b60b20f885a4f76109e25d01d6d178a99a3d850 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 16 Apr 2019 17:33:13 -0700 Subject: [PATCH 2/4] Tweaks based on review feedback. --- README.rst | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 2d0e78f492..2b475923b9 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ CircuitPython |Build Status| |Doc Status| |License| |Discord| -`circuitpython.org `_ \| `Get CircuitPython <#get-circuitpython>`__ \| +`circuitpython.org `__ \| `Get CircuitPython <#get-circuitpython>`__ \| `Documentation <#documentation>`__ \| `Contributing <#contributing>`__ \| `Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \| `Project Structure <#project-structure>`__ @@ -30,8 +30,8 @@ Get CircuitPython ------------------ Official binaries for all supported boards are available through -`circuitpython.org `_. The site includes both stable, unstable -and continuous builds. Full release notes and assets are available through +`circuitpython.org/downloads `_. The site includes stable, unstable and +continuous builds. Full release notes and assets are available through `GitHub releases `_ as well. Documentation @@ -77,8 +77,9 @@ If you'd like to use the term "CircuitPython" and Blinka for your product here i * Your product is supported by the primary `"adafruit/circuitpython" `_ repo. This way we can update any custom code as we update the CircuitPython internals. -* Your product is listed on circuitpython.org. This is to ensure that a user of your product can - always download the latest version of CircuitPython from the standard place. +* Your product is listed on `circuitpython.org `__ (source + `here `_). This is to ensure that a user of your + product can always download the latest version of CircuitPython from the standard place. * Your product has a user accessible USB plug which appears as a CIRCUITPY drive when plugged in. If you choose not to meet these requirements, then we ask you call your version of CircuitPython @@ -98,6 +99,8 @@ CircuitPython: - tracks MicroPython's releases (not master). - floats (aka decimals) are enabled for all builds. - error messages are translated into 10+ languages. +- does not support concurrency within Python (including interrupts and threading). Some concurrency + is achieved with native modules for tasks that require it such as audio file playback. Behavior ~~~~~~~~ @@ -122,19 +125,21 @@ Behavior causes nasty crashes by making it available through mass storage after the crash. A reset (the button) is needed after its fixed to get back into normal mode. -- RGB status LED -- Auto-reload after file write over mass storage. (Disable with +- RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes. +- Re-runs ``code.y`` or other main file after file system writes over USB mass storage. (Disable with ``samd.disable_autoreload()``) -- Wait state after boot and main run, before REPL. -- Main is one of these: ``code.txt``, ``code.py``, ``main.py``, +- Entering the REPL after the main code is finished requires a key press which enters the REPL and + disables autoreload. +- Main is one of these: ``code.txt``, **``code.py``**, ``main.py``, ``main.txt`` -- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``, +- Boot is one of these: ``settings.txt``, ``settings.py``, **``boot.py``**, ``boot.txt`` API ~~~ -- Unified hardware APIs: `audioio `_, `analogio `_, `bleio `_, `busio `_, `digitalio `_, `pulseio `_, `touchio `_, `microcontroller `_, `board `_, `bitbangio `_ +- Unified hardware APIs. Documented + `on ReadTheDocs `_. - API docs are rST within the C files in ``shared-bindings``. - No ``machine`` API. @@ -201,10 +206,10 @@ variations based on the board. - ``nrf`` Support for the nRF52840 based boards. - ``unix`` Support for UNIX. Only used for automated testing. -The remaining, unlisted directories are in the repo to maintain compatibility with the +The remaining port directories not listed above are in the repo to maintain compatibility with the `MicroPython `__ parent project. -`⬆ back to top <#adafruit-circuitpython>`__ +`back to top <#circuitpython>`__ .. |Build Status| image:: https://travis-ci.com/adafruit/circuitpython.svg?branch=master :target: https://travis-ci.org/adafruit/circuitpython From c415d114e190e51347c78fea559ba48a167f8de2 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Apr 2019 10:48:11 -0700 Subject: [PATCH 3/4] Feedback from Dan and hopefully fix build. --- .travis.yml | 2 +- README.rst | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 48c86a9f96..402cfb2cb2 100755 --- a/.travis.yml +++ b/.travis.yml @@ -72,7 +72,7 @@ before_script: - sudo apt-get install -y python3-pip - pip3 install --user sh click - ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls) - - (! var_search "${TRAVIS_TESTS-}" docs || pip install --user Sphinx sphinx-rtd-theme recommonmark) + - (! var_search "${TRAVIS_TESTS-}" docs || pip install --user Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter) - (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib) # report some good version numbers to the build diff --git a/README.rst b/README.rst index 2b475923b9..45e9780826 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ CircuitPython `Branding <#branding>`__ \| `Differences from Micropython <#differences-from-micropython>`__ \| `Project Structure <#project-structure>`__ -**CircuitPython** is an *beginner friendly*, open source version of Python for tiny, inexpensive +**CircuitPython** is a *beginner friendly*, open source version of Python for tiny, inexpensive computers called microcontrollers. Microcontrollers are the brains of many electronics including a wide variety of development boards used to build hobby projects and prototypes. CircuitPython in electronics is one of the best ways to learn to code because it connects code to reality. Simply @@ -22,9 +22,10 @@ CircuitPython features unified Python core APIs and a growing list of 150+ devic drivers that work with it. These libraries also work on single board computers with regular Python via the `Adafruit Blinka Library `_. -CircuitPython is a beginner focused derivative of `MicroPython `_. -CircuitPython development is sponsored by `Adafruit `_ and is available on -their educational development boards. Please support both MicroPython and Adafruit. +CircuitPython is based on `MicroPython `_. See +`below <#differences-from-micropython>`_ for differences. CircuitPython development is sponsored by +`Adafruit `_ and is available on their educational development boards. Please +support both MicroPython and Adafruit. Get CircuitPython ------------------ @@ -126,7 +127,7 @@ Behavior after the crash. A reset (the button) is needed after its fixed to get back into normal mode. - RGB status LED indicating CircuitPython state, and errors through a sequence of colored flashes. -- Re-runs ``code.y`` or other main file after file system writes over USB mass storage. (Disable with +- Re-runs ``code.py`` or other main file after file system writes over USB mass storage. (Disable with ``samd.disable_autoreload()``) - Entering the REPL after the main code is finished requires a key press which enters the REPL and disables autoreload. From 45b26ec3835fd8f29242d8b9f77d4ffa787e1d99 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 17 Apr 2019 11:35:30 -0700 Subject: [PATCH 4/4] Install rsvg --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 402cfb2cb2..5047b1a28e 100755 --- a/.travis.yml +++ b/.travis.yml @@ -72,6 +72,7 @@ before_script: - sudo apt-get install -y python3-pip - pip3 install --user sh click - ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls) + - (! var_search "${TRAVIS_TESTS-}" docs || sudo apt-get install -y librsvg2-bin) - (! var_search "${TRAVIS_TESTS-}" docs || pip install --user Sphinx sphinx-rtd-theme recommonmark sphinxcontrib-svg2pdfconverter) - (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib)