From c9c9b9f5f4ab2c0d9d54e3019228b3d1cbbd615e Mon Sep 17 00:00:00 2001 From: Arnoud Buzing Date: Wed, 21 Nov 2018 14:32:33 -0600 Subject: [PATCH] updates --- Prototypes/PacletInfo.m | 3 ++- Prototypes/Prototypes.wl | 2 +- Prototypes/Source/External.wl | 3 +++ Prototypes/Source/Usage.wl | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 Prototypes/Source/External.wl diff --git a/Prototypes/PacletInfo.m b/Prototypes/PacletInfo.m index bcd125c..d4d01e1 100644 --- a/Prototypes/PacletInfo.m +++ b/Prototypes/PacletInfo.m @@ -74,7 +74,8 @@ "Prototypes`$UUIDStringPattern","Prototypes`GeoContourMap", "Prototypes`RandomRomanNumeral", "Prototypes`Deconstruct", "Prototypes`RandomDelete", "Prototypes`RandomPosition", "Prototypes`What3Words", "Prototypes`$HashTypes", -"Prototypes`PrimeCount", "Prototypes`PrimeSum", "Prototypes`$EnglishWords", "Prototypes`OpenSky","Prototypes`SetAutoStyleOptions"} +"Prototypes`PrimeCount", "Prototypes`PrimeSum", "Prototypes`$EnglishWords", "Prototypes`OpenSky","Prototypes`SetAutoStyleOptions", +"Prototypes`ExternalInstall", "Prototypes`ExternalUninstall"} } } ] diff --git a/Prototypes/Prototypes.wl b/Prototypes/Prototypes.wl index a459734..7d039fc 100644 --- a/Prototypes/Prototypes.wl +++ b/Prototypes/Prototypes.wl @@ -20,7 +20,7 @@ Module[ {files}, "Image.wl", "Language.wl", "Paclet.wl", "Formats.wl", "Resources.wl", "Search.wl", "String.wl", "System.wl", "Color.wl", "Styles.wl", "Entities.wl", "WolframAlpha.wl", "Translation.wl","GeoGraphics.wl", "Words.wl", "Packages.wl", "Random.wl", - "Cryptography.wl", "Service/What3Words.wl", "Service/OpenSky.wl", "Primes/Primes.wl"}; + "Cryptography.wl", "External.wl", "Service/What3Words.wl", "Service/OpenSky.wl", "Primes/Primes.wl"}; Map[ Function[ {file}, AppendTo[ timings, file<>"-Before" -> N@SessionTime[] ]; diff --git a/Prototypes/Source/External.wl b/Prototypes/Source/External.wl new file mode 100644 index 0000000..b7cdfa2 --- /dev/null +++ b/Prototypes/Source/External.wl @@ -0,0 +1,3 @@ +ExternalInstall["Python", package_String] := RunProcess[{"pip", "install", package}] + +ExternalUninstall["Python", package_String] := RunProcess[{"pip", "uninstall", "-y", package}] diff --git a/Prototypes/Source/Usage.wl b/Prototypes/Source/Usage.wl index b0f6f1c..db0b760 100644 --- a/Prototypes/Source/Usage.wl +++ b/Prototypes/Source/Usage.wl @@ -151,3 +151,7 @@ PrimeSum::usage = "PrimeSum[n] gives the sum of primes less than or equal to 'n' $EnglishWords::usage = "$EnglishWords is a list of over 450,000 words found in the English language. Uses data from: https://github.com/dwyl/english-words"; SetAutoStyleOptions::usage = "SetAutoStyleOptions[n] uses ColorData[n] to set syntax coloring styles"; + +(* external *) +ExternalInstall::usage = "ExternalInstall[\"Python\", package] installs 'package' for Python using 'pip install'"; +ExternalUninstall::usage = "ExternalUninstall[\"Python\", package] uninstalls 'package' for Python using 'pip uninstall -y'";