From bc8f5caaee6b25a7c5ed8d8d378416458706cb64 Mon Sep 17 00:00:00 2001 From: randymcmillan Date: Mon, 17 Jun 2024 12:53:59 -0400 Subject: [PATCH] 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