Browse Source

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

Chris Simpkins 7 years ago
parent
commit
fe6e6ba46c
1 changed files with 50 additions and 0 deletions
  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 " "