From d592cd5caf3294a55375fe04eae7bf647f6b782d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Fri, 7 Aug 2020 16:22:53 -0400 Subject: [PATCH 1/5] Example makefile for a better development workflow. This makefile allows to clone, pull and make pyinterp from the zipi repository. It currently pulls my own branc which contains changes that have yet to be upstreamed. --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..70757ae5 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +zipi: + git clone --single-branch --branch zp_tests https://github.com/belmarca/zipi $@ + +.PHONY: zipi-pull +zipi-pull: zipi + @cd zipi && git pull + +pyinterp: zipi-pull + @echo "Running make on the parser..." + cd zipi/parser && $(MAKE) + @echo "Running make on zp..." + cd zipi/etc/bootstrap && $(MAKE) copy_files && python3 zp.py -f _tmpdir/pyinterp.py + @echo "Copying pyinterp.js..." + cp --backup=numbered zipi/etc/bootstrap/_tmpdir/pyinterp.js ./include/lang/py/pyinterp.js + @echo "Done." + + +.PHONY: serve +serve: pyinterp + python3 -m http.server 8999 --bind 127.0.0.1 From b4bdde15325e8e96aca765d4ee24b1f19712f955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Mon, 10 Aug 2020 11:11:25 -0400 Subject: [PATCH 2/5] Use zipi master branch but allow for user override. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 70757ae5..c965c708 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ +ZIPI_BRANCH = master +PYTHON38 = python3 + zipi: - git clone --single-branch --branch zp_tests https://github.com/belmarca/zipi $@ + git clone https://github.com/udem-dlteam/zipi $@ + cd zipi && git checkout $(ZIPI_BRANCH) .PHONY: zipi-pull zipi-pull: zipi @@ -14,7 +18,9 @@ pyinterp: zipi-pull cp --backup=numbered zipi/etc/bootstrap/_tmpdir/pyinterp.js ./include/lang/py/pyinterp.js @echo "Done." - .PHONY: serve serve: pyinterp python3 -m http.server 8999 --bind 127.0.0.1 + +clean: + rm -rf ./zipi From fbc38e7b94997ac7cabd9a2ebae5bec28c4acc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Mon, 10 Aug 2020 11:12:58 -0400 Subject: [PATCH 3/5] Use envvar to select python version. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c965c708..02870596 100644 --- a/Makefile +++ b/Makefile @@ -13,14 +13,14 @@ pyinterp: zipi-pull @echo "Running make on the parser..." cd zipi/parser && $(MAKE) @echo "Running make on zp..." - cd zipi/etc/bootstrap && $(MAKE) copy_files && python3 zp.py -f _tmpdir/pyinterp.py + cd zipi/etc/bootstrap && $(MAKE) copy_files && $(PYTHON38) zp.py -f _tmpdir/pyinterp.py @echo "Copying pyinterp.js..." cp --backup=numbered zipi/etc/bootstrap/_tmpdir/pyinterp.js ./include/lang/py/pyinterp.js @echo "Done." .PHONY: serve serve: pyinterp - python3 -m http.server 8999 --bind 127.0.0.1 + $(PYTHON38) -m http.server 8999 --bind 127.0.0.1 clean: rm -rf ./zipi From 28a157e292b0b3f2a011795a255070963db79fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Mon, 10 Aug 2020 11:30:21 -0400 Subject: [PATCH 4/5] Allow override of zipi repository using envvar. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 02870596..3231bfd7 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ +ZIPI_REPO = https://github.com/udem-dlteam/zipi ZIPI_BRANCH = master PYTHON38 = python3 zipi: - git clone https://github.com/udem-dlteam/zipi $@ + git clone $(ZIPI_REPO) $@ cd zipi && git checkout $(ZIPI_BRANCH) .PHONY: zipi-pull From 3e96899e8fbbe66404159f5c5b73476886d2b8ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20B=C3=A9langer?= Date: Tue, 11 Aug 2020 11:13:30 -0400 Subject: [PATCH 5/5] Remove --backup flag for compat with macOS. We now keep a single backup version of pyinterp under pyinterp.js.bk. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3231bfd7..36f29915 100644 --- a/Makefile +++ b/Makefile @@ -14,9 +14,11 @@ pyinterp: zipi-pull @echo "Running make on the parser..." cd zipi/parser && $(MAKE) @echo "Running make on zp..." - cd zipi/etc/bootstrap && $(MAKE) copy_files && $(PYTHON38) zp.py -f _tmpdir/pyinterp.py + cd zipi/etc/bootstrap && $(MAKE) pyinterp + @echo "Backing up old pyinterp.js..." + cp ./include/lang/py/pyinterp.js ./include/lang/py/pyinterp.js.bk @echo "Copying pyinterp.js..." - cp --backup=numbered zipi/etc/bootstrap/_tmpdir/pyinterp.js ./include/lang/py/pyinterp.js + cp zipi/etc/bootstrap/_tmpdir/pyinterp.js ./include/lang/py/pyinterp.js @echo "Done." .PHONY: serve