-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightweight check for julia dependencies #20
Comments
This could be done in online mode to skip unnecessary actions. It can also be done in offline mode so that we can fail properly if required versions aren't present. |
@cjdoris Looking at it again, I guess juliacall might be a more sensible place for this. |
Could you clarify the issue this solves? It sounds like you are seeing juliapkg install the dependencies every time you start a new Python process that loads juliapkg? This isn't supposed to happen, juliapkg is only supposed to install dependencies if there was actually a change in the required packages. It does this by comparing the mtime on the meta file with a bunch of other important files, and if it is newer, then nothing has changed. If you are observing frequent reinstalls, this means something is going wrong with the mtime check, which should be investigated separately. |
Huh, yeah - I see what you mean. I will test this again and see where in |
So, there are times when the mtime changes but the contents do not. Do you think it's reasonable to move to hashes for the deps files? |
Yep using hashes instead of mtime has been proposed before but never implemented. Sounds like a good idea provided it's not a big performance regression. I'd be happy to take a PR for it. |
If we check mtime first, then fall back to hashes, performance should be strictly better. |
Ah yeah, so mtime to see if it might have changed, then hash to see if it actually changed. Sounds good. |
See #36 |
Maybe something like this check is still sensible though, as the Julia env might be modified outside of juliapkg? |
Currently, at least when we are not in
offline
mode, wePkg.add
all dependencies on every resolve. This is rather slow and can trigger unrequested package updates to indirect dependencies. It's also unnecessary when the required packages are already installed.Fortunately, once can use
Pkg.dependencies()
to check versions without doing anyadd
orresolve
. For example:This does not cover all possible cases, I think, but could be extended. Should something like this be added to
pyjuliapkg
?The text was updated successfully, but these errors were encountered: