Description
Context
The CLI code to get Sopel's version only checks the Python platform release and imports Sopel's __version__
:
Lines 214 to 220 in 0479737
On Git-based/editable installations, this will be a ".dev0" version number that doesn't mean anything.
We already have the ability, within the version
built-in plugin, to show which Git commit is checked out:
sopel/sopel/modules/version.py
Lines 18 to 32 in 0479737
While not foolproof (the working directory can be changed while Sopel is running, for example, or the working copy might be modified without having been committed yet), this is still much more useful information to show.
Proposal
How to get Sopel's version number, and/or the Git SHA if relevant (possibly with a "dirty" flag if the working directory is not clean, as I've seen other tools do), could become part of tools
. Or somewhere else, if that would cause a circular import; I haven't looked yet.
Then both the CLI code and version
plugin could use a common function call(s) to show the version information consistently.
Notes
I thought we had an issue for this already, honestly, but it appears not.