From db39cd9cc425957b8fc350ee0900f8a327595292 Mon Sep 17 00:00:00 2001
From: Yuanle Song <sylecn@gmail.com>
Date: Fri, 27 Aug 2021 22:37:43 +0800
Subject: [PATCH] v2.0.3 use PYPI_MIRROR when building wheels

---
 operational                       | 32 ++++++++++++++++++++++++++++++-
 project.clj                       |  2 +-
 src/leiningen/new/python/Makefile |  4 +++-
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/operational b/operational
index d52945a..7170f54 100644
--- a/operational
+++ b/operational
@@ -1,6 +1,6 @@
 * COMMENT -*- mode: org -*-
 #+Date: 2014-05-09
-Time-stamp: <2021-08-16>
+Time-stamp: <2021-08-27>
 #+STARTUP: content
 * notes								      :entry:
 ** 2018-05-02 support test, build and deploy in gocd
@@ -104,9 +104,39 @@ feature is still WIP and I won't deploy it.
 
 * current							      :entry:
 ** 
+** 2021-08-25 some env variable should be passed down to docker container.
+for example, -e SQLALCHEMY_URL is essential for yxy-wechat.
+
+predefine PASS_DOWN_ENV_VARIABLES maybe.
+
 ** 2021-08-16 support upgrading existing application's Makefile.
 - when run in existing dir, don't init git.
   just create file, let user review and do merge.
+** 2021-08-25 how to make sure pip is latest without pip install -U at "make bootstrap" time?
+how to not upgrade pip if it's already 19.0+?
+can I use Makefile to manage the pip lib version?
+
+** 2021-08-24 switch to a better build system.
+Makefile, scons, meson, bazel.
+
+Comparisons
+https://mesonbuild.com/Comparisons.html
+
+- features
+  - easy to write build file.
+    human readable.
+    with proper abstraction.
+  - build fast.
+    do not do unnecessary checks.
+    for example, when no .py file or python venv change, pylint should not run
+    if there is last run cache.
+    when a library exists in venv, do not install it again.
+    when all requirements have wheels, do not try to build it again.
+    do not regenerate deb if nothing has changed.
+
+    side note: I don't think I need deb when building using docker.
+    install via deb just slow down the build and doesn't provide much value.
+  - 
 
 ** 2019-02-28 add support for running application test using docker-compose.
 see ~/websites/url-alias project for an example.
diff --git a/project.clj b/project.clj
index 52a97f0..65a56c5 100644
--- a/project.clj
+++ b/project.clj
@@ -1,4 +1,4 @@
-(defproject python/lein-template "2.0.2"
+(defproject python/lein-template "2.0.3"
   :description "lein template for a python project"
   :url "https://gitlab.emacsos.com/sylecn/python-project-template"
   :license {:name "Apache License 2.0"
diff --git a/src/leiningen/new/python/Makefile b/src/leiningen/new/python/Makefile
index 801d874..eb0acec 100644
--- a/src/leiningen/new/python/Makefile
+++ b/src/leiningen/new/python/Makefile
@@ -64,8 +64,10 @@ shell:
 $(VENV)/runtime-venv-ready: $(REQUIREMENTS)
 	test -d "$(VENV)/bin" || $(DEFAULT_PYTHON) -m venv "$(VENV)"
 	@if [ -e "$(WHEELHOUSE)/ready" ]; then \
+		$(PIP) install -q -i $(PYPI_MIRROR) -U pip; \
 		$(PIP) install -q --isolated --no-index --find-links="$(WHEELHOUSE)" -r $(REQUIREMENTS); \
 	else \
+		$(PIP) install -q -i $(PYPI_MIRROR) -U pip; \
 		$(PIP) install -q -i $(PYPI_MIRROR) -r $(REQUIREMENTS); \
 	fi
 	touch "$(VENV)/runtime-venv-ready"
@@ -96,7 +98,7 @@ wheel: $(REQUIREMENTS)
 	if [ ! -f "$(WHEELHOUSE)/ready" ]; then \
 		test -d "$(VENV)/bin" || $(DEFAULT_PYTHON) -m venv "$(VENV)" && \
 		echo "building wheelhouse in dir $(WHEELHOUSE)..." && \
-		$(PIP) install wheel && \
+		$(PIP) install -i $(PYPI_MIRROR) wheel && \
 		$(PIP) wheel -w $(WHEELHOUSE) -i $(PYPI_MIRROR) -r $(REQUIREMENTS) && \
 		touch "$(WHEELHOUSE)/ready"; \
 	fi
-- 
GitLab