Skip to content

Check update

Neil Shah-Quinn (WMF) requested to merge check-update into master

Created by: bearloga

While I was reading Marshall's comment in T240890#5772652 it occurred to me that wmfdata may sometimes be updated in a major way (e.g. to support a new environment) and that the end user may not remember to occasionally upgrade the local install, especially if they don't see any update announcements.

To that end, I propose this logic for comparing the local version of the package with the remote version on import wmfdata. If the remote version is newer, the user sees a message like:

You are using wmfdata 0.1.0. A newer version is available.
Update to 0.1.1 via: pip install --upgrade git+https://github.com/neilpquinn/wmfdata/wmfdata.git
To see what changed refer to https://github.com/neilpquinn/wmfdata/CHANGELOG.md

You can find the source for `wmfdata` at https://github.com/neilpquinn/wmfdata

Topic for discussion: ability to suppress this check by defining & exporting an environmental variable in ~/.bashrc or ~/.bash_profile. Then __init__.py checks if the variable is defined and only performs the check if it's not.

Merge request reports