Skip to content

Commit 7af39aa

Browse files
committed
touch plone.api-install to avoid running pip
When there is a separate target to only install `plone.api`, it runs pip every time to see if it is installed, which can take a second or two. It's an annoyance that adds up. So I modified the Makefile to fake it, by making the target `plone.api-install` create a file with the same name. Make will skip that target's commands when a file with the name of the target exists, and, of course, it's not a phony target. On the first run, `plone.api-install` will create the file `plone.api-install` and install plone.api. On subsequent runs, since a file with the name of the target exists, the target will be skipped. If you want to purge the installation, use `make distclean`. Note: while coming up with this, I was listening to the Peter Gabriel Live album, "I Have the Touch". Subliminal messages... 🤯
1 parent adb6a30 commit 7af39aa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ docs/plone.api: ## Setup plone.api docs
5252
@echo
5353
@echo "Documentation of plone.api initialized."
5454

55-
.PHONY: install-api
56-
install-api: docs/plone.api
55+
plone.api-install: docs/plone.api
56+
touch plone.api-install
5757
venv/bin/pip install plone.api -c submodules/plone.api/constraints.txt
5858
venv/bin/pip install --no-deps -e submodules/plone.api/"[test]"
59+
@echo "plone.api installed."
60+
@echo
5961

6062
docs/plone.restapi: ## Setup plone.restapi docs
6163
git submodule init
@@ -72,7 +74,7 @@ docs/volto: ## Setup Volto docs
7274
@echo "Documentation of volto initialized."
7375

7476
.PHONY: deps
75-
deps: venv/bin/python docs/volto docs/plone.restapi install-api ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, and finally create symlinks to the source files.
77+
deps: venv/bin/python docs/volto docs/plone.restapi plone.api-install ## Create Python virtual environment, install requirements, initialize or update the volto, plone.restapi, and plone.api submodules, create symlinks to the source files, and finally install plone.api.
7678

7779
.PHONY: html
7880
html: deps ## Build html

0 commit comments

Comments
 (0)