-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·54 lines (44 loc) · 1.77 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
set -eo pipefail
repo_name=`git config remote.origin.url | sed -e 's,^.*/,,;s/\.git$//' | tr A-Z_ a-z-`
echo "=== Building package: $repo_name"
echo "=== Create and set up virtual environment"
[ -d .venv ] || python3 -m venv .env
. .env/bin/activate
echo "=== Install requirements"
pip3 install wheel
pip3 install -r requirements_dev.txt
echo "=== Run pre-commit"
pre-commit run --all-files
echo "=== Clone and build circuitpython unix port"
[ -e circuitpython/py/py.mk ] || git clone --shallow-since=2021-07-01 https://github.com/adafruit/circuitpython
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
[ -x circuitpython/ports/unix/micropython ] || (
make -C circuitpython/mpy-cross -j$(nproc)
make -C circuitpython/ports/unix -j$(nproc) deplibs
make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
)
echo "=== Run tests"
python -m jepler_udecimal.test
run-tests () {
env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py "$@"
}
run-tests --clean-failures
if ! run-tests -d examples; then
run-tests --print-failures
exit 1
fi
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
echo "=== Build CircuitPython bundle"
circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix $repo_name --library_location .
echo "=== Build docs"
rm -rf docs/_build
(cd docs && sphinx-build -E -W -b html . _build/html)
echo "=== Build pypi files"
python setup.py sdist
python setup.py bdist_wheel --universal
echo "=== Check pypi files"
twine check dist/*
# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
#
# SPDX-License-Identifier: MIT