Built on top of PacletManager`.
We are just starting so the functionality is limited and bugs are hiding behind corners. Feedback appreciated!
- supports custom installation destination (
"Destination"
option) - installs paclets released in .paclet form attached to github releases. (
"Method" ->Automatic
)
- support for different release types
- better documentation
- packages database
Import[
"https://raw.githubusercontent.com/kubapod/mpm/master/install.m"
]
-
general method
MPMInstall[ author : _String , pacletName : _String , version : _String : "latest" , OptionsPattern[] ]
-
from url
MPMInstall[ url : _String /; StringMatchQ[url, "http"|"ftp"~~__~~".paclet"] , OptionsPattern[] ]
-
from file
MPMInstall[ path : _String ? FileExistsQ /; StringEndsQ[pacletPath, ".paclet"] , OptionsPattern[] ]
MPMInstall
takes all Options[PacletInstall]
and passes them to PacletInstall
at the end.
Additionally:
-
"Destination"
allows to specify custom installation directory instead of default$UserBaseDirectory / Paclets / Repository
-
"ConfirmRequirements"
informs if an installed paclet meets requirements of the Paclet.Such exceptions are missed by
PacletManager`Install
before MMA V11.2.Catch
forMPMInstall::insreq
-
"Logger"
by defaultPrint
informs about the state of installation. -
"AllowPrereleases"
by defaultFalse
specifies whether pre-releases should be taken into account.
MPMInstall["szhorvat", "MaTeX"]
MPMInstall["kubapod", "MoreStyles"]
MPMInstall["szhorvat", "matex", "v1.6.3", "IgnoreVersion" -> True]
Good to remember that quite often paclets are identified by x.y.z
tag while associated tag/release is vx.y.z
.
MPMInstall excepts version matching the source it is refering to. So for GitHub releases it will contain v
, unless author made it plain x.y.z
.
-
create .paclet
Needs @ "PacletManager`" (*built-in in Mathematica V10+*) PackPaclet @ pacletDirectory
-
draft a release in your github repository
-
attach previously generated .paclet to the release
-
done, your paclet can be installed with MPM
But a potential user needs to have
MPM`
, the idea is to have an analogous script included in your repository README:Import["https://raw.githubusercontent.com/kubapod/mpm/master/install.m"] MPM`MPMInstall["kubapod", "morestyles"]
MPM`
is not necessary in this case but if used in one line, the name won't be parsed correctly. So just in case.