Skip to content

Commit c9a8f78

Browse files
committed
initial commit of files
1 parent 40d5cde commit c9a8f78

10 files changed

+197
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ build/*
33
bundles
44
build_deps
55
build-circuitpython*
6+
.idea/*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017 Adafruit Industries
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# CircuitPython Org Library Bundle
2+
3+
[![Doc Status](https://readthedocs.org/projects/circuitpython/badge/?version=latest)](https://circuitpython.readthedocs.io/en/latest/docs/drivers.html) [![Discord](https://img.shields.io/discord/327254708534116352.svg)](https://adafru.it/discord)
4+
5+
This repo bundles a bunch of useful CircuitPython libraries into an easy to
6+
download zip file.
7+
8+
# License
9+
Each included library has its own license that must allow for redistribution. To
10+
save space, license text is not included in the bundle. However, a link to each
11+
individual repository is which should provide source code access and license
12+
information.
13+
14+
# Use
15+
To use the bundle download the zip (not source zip) from the
16+
[latest release](https://github.com/circuitpython/CircuitPython_Org_Bundle/releases/latest),
17+
unzip it and copy over the subfolders, such as `lib`, into the root of your
18+
CircuitPython device. Make sure to indicate that it should be merged with the
19+
existing folder when it exists.
20+
21+
# Development
22+
23+
After you clone this repository you must run `git submodule init` on update
24+
also do `git submodule update`.
25+
26+
## Updating libraries
27+
To update the libraries run `update-submodules.sh`. The script will fetch the
28+
latest code and update to the newest tag (not master).
29+
30+
## Adding a library
31+
Determine the best location within `libraries` for the new library and then run:
32+
33+
git submodule add <git url> libraries/<target directory>
34+
35+
The target directory should omit any MicroPython or CircuitPython specific
36+
prefixes such as `CircuitPython_` to simplify the listing.
37+
38+
You should make sure that the git url has the format `https://github.com/{:user}/{:repo}.git`,
39+
such as `https://github.com/tannewt/CircuitPython_Example.git`. Other forms may interfere with
40+
adabot scripts (see https://github.com/adafruit/adabot/issues/145 for details).
41+
42+
## Removing a library
43+
Only do this if you are replacing the module with an equivalent:
44+
45+
git submodule deinit libraries/<target directory>
46+
git rm libraries/<target directory>
47+
48+
## Building the bundle
49+
To build this bundle locally you'll need to install the
50+
[circuitpython-build-tools](https://github.com/adafruit/circuitpython-build-tools>) package.
51+
52+
python3 -m venv .env
53+
source .env/bin/activate
54+
pip install circuitpython-build-tools
55+
56+
Once installed, make sure you are in the virtual environment:
57+
58+
source .env/bin/activate
59+
60+
Then run the build:
61+
62+
./build.sh

README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
See here for more info: https://github.com/circuitpython/CircuitPython_Org_Bundle
2+
See VERSIONS.txt for version info.

build.sh

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /bin/bash
2+
3+
# The MIT License (MIT)
4+
#
5+
# Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
# THE SOFTWARE.
24+
25+
# This script builds the bundle
26+
27+
set -e
28+
29+
P=$(
30+
ls -RUx |
31+
gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' |
32+
gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }'
33+
)
34+
35+
circuitpython-build-bundles --filename_prefix circuitpython-org-bundle --library_location libraries --library_depth 2 --package_folder_prefix "$P"

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
circuitpython-build-tools

update-submodules.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /bin/bash
2+
3+
# The MIT License (MIT)
4+
#
5+
# Copyright (c) 2016 Scott Shawcroft for Adafruit Industries
6+
#
7+
# Permission is hereby granted, free of charge, to any person obtaining a copy
8+
# of this software and associated documentation files (the "Software"), to deal
9+
# in the Software without restriction, including without limitation the rights
10+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
# copies of the Software, and to permit persons to whom the Software is
12+
# furnished to do so, subject to the following conditions:
13+
#
14+
# The above copyright notice and this permission notice shall be included in
15+
# all copies or substantial portions of the Software.
16+
#
17+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
# THE SOFTWARE.
24+
25+
# This script updates all submodules to the latest tag (hopefully release).
26+
git submodule update
27+
git submodule foreach git fetch
28+
git submodule foreach "tag=\$(git rev-list --tags --max-count=1); git checkout -q \$tag"

update_scripts/update_linux.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#! /bin/bash
2+
latest_release=$(curl -s "https://api.github.com/repos/circuitpython/CircuitPython_Org_Bundle/releases/latest")
3+
download_link=$(echo $latest_release | grep -o "\"browser_download_url\": \"[^\"]*" | cut -d \" -f 4)
4+
tag=$(echo $latest_release | grep -o "\"tag_name\": \"[^\"]*" | cut -d \" -f 4)
5+
current=$(head -n 1 VERSIONS.txt | tr -d '[:space:]')
6+
if [ $? -ne 0 ]
7+
then echo "No VERSIONS.txt please run from lib/"
8+
fi
9+
if [ $current == $tag ]
10+
then echo "Already updated to the latest."; exit 0
11+
fi
12+
save_to=~/Downloads/$(basename $download_link)
13+
echo "Downloading to " $save_to
14+
curl -sL $download_link > $save_to
15+
unzip -o $save_to -d ..

update_scripts/update_macosx.command

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#! /bin/bash
2+
cd $(dirname $0)
3+
latest_release=$(curl -s "https://api.github.com/repos/circuitpython/CircuitPython_Org_Bundle/releases/latest")
4+
download_link=$(echo $latest_release | grep -o "\"browser_download_url\": \"[^\"]*" | cut -d \" -f 4)
5+
tag=$(echo $latest_release | grep -o "\"tag_name\": \"[^\"]*" | cut -d \" -f 4)
6+
current=$(head -n 1 VERSIONS.txt | tr -d '[:space:]')
7+
if [ $? -ne 0 ]
8+
then echo "No VERSIONS.txt please run from lib/"
9+
fi
10+
if [ $current == $tag ]
11+
then echo "Already updated to the latest."; exit 0
12+
fi
13+
save_to=~/Downloads/$(basename $download_link)
14+
echo "Downloading to " $save_to
15+
curl -sL $download_link > $save_to
16+
unzip -o $save_to -d ..

works_in_progress.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CircuitPython Org Modules: Works In Progress
2+
3+
This is a list of links to CircuitPython modules from the organization
4+
or community that are not ready to be submitted to the Bundle, but that
5+
the author would like to inform others of the module's existence.
6+
7+
If you've written a CircuitPython driver that you'd like to make
8+
available but don't feel it's ready for the CircuitPython Org Bundle,
9+
feel free to add a link to the GitHub repo below.
10+
11+
If you'd like to see a driver listed below included in the
12+
CircuitPython Org Bundle, consider contacting the author to
13+
see how you can help get the driver ready for the Bundle.
14+
15+
16+
## 🚧 Works In Progress

0 commit comments

Comments
 (0)