Skip to content
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

Resolve sometimes too eager to download package metadata and trigger updates #209

Closed
amilsted opened this issue Aug 5, 2022 · 6 comments

Comments

@amilsted
Copy link

amilsted commented Aug 5, 2022

It seems to be typical for juliacall and PythonCall/CondaPkg to attempt package updates every time they are loaded by default. For example, loading juliacall seems to always attempt to add PythonCall even if it is already present, which can trigger registry and dependency updates.

I know there is an "offline" mode that turns off this behavior by completely turning off package installation/updates completely, but I'm wondering if there could be an option in between.

Basically, if the python and julia packages needed are already correctly installed, I want loading juliacall and PythonCall to work (by default) like a normal import or using statement - e.g. no calls to Pkg.add() from juliacall/juliapkg and no calls to pip install from PythonCall/CondaPkg and no internet connection required.

Only if packages are missing, or we don't have the right versions, do I want to probe conda/julia registries. I'm pretty sure this is possible for juliacall/juliapkg, but less sure about CondaPkg/pip.

This would speed up loading of juliacall in python and julia packages that use PythonCall/CondaPkg whenever required julia/python dependencies are already properly installed without the user having to manually switch to offline mode.

@amilsted amilsted changed the title Could resolve be less eager? Could resolve be less eager to download package metadata or trigger updates? Aug 5, 2022
@cjdoris
Copy link
Collaborator

cjdoris commented Aug 5, 2022

What you've described is the intended behaviour for both packages. If they are installing things every time, it's a bug. Please post a MWE.

@amilsted
Copy link
Author

amilsted commented Aug 5, 2022

Oh, okay! I will make sure I wasn't imagining things and then post an MWE if I can.

@amilsted
Copy link
Author

amilsted commented Aug 5, 2022

So it looks like every time I import juliacall after restarting my jupyter python kernel (in a conda environment), I get a full resolve in juliapkg, along with a log message from this line. This is on mac OS.

Edit: The path reported as changed in the log message is actually the current working dir, where the jupyter notebook is stored. That seems odd?

@amilsted amilsted changed the title Could resolve be less eager to download package metadata or trigger updates? Resolve sometimes too eager to download package metadata and trigger updates Aug 5, 2022
@cjdoris
Copy link
Collaborator

cjdoris commented Aug 6, 2022

I have just released a new version of pyjuliapkg with (hopefully) a more accurate way to determine if the environment has changed. I'm pretty sure it will solve the issue you're having. Please upgrade pyjuliapkg and try again, it will resolve dependencies the first time, but should skip each time after.

@amilsted
Copy link
Author

amilsted commented Aug 8, 2022

Thanks @cjdoris! The new pyjuliapkg indeed no longer does a full resolve every time in my case. I will close this issue and open another if I see any further issues.

@amilsted amilsted closed this as completed Aug 8, 2022
@cjdoris
Copy link
Collaborator

cjdoris commented Aug 9, 2022

Great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants