You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing tools for Python projects that depend on Julia. I search for Julia installed by juliaup. Detecting if juliaup is not returning because the config file is locked is a bit of a trick. It's not Python-specific of course. Other projects that call juliaup will have to roll their own solution.
This is similar to #253. I good solution to these things might be an API for juliaup that uses machine readable input and output. Maybe json in and out.
The text was updated successfully, but these errors were encountered:
There is one API thing already: juliaup api getconfig1. I think your suggestion makes a lot of sense for that, we could for example just add a command line flag --timeout=5 to that particular command, in which case we would only wait for 5 seconds for the lock to free. If we aren't able to acquire the lock, we would just exist with an error return code, maybe?
I also did at some point think about a full bi-directional communication solution based on JSON-RPC, but given that that is much more involved, maybe the simple command line arg would already help?
The caveat is that I need to figure out how to actually specify a timeout in the locking code I use, but hopefully that can be done somehow.
juliaup api getconfig1, yes, this has been very convenient for scripting. I rely on it.
bi-directional communication solution based on JSON-RPC
Agreed, I can see why this would not be the focus of development at the moment. Maybe something simpler, not bidirectional. Along the lines of juliaup api getconfig1. I guess you could go a long way reading and writing single-shot json payloads.
What I am trying to do is read juliaup api getconfig1. That fails if juliaup is, say, downloading a julia. Is it possible/sensible to have only a write lock? For the moment, I run juliaup status first, and read from a pipe. If I get the first words of the error message, then I can take whatever action I need to. Currently, my script errors. But, I could print a warning and skip the action. Maybe a timeout would be good enough. I mean, this shouldn't happen too often. Or maybe a query command juliaup api isconfiglocked, but I suppose you want to be parsimonious with the api. btw, the reason it matters for me is I am trying to make bulletproof scripts for an application where the dependency on Julia is completely hidden from the user.
Perhaps print a message and exit.
I am developing tools for Python projects that depend on Julia. I search for Julia installed by juliaup. Detecting if
juliaup
is not returning because the config file is locked is a bit of a trick. It's not Python-specific of course. Other projects that calljuliaup
will have to roll their own solution.This is similar to #253. I good solution to these things might be an API for juliaup that uses machine readable input and output. Maybe json in and out.
The text was updated successfully, but these errors were encountered: