11
$\begingroup$

With the paclet management framework made public in v12.1, I am eager to automate package distribution and update via paclets over the net. Stephen Wolfram mentioned in this post about v12.1 that they inted to make their paclet repository open to anyone in the near future.

However, I want to host a private server (for company policy reasons) to serve paclets for users who have minimal experience with Mathematica. Therefore I cannot expect them to do anything more complicated than PacletInstall["MyPaclet"] any time I roll out a new version, assuming they have already registered the server (which is done only once as paclet sites are persistent). Paclet (PacletObject) and paclet site (PacletSiteObject) management is certainly more polished in v12.1 than before, but I fail to set up my own site (e.g. a GitHub repo) as a paclet server. I have a GitHub account and I've uploaded the generated PacletSite.mz, but whatever I try, I get this error, which is not very informative. Did I use a wrong URL? Is the PacletSite.mz file wrong? Or code could not find it?

PacletSiteUnregister["MyGitHub"];
PacletSiteRegister["http://raw.githubusercontent.com/IstvanZachar/[...]", "MyGitHub"];
PacletSiteUpdate["MyGitHub"]

PacletSiteUpdate::err: An error occurred attempting to update paclet information
from site http://raw.githubusercontent.com/IstvanZachar/[...]. Does not appear to
be a valid paclet site

I have many questions, but here are the essential ones. This post (and answers) may serve as a knowledgebase for paclet server setup for a wide range of use cases.

  • How to host a paclet server in an arbitrary location (i.e. other than the Wolfram Cloud or local)?
  • What are the requirements for a site to qualify? Must use http:// instead of https://? Should transparently provide path for (sub)directories and files (like GitHub and unlike Google Drive)?
  • What are the minimum requirements for the paclet server for PacletSiteUpdate to be able to successfully query an uploaded PacletSite.mz? What other files needed to be there? I assume that actual paclet files are not needed for testing PacletSiteUpdate, as it uses the descriptor PacletSite.mz, but I may be wrong.
  • What protocol to use and how to refer to site architecture when registering the site via PacletSiteRegister?
  • How is a paclet site checked for consistency by PacletSiteUpdate and upon what conditions PacletSiteUpdate find a site a valid paclet site?

I am aware of these posts, but they are from 2-4 years before (using now obsolete functions) plus I could not create a working paclet server based on them.

$\endgroup$
1
2
$\begingroup$

Here is a package with utilities for manage a paclet site, especially a paclet site on Github:

https://github.com/rnotlnglgq/WolframPacletSiteManager


Basic Usage

  1. Put your paclets like this:
  • Git repository
    • .git/
    • Paclets/
      • MyPaclet-0.0.1.paclet
      • MyPaclet-0.0.2.paclet
  1. Execute wolframscript -code 'PutSiteInfo[]' in the git repository, then you will get:
  • Git repository
    • .git/
    • Paclets/
      • YourPaclet-0.0.1.paclet
      • YourPaclet-0.0.2.paclet
    • PacletSite.m (This file is not necessary)
    • PacletSite.mz (will be read by the PacletManager)
  1. Commit and push the git repository to remote
  2. Guide users of your paclet installing your paclet with:
PacletInstall["YourPaclet", "Site"->"https://github.com/you/repo/raw/branch"]

The url raw.githubusercontent.com is also OK for github repositories.


This paclet is still in development, but I think there isn't anything fatal.

Different from some other implemented packages, this package is not developed mainly for distributing paclets, but for keeping a paclet site synchronous with another one.

$\endgroup$
4
  • $\begingroup$ So basically, your package does the same as the functions in the PacletManager` context? Could you please elaborate on how your method differs e.g. from using the domestic PacletManager`BuildPacletSiteFiles? $\endgroup$ Apr 6 at 13:05
  • $\begingroup$ @IstvánZachar This package provides paclet splitting and site synchronization utilities, which are used for building a paclet mirror on a remote git repository. PacletManager functions may change, and I suffered some from that update 4.0.0->5.0.0 . So I define functions needed on my own instead of using those in ``` PacletManager` ```. And here're also some new useful function like: PacletSearch["ExampleData"]. $\endgroup$
    – rnotlnglgq
    Apr 7 at 2:42
  • $\begingroup$ Can your package access a private repository on GitHub? Can GetSiteInfo pass on Headers to the HTTPRequest to download PacletSite.mz if a Personal Authentication Token is known? $\endgroup$ Apr 8 at 13:27
  • $\begingroup$ @IstvánZachar No, it can't. In fact, this paclet is not developed for Github but for another online git repository site: Gitee. $\endgroup$
    – rnotlnglgq
    Apr 8 at 16:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.