From d035a3428c6343b4f218e51340ddf690ad8c57ee Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 8 Sep 2020 23:51:14 -0400 Subject: [PATCH] setup: Add __version__ attribute for the tasklib module Providing __version__ attribute is a reasonably common convention among packages in the Python ecosystem. Currently the only other reliable alternative is to use pkg_resources.get_distribution method, however, importing pkg_resources is notoriously slow [1,2]. Provide the __version__ attribute to provide an API interface to check the version of tasklib at runtime. Bump the version in order to reflect module API change. [1] https://github.com/pypa/setuptools/issues/510 [2] https://github.com/pypa/setuptools/issues/926 --- setup.py | 2 +- tasklib/__init__.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 01a8233..be090ea 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ install_requirements = ['pytz', 'tzlocal'] -version = '2.2.0' +version = '2.2.1' try: import importlib diff --git a/tasklib/__init__.py b/tasklib/__init__.py index ed3e731..f9103e6 100644 --- a/tasklib/__init__.py +++ b/tasklib/__init__.py @@ -1,3 +1,5 @@ from .backends import TaskWarrior from .task import Task from .serializing import local_zone + +__version__ = '2.2.1'