Making use of workspaces that need unregistered packages #1558
Replies: 2 comments 6 replies
-
If you have packages that are unregistered but are still hosted on either github or gitlab, you can set up a local registry and Pluto Pkg Manager also looks into custom registries for fetching packages. Set up is fairly straightforward and then you can have the convenience of the package manager. Only problem is that if you need to share this notebook with someone that does not have your same registry added as custom registry, things break. |
Beta Was this translation helpful? Give feedback.
-
I think we're misunderstanding each other. As I said in my original post:
I have a github repository that contains a Julia workspace. I want several different notebooks to be able to use that workspace, from Binder, with minimal code addition to each notebook and minimal time overhead in running the notebook. Part of the problem is that Julia's Pkg.activate seems to require a local directory, presumably so that the Pkg API can modify it. One could imagine it allowing activation of a workspace from a URI and throwing an error if one tried to modify it. One could have ones notebook read the workspace from Github and add each package, but that takes a lot of runtime to recompute the manifest and requires additional code, which must be One could have one's notebook create a tempdir and copy the Project.toml and Manifest.toml files there and then activate that tempdir like
but I've not yet managed to make that work in a Pluto notebook. It complains that I need to Pkg.add VectorLogging, even though it is present in both the Project.toml andManifest.toml files in the tempdir. As near as I can tell, activate_notebook_environment requires a local file path. Tiratde: During college, and for a decade after, I got to use the MIT Lisp Machine and its descendants. The lisp machine was an individual workstation that didn't necessarily have enough disk space for a local file system. The system primitives for manipulating files could do so on any FTP or NFS server that was reachable over the network. That was in the 1980s and I've not seen that capability in any environment since. |
Beta Was this translation helpful? Give feedback.
-
Pluto Project Manager is a great new feature, but, alas, is not of much use to me since most of my notebooks make use of at least one of my own packages. None of my Julia packages are mature enough to register yet and some are personal mods to other Julia packages whose authors have not accepted my changes.
This notebook
https://github.com/MarkNahabedian/DesignWithSVG/blob/master/floor_drain/floor_drain.jl
has six calls to Pkg.add. It takes about 2 minutes to build the workspace each time the notebook is opened.
If I were only working from my laptop I could have a local directory host that workspace, but this does not work if I want to access the notebook on a mobile device through Binder.
This repository
https://github.com/MarkNahabedian/WebBasedWorkspace
is an experiment to use a web based workspace. I currently feel it is too cumbersome to use though since that package itself must be added before it can be used.
When I was first learning pluto Notebook, all of the useful UI components were invisible to me since my poor eyesight requires that I use a dark theme. The controls are all still invisible,but I've at least learned where a few of them are. I investigated what it would take to fix this and got as far as determining that the problem is actuatlly in the icon library that Pluto is using to draw these buttons.
Since I couldn't figure out how to add a new cell, I created PlutoTool
https://github.com/MarkNahabedian/PlutoTool.jl
as a sort of swiss army knife command line utility for manipulating a Pluto notebook off-line. BTW: the code in Pluto's notebook.jl was easy to understand and leverage for this.
With the introduction of the Pluto Package Manager, I added a subcommand to PlutoTool to inject PROJECT and MANIFEST cells into a notebook file. I was hoping I could embed the workspace into a notebook before pushing it to GitHub. I've not yet grasped all of the subtlety to this though and Pluto seems to overwrite the workspace that PlutoTool embedded.
I think that the most ideal solution would be if Julia added a method to Pkg.activate that took a URI as argument. Maybe I should put in a request for that.
Another alternative is to provide a PlutoUI function that can activate a workspace given a URI.
What do people feel is a good approach to address using unregistered packages from a Pluto notebook without huge setup times?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions