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: | 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/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} 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