@@ -4,7 +4,6 @@ set -eo pipefail
44repo_name=` git config remote.origin.url | sed -e ' s,^.*/,,;s/\.git$//' | tr A-Z_ a-z-`
55echo " === Building package: $repo_name "
66
7-
87echo " === Create and set up virtual environment"
98[ -d .venv ] || python3 -m venv .env
109. .env/bin/activate
@@ -18,16 +17,39 @@ pylint jepler_udecimal
1817if [ -d examples ]; then
1918 pylint --disable=missing-docstring,invalid-name,bad-whitespace examples
2019fi
20+
21+ echo " === Clone and build circuitpython unix port"
22+ [ -e circuitpython/py/py.mk ] || git clone --depth=1 https://github.com/adafruit/circuitpython
23+ [ -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)
24+ [ -x circuitpython/ports/unix/micropython ] || (
25+ make -C circuitpython/mpy-cross -j$( nproc)
26+ make -C circuitpython/ports/unix -j$( nproc) deplibs
27+ make -C circuitpython/ports/unix -j$( nproc) DEBUG=1 STRIP=:
28+ )
29+
2130echo " === Run tests"
2231python -m jepler_udecimal.test
32+
33+ if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests -d examples; then
34+ for exp in * .exp; do
35+ testbase=$( basename $exp .exp) ;
36+ echo -e " \nFAILURE $testbase " ;
37+ diff -u $testbase .exp $testbase .out;
38+ done
39+ fi
40+
41+ PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
2342echo " === Build CircuitPython bundle"
2443circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix $repo_name --library_location .
44+
2545echo " === Build docs"
2646rm -rf docs/_build
2747(cd docs && sphinx-build -E -W -b html . _build/html)
48+
2849echo " === Build pypi files"
2950python setup.py sdist
3051python setup.py bdist_wheel --universal
52+
3153echo " === Check pypi files"
3254twine check dist/*
3355# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
0 commit comments