浏览代码

[build-pipenv.sh] added new shell script that supports builds of venv with pinned Python package versions using pipenv

Chris Simpkins 7 年之前
父节点
当前提交
fe6e6ba46c
共有 1 个文件被更改,包括 50 次插入0 次删除
  1. 50 0
      build-pipenv.sh

+ 50 - 0
build-pipenv.sh

@@ -0,0 +1,50 @@
+#!/bin/sh
+
+# /////////////////////////////////////////////////////////////////
+#
+# build-pipenv.sh
+#  A shell script that creates a virtualenv for Hack font builds
+#  Copyright 2018 Christopher Simpkins
+#  MIT License
+#
+#  Usage: ./build-pipenv.sh
+#
+# /////////////////////////////////////////////////////////////////
+
+if ! which pipenv
+	then
+		echo "Unable to detect a pipenv install.  Please install with `pip install pipenv` then repeat your build attempt." 1>&2
+		exit 1
+done
+
+# install fontTools and fontmake build dependencies with pipenv
+pipenv install --ignore-pipfile fontmake fontTools
+
+# test for fontmake install in venv
+if ! pipenv run fontmake --version
+	then
+		echo "Unable to detect fontmake install with pipenv.  Please repeat your build attempt." 1>&2
+		exit 1
+done
+
+# test for fontTools install in venv
+if ! pipenv run python -c "import fontTools"
+	then
+		echo "Unable to detect fontTools install with pipenv.  Please repeat your build attempt." 1>&2
+		exit 1
+done
+
+# print environment used for build to std output stream
+
+echo "================================="
+echo "  BUILD ENVIRONMENT"
+echo "================================="
+echo " "
+
+pipenv graph
+
+echo " "
+echo "================================="
+echo "  END BUILD ENVIRONMENT"
+echo "================================="
+echo " "