From ff6e5eebb28053890968252b3ae2da6ddec99d86 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Mon, 17 Jun 2024 12:53:59 -0400 Subject: [PATCH 1/3] make:all:fixed:tested on macos:13.5 (22G74) --- GNUmakefile | 13 +++++++------ pip.conf | 2 ++ scripts/initialize | 32 ++++++++++++++++---------------- 3 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 pip.conf diff --git a/GNUmakefile b/GNUmakefile index 82d618b41..1b254b8d8 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -391,10 +391,10 @@ all: initialize init install prune-cluster## all .PHONY: venv venv:## create python3 virtualenv .venv - test -d .venv || $(PYTHON3) -m virtualenv .venv + test -d .venv || python3 -m virtualenv .venv || pipx install virtualenv && virtualenv .venv ( \ - source .venv/bin/activate; pip install -q -r requirements.txt; \ - python3 -m pip install -q omegaconf \ + source .venv/bin/activate; pip install -q -r requirements.txt --break-system-package; \ + pip install -q omegaconf --break-system-package \ pip install -q --upgrade pip; \ ); @echo "To activate (venv)" @@ -432,10 +432,11 @@ endif @install -v -m=o+rwx $(PWD)/getcoins.py /usr/local/bin/play-getcoins #$(PYTHON3) -m pip install -q --upgrade pip 2>/dev/null - $(PYTHON3) -m pip install -q omegaconf 2>/dev/null - $(PYTHON3) -m pip install -q -r requirements.txt 2>/dev/null + $(PYTHON3) -m pip install -q omegaconf 2>/dev/null || $(MAKE) venv + $(PYTHON3) -m pip install -q -r requirements.txt 2>/dev/null || true # pushd docs 2>/dev/null && $(PYTHON3) -m pip install -q -r requirements.txt && popd 2>/dev/null - $(PYTHON3) plebnet_generate.py TRIPLET=$(TRIPLET) services=$(SERVICES) + source .venv/bin/activate; $(PYTHON3) plebnet_generate.py TRIPLET=$(TRIPLET) services=$(SERVICES) || \ + pip3 install omegaconf --break-system-packages #pushd scripts 2>/dev/null; for string in *; do sudo chmod -R o+rwx /usr/local/bin/$$string; done; popd 2>/dev/null || echo diff --git a/pip.conf b/pip.conf new file mode 100644 index 000000000..8d6418e9b --- /dev/null +++ b/pip.conf @@ -0,0 +1,2 @@ +user = true +break-system-packages = true diff --git a/scripts/initialize b/scripts/initialize index a3ecc960e..aa95ded26 100755 --- a/scripts/initialize +++ b/scripts/initialize @@ -71,18 +71,21 @@ if hash brew 2>/dev/null; then if ! hash gawk 2>/dev/null; then brew install gawk fi + if ! hash pipx 2>/dev/null; then + brew install pipx + fi #brew install python@3.8 if ! hash docker 2>/dev/null; then rm -rf /usr/local/share/zsh/site-functions/_docker && \ rm -rf /usr/local/share/fish/vendor_completions.d/docker.fish && \ rm -rf /usr/local/etc/bash_completion.d/docker - brew install --cask docker - brew install docker - brew link docker + brew install --cask docker || true + brew install docker || true + brew link docker || true fi if ! hash docker-compose 2>/dev/null; then - brew install docker-compose + brew install docker-compose || true fi if ! hash mkdocs 2>/dev/null; then brew install mkdocs @@ -90,18 +93,14 @@ if hash brew 2>/dev/null; then if ! hash jq 2>/dev/null; then brew install jq fi - brew install --quiet --force python@3.9 - curl -O https://bootstrap.pypa.io/get-pip.py - sudo -H python3 get-pip.py --no-warn-script-location - - if [ -f "/usr/local/opt/python@3.9/bin/python3" ] && [ -f "/opt/homebrew/opt/python@3.9/bin/python3" ]; then - python39=/opt/homebrew/opt/python@3.9/bin/python3 - else - python39=$(which python3) - fi - export python39 - $python39 -m pip -q install --upgrade pip - $python39 -m pip -q install omegaconf + #brew install --quiet --force python@3 + ##curl -O https://bootstrap.pypa.io/get-pip.py + ##sudo -H python3 get-pip.py --no-warn-script-location + + python3=$(which python3) + export python3 + pipx ensurepath && \ + pipx install omegaconf --include-deps --force #|| $(which python3) -m pip -q install --upgrade pip && $(which python3) -m pip -q install omegaconf || echo else /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" @@ -167,6 +166,7 @@ if [[ "$OSTYPE" == "linux"* ]]; then fi elif [[ "$OSTYPE" == "darwin"* ]]; then checkbrew + echo elif [[ "$OSTYPE" == "cygwin" ]]; then echo TODO add support for $OSTYPE elif [[ "$OSTYPE" == "msys" ]]; then From b283465ac7e1b80f8ce59893f531882b851593b9 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Mon, 17 Jun 2024 13:06:41 -0400 Subject: [PATCH 2/3] .github/workflows/codespell.yml:use pipx to install codespell --- .github/workflows/codespell.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 118876091..7187555f6 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -24,11 +24,10 @@ jobs: - name: install-codespell-asciidoctor run: | export DEBIAN_FRONTEND=noninteractive - sudo apt list --upgradable - sudo apt upgrade -y - sudo apt update -y - sudo apt install apt-utils asciidoctor python3-pip golang-go -y - pip3 install -U codespell + sudo apt-get update -y + sudo apt-get install apt-utils asciidoctor pipx python3-pip golang-go -y --fix-missing + pipx ensurepath + pipx install codespell - name: markdown-syntax if: ${{ !env.ACT }} run: | From 037ba374836b352090565cdf889be67a1a2f1196 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Mon, 17 Jun 2024 13:55:23 -0400 Subject: [PATCH 3/3] getcoins.py:if address empty - generate p2tr --- getcoins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/getcoins.py b/getcoins.py index 39db4f6b5..8916293f3 100755 --- a/getcoins.py +++ b/getcoins.py @@ -36,6 +36,9 @@ def print_report(): if args.address == '': # get address for receiving coins args.address = json.loads(subprocess.check_output([args.cmd] + ['exec','-it','playground-lnd', 'lncli', '--macaroonpath', '/root/.lnd/data/chain/bitcoin/signet/admin.macaroon', 'newaddress', 'p2wkh']))["address"] +if args.address == '': + # get address for receiving coins + args.address = json.loads(subprocess.check_output([args.cmd] + ['exec','-it','playground-lnd', 'lncli', '--macaroonpath', '/root/.lnd/data/chain/bitcoin/signet/admin.macaroon', 'newaddress', 'p2tr']))["address"] data = {'address': args.address} else: data = {'address': args.address}