JuliaPy / pyjuliapkg

Manage your Julia dependencies from Python
MIT License
45 stars 12 forks source link

check if `juliaup` is update to date #8

Open Roger-luo opened 2 years ago

Roger-luo commented 2 years ago

should check or just run juliaup self upgrade before juliaup add <julia version>, otherwise we will end up in this error

(base) ➜  python git:(roger/python) ✗ juliaup add 1.7.3
Error: '1.7.3' is not a valid Julia version or channel name.

because my local juliaup was not updated after 1.7.3 was released

Roger-luo commented 2 years ago

Or maybe should set upgrade to False by default?

https://github.com/cjdoris/pyjuliapkg/blob/main/src/juliapkg/deps.py#L240

cjdoris commented 2 years ago

Yeah I've had the same issue. For me, juliaup self upgrade didn't do anything, and I can't install the newest JuliaUp through the Windows App Store either, but assuming that's supposed to work, it's probably a good thing to do.

I've added a graceful fallback though: if JuliaUp tries to install Julia and fails like this, it will now just show a warning, then try to find a compatible version of Julia in the PATH (since you probably have 1.7.2 already) like it would if you didn't have JuliaUp at all. I've released a version with this in.

cjdoris commented 1 year ago

FYI the behaviour here has changed a little recently. Now if you have JuliaUp installed, JuliaPkg will select the version to install from the list of available versions given by juliaup list. So if the user has not updated JuliaUp yet, they may get an older (but still compatible) version of Julia.

This fixes the above problem, and the user can update JuliaUp of their own accord - updating JuliaUp itself seems beyond the scope of this package.

I think this is the best behaviour. Any thoughts? If not, I'll close the issue.