浏览代码

[build] Refactor pip module list into an variable

Romain Rigaux 4 年之前
父节点
当前提交
7c0586b7c4
共有 2 个文件被更改,包括 13 次插入3 次删除
  1. 3 3
      Makefile
  2. 10 0
      Makefile.vars

+ 3 - 3
Makefile

@@ -208,16 +208,16 @@ install-env:
 	@echo --- Creating new virtual environment
 	$(MAKE) -C $(INSTALL_DIR) virtual-env
 	# Assumes Py2 as Py3 does not have `install` target anyway.
-	# This is needed as somehow Hue commands (app_reg, collectstatic..) import modules with hard uneeded dependencies on those. 
+	# This is needed as somehow Hue commands (app_reg, collectstatic..) import modules with hard uneeded dependencies on those.
 	# We have two virt-env: $(ENV_PIP) aka /build/hue for build and $(PREFIX)/hue/build/env for destination.
 	@if [ "$(MAKECMDGOALS)" = "install" ]; then \
-	  $(PREFIX)/hue/build/env/bin/pip install cryptography==3.3.2 future==0.18.2 lockfile==0.8 python-daemon==1.5.1 pytz==2021.1 filelock==3.0.12; \
+	  $(PREFIX)/hue/build/env/bin/pip install $(PIP_MODULES); \
 	fi
 	# Alternative to ext-py directory but only due to the special case below.
 	# Hackish way to get crypto to install with pre-compiled dependencies that now break as of today with Py2.
 	@if [ "$(PYTHON_VER)" = "python2.7" ]; then \
 	  $(ENV_PIP) install --upgrade pip; \
-	  $(ENV_PIP) install cryptography==3.3.2 future==0.18.2 lockfile==0.8 python-daemon==1.5.1 pytz==2021.1 filelock==3.0.12; \
+	  $(ENV_PIP) install $(PIP_MODULES); \
 	fi
 	@echo --- Setting up Desktop core
 	$(MAKE) -C $(INSTALL_DIR)/desktop env-install

+ 10 - 0
Makefile.vars

@@ -108,6 +108,16 @@ $(info "ENV_PYTHON is $(ENV_PYTHON).")
 ENV_EASY_INSTALL := $(ENV_PYTHON) $(BLD_DIR_BIN)/easy_install
 ENV_PIP := $(ENV_PYTHON) $(BLD_DIR_BIN)/pip
 
+PIP_MODULES := \
+	cryptography==3.3.2 \
+	future==0.18.2 \
+	lockfile==0.8 \
+	python-daemon==1.5.1 \
+	pytz==2021.1 \
+	filelock==3.0.12 \
+	djangorestframework==3.9.4
+
+
 ##############################
 # This version is substituted through to the tarballs and packages.
 ##############################