Got required library download, extraction and installation working for cqparts in update_dependencies script.

This commit is contained in:
Jeremy Mack Wright 2018-05-04 11:06:14 -04:00
parent 3fe9f9762a
commit ac671d08a9
2 changed files with 29 additions and 0 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.pyc
.idea/
.DS_Store
temp/

28
Tools/update_dependencies.sh Executable file
View File

@ -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