From bb327724b5e174930a5d30b08a8d5c28fbdb164b Mon Sep 17 00:00:00 2001 From: Shawn Morel Date: Mon, 12 Feb 2024 06:07:17 -0800 Subject: [PATCH] chore: ensure that pipenv is installed. (#14469) The current "out-of-the-box" dev experience fails in the following way - `make setup` first invokes - `make setup-js` before it runs `make setup-py` - setup-js invokes a sub-make for the app shell which requires pipenv already setup to build the python protocol analysis sandbox. This is fine if you've already run things before and have pipenv installed locally but it means the standard experience following the dev guides fails. This pulls out the minimal python setup as a dependency of both the setup-py and setup-js build targets --- Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 03c88d4ad68..a01d2308eaf 100755 --- a/Makefile +++ b/Makefile @@ -53,9 +53,15 @@ usb_host=$(shell yarn run -s discovery find -i 169.254) .PHONY: setup setup: setup-js setup-py +# Both the python and JS setup targets depend on a minimal python setup so they can create +# virtual envs using pipenv. +.PHONY: setup-py-toolchain +setup-py-toolchain: + $(OT_PYTHON) -m pip install pipenv==2023.11.15 + # front-end dependecies handled by yarn .PHONY: setup-js -setup-js: +setup-js: setup-py-toolchain yarn config set network-timeout 60000 yarn $(MAKE) -C $(APP_SHELL_DIR) setup @@ -64,8 +70,7 @@ setup-js: PYTHON_SETUP_TARGETS := $(addsuffix -py-setup, $(PYTHON_DIRS)) .PHONY: setup-py -setup-py: - $(OT_PYTHON) -m pip install pipenv==2023.11.15 +setup-py: setup-py-toolchain $(MAKE) $(PYTHON_SETUP_TARGETS)