diff --git a/MANIFEST.in b/MANIFEST.in index b9c3ceb..ddaa9be 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include buidl/bip39_words.txt include buidl/slip39_words.txt +graft docs* diff --git a/README.md b/README.md index b21c3ab..c1af386 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ $ multiwallet.py Welcome to multiwallet... ``` -For more information on installing multiwallet, see [multiwallet.md](docs/multiwallet.md) or check out [this demo](https://twitter.com/mflaxman/status/1321503036724989952). +For more information on installing multiwallet, see [docs/multiwallet.md](https://github.com/buidl-bitcoin/buidl-python/blob/main/docs/multiwallet.md) or check out [this demo](https://twitter.com/mflaxman/status/1321503036724989952). `singlesweep.py` works the same way for sweeping out of paper wallets, but is intentionally undocumented. @@ -100,3 +100,4 @@ $ sudo make install $ git clone git@github.com:buidl-bitcoin/buidl-python.git && cd buidl-python && python3 -m pip install -r requirements-libsec.txt && python3 -m pip install --editable . && cd buidl && python3 libsec_build.py && cd .. && python3 -c "from buidl import *; print('success') if is_libsec_enabled() else print('LIBSEC INSTALL FAIL')" ``` +(Or run the included [`install_libsec.sh`](https://github.com/buidl-bitcoin/buidl-python/blob/main/install_libsec.sh) script) diff --git a/clean.sh b/clean.sh index 42aaaf3..876cfd7 100755 --- a/clean.sh +++ b/clean.sh @@ -1,14 +1,11 @@ #! /usr/bin/env bash set -o xtrace + pip3 uninstall buidl -y rm -rf .venv3/ rm -rf dist/ rm -rf build/ rm -rf buidl.egg-info/ -rm buidl/_libsec.c -rm buidl/_libsec.cpython-*-darwin.so -rm buidl/_libsec.o -rm buidl/_libsec.so find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf diff --git a/clean_libsec.sh b/clean_libsec.sh new file mode 100755 index 0000000..7b32350 --- /dev/null +++ b/clean_libsec.sh @@ -0,0 +1,8 @@ +#! /usr/bin/env bash + +set -o xtrace + +rm -f buidl/_libsec.c +rm -f buidl/_libsec.cpython-*-darwin.so +rm -f buidl/_libsec.o +rm -f buidl/_libsec.so diff --git a/install_libsec.sh b/install_libsec.sh new file mode 100755 index 0000000..c9b2bcc --- /dev/null +++ b/install_libsec.sh @@ -0,0 +1,13 @@ +#! /usr/bin/env bash + +# This assumes libsecp256k1 is already installed on the OS + +set -o xtrace + +python3 -m pip install -r requirements-libsec.txt +python3 -m pip install --editable . +cd buidl +python3 libsec_build.py +cd .. +# TODO: should this fail if libsec doesn't work? +python3 -c "from buidl import *; print('success') if is_libsec_enabled() else print('LIBSEC INSTALL FAIL')" diff --git a/update_pypi.sh b/update_pypi.sh index 39f144f..6673504 100755 --- a/update_pypi.sh +++ b/update_pypi.sh @@ -9,23 +9,33 @@ deactivate # Abandon if anything errors set -e; -# Remove old files -rm -rf .venv3/ -rm -rf dist/ -rm -rf build/ -rm -rf buidl.egg-info/ -find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf - -# Tests +# Cleanup before getting started +./clean.sh +./clean_libsec.sh + +## RUN TESTS ## + +# To make tests fast +./install_libsec.sh + +# Install testing requirements if [ -f requirements-test.txt ]; then python3 -m pip install -r requirements-test.txt; fi + +# Run tests black --check . flake8 . pytest -v buidl/test/ pytest -v test_*.py +# Cleanup and reinstall build for pypi +./clean.sh +./clean_libsec.sh + # Safety git push +## UPDATE PYPI ## + # Virtualenv python3 --version # Install virtualenv (if not installed) @@ -42,13 +52,15 @@ python3 -m pip freeze python3 setup.py sdist bdist_wheel # Upload to PyPI python3 -m pip install --upgrade twine -python3 -m twine upload dist/* +# Use this line to upload to pypi testing repo instead: +# python3 -m twine upload --repository testpypi dist/* +python3 -m twine testpypi dist/* # Cleanup -rm -rfv dist/ -rm -rfv buidl.egg-info/ -rm -rfv build/ -find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf +./clean.sh + +# Libsec is nice to have installed by default +./install_libsec.sh # Hackey timer # https://askubuntu.com/questions/1028924/how-do-i-use-seconds-inside-a-bash-script