oduwsdl / archivenow

A Tool To Push Web Resources Into Web Archives

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Self-report module version number

machawk1 opened this issue · comments

In #7 I had to resort to pip to verify the version of the library I was using. This is report on installation but I have found it common that a module can self-report version.

Allow archivenow -v and archivenow --version to print the version of the module to stdout. This should help with debugging.

This can like be accomplished with something like:

from __init__ import __version__ as archiveNowVersion
...
 parser.add_argument(
        '-v', '--version', help='Report the version of archivenow', action='version',
        version='ArchiveNow ' + archiveNowVersion)

but I noticed that you are specifying the version in setup.py instead of __init__.py. It might be easier for you to maintain the version (and allow it to be more easily extractable) by including and updating it in __init__.py with each release.

Done.

$ archivenow --version
ArchiveNow 2017.02.15.1.30.10
$ archivenow -v
ArchiveNow 2017.02.15.1.30.10

LGTM