Skip to content

Commit

Permalink
pull alot.__version__ from importlib metadata
Browse files Browse the repository at this point in the history
.. dynamically and remove some other metadata from alot/__init__.py to
avoid duplication

This is used in `alot -v` but also when setting `UserAgent` for
outgoing mails
  • Loading branch information
Patrick Totzke committed Aug 13, 2024
1 parent 1c49fa5 commit a3cf5b4
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions alot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
from importlib.metadata import version, PackageNotFoundError

# this requires python >=3.8
try:
__version__ = version("alot")
except PackageNotFoundError:
# package is not installed
pass


__productname__ = 'alot'
__version__ = '0.10'
__copyright__ = "Copyright (C) 2012-21 Patrick Totzke"
__author__ = "Patrick Totzke"
__author_email__ = "[email protected]"
# -__copyright__ = "Copyright (C) 2012-21 Patrick Totzke"
# __author__ = "Patrick Totzke"
# __author_email__ = "[email protected]"
__description__ = "Terminal MUA using notmuch mail"
__url__ = "https://github.com/pazz/alot"
__license__ = "Licensed under the GNU GPL v3+."
# __url__ = "https://github.com/pazz/alot"
# __license__ = "Licensed under the GNU GPL v3+."

0 comments on commit a3cf5b4

Please sign in to comment.