xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
127 stars 62 forks source link

[xas_viewer] Disable automatic check for updates or make it user settable #440

Closed maurov closed 1 year ago

maurov commented 1 year ago

@newville, on beamline machines where Larch is installed system-wide (binary or from source) we often have problems with the automatic check for updates. If we do not update Larch promptly after a release, it happens that either the users are annoyed to see this banner at each startup of xas_viewer or even worst that they click on OK button and install a local version of Larch that then goes into conflicts with what was installed before or breaks things that are tricky to debug (due to the fact that the installer calls pip install --upgrade xraylarch).

What about if we simply change check_version=False by default? Or add an option in LarchUpdaterDialog (or in the preferences) that will not check for new version at startup?

newville commented 1 year ago

@maurov Good suggestion - I will change XAS Viewer to inform of new versions being available in the status bar.

newville commented 1 year ago

@maurov But also:

pip install --upgrade xraylarch is not actually the problem. On Windows, it is a system error to try to overwrite an open executable. So basically, having an automatic update of a program from a program is not possible -- one could update libraries and files loaded, but not the actual .exe file. So, auto-updates on Windows from XAS Viewer were always failing.
I had already changed XAS Viewer "update" to either have the user copy and paste the pip command into a terminal, or to run the now-installed Desktop App "Larch Updater".

But, the version of 0.9.68 (or anything earlier) still has this problem, so updating to 0.9.70 will still require manual intervention and "pip update", and then things will be better...

FWIW, conda does not solve this problem. It's not pip. It's Windows.

maurov commented 1 year ago

@newville thanks for considering this issue.

Our case is on Linux, where I usually install Larch from source in a conda environment with an administrator account. If the user does the upgrade via pip on a user account, then two Larch versions get installed and this creates a mess. I need then to manually remove the user's local version and update the admnistrator's one separately.

I agree that conda will not solve this problem neither.

newville commented 1 year ago

@maurov Ah, yeah mixing admin and user accounts is definitely a problem too. I know that some folks at the APS also want admin-installed system-wide installs (using debian packages + pip).

Anyway, turning down the notifications and making them informative should help....

newville commented 1 year ago

@maurov I think we can close this.