Skip to content

Commit 9256ca5

Browse files
committed
Add a script to build locally, replicating much of what github does
1 parent 18d2a2c commit 9256ca5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

build.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
set -eo pipefail
3+
4+
repo_name=`git config remote.origin.url | sed -e 's,^.*/,,;s/\.git$//' | tr A-Z_ a-z-`
5+
echo "=== Building package: $repo_name"
6+
7+
8+
echo "=== Create and set up virtual environment"
9+
[ -d .venv ] || python3 -m venv .env
10+
. .env/bin/activate
11+
echo "=== Install requirements"
12+
pip3 install wheel
13+
pip3 install -r requirements.txt
14+
echo "=== Run pre-commit"
15+
pre-commit run --all-files
16+
echo "=== Run pylint"
17+
pylint jepler_udecimal
18+
if [ -d examples ]; then
19+
pylint --disable=missing-docstring,invalid-name,bad-whitespace examples
20+
fi
21+
echo "=== Run tests"
22+
python -m jepler_udecimal.test
23+
echo "=== Build CircuitPython bundle"
24+
circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix $repo_name --library_location .
25+
echo "=== Build docs"
26+
rm -rf docs/_build
27+
(cd docs && sphinx-build -E -W -b html . _build/html)
28+
echo "=== Build pypi files"
29+
python setup.py sdist
30+
python setup.py bdist_wheel --universal
31+
echo "=== Check pypi files"
32+
twine check dist/*
33+
# SPDX-FileCopyrightText: Copyright (c) 2020 jepler for Unpythonic Networks
34+
#
35+
# SPDX-License-Identifier: MIT

0 commit comments

Comments
 (0)