From ac671d08a97bbc64b57b0c97bd6ccd996c96fd40 Mon Sep 17 00:00:00 2001 From: Jeremy Mack Wright Date: Fri, 4 May 2018 11:06:14 -0400 Subject: [PATCH] Got required library download, extraction and installation working for cqparts in update_dependencies script. --- .gitignore | 1 + Tools/update_dependencies.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100755 Tools/update_dependencies.sh diff --git a/.gitignore b/.gitignore index a15a5be..d8c2f1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.pyc .idea/ .DS_Store +temp/ diff --git a/Tools/update_dependencies.sh b/Tools/update_dependencies.sh new file mode 100755 index 0000000..e335d92 --- /dev/null +++ b/Tools/update_dependencies.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Updates the third party libraries and their dependencies +# Needs pip installed, and is a Linux-only script +# This should be run from within the Tools directory of cadquery-freecad-module + +# Set up a temporary directory for downoading and extracting +if [ -d "temp" ]; then + rm -rf temp/ +fi +mkdir temp/ +cd temp/ + +# Grab all cqparts packages +pip search cqparts- | awk '{print $1}' | xargs -L1 pip download + +# Removing these allows us to stick with our already installed versions +rm pyparsing* +rm cadquery* + +# Put the required libs in the proper place +ls *.whl | grep -v cqparts | xargs -L1 unzip +ls *.whl | grep -v cqparts | tr '[:upper:]' '[:lower:]' | awk -F "-" '{print $1}' | xargs -I {} cp -R {} ../../Libs/ + +# Clean up any libraries that were just single files +deps=`ls *.whl | grep -v cqparts | tr '[:upper:]' '[:lower:]' | awk -F "-" '{print $1}'` +for dep in $deps; do + cp "${dep}.py" ../../Libs/ +done