Skip to content

Commit

Permalink
setup: Add __version__ attribute for the tasklib module
Browse files Browse the repository at this point in the history
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] pypa/setuptools#510
[2] pypa/setuptools#926
  • Loading branch information
tbabej committed Sep 9, 2020
1 parent e0d5a3f commit d035a34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

install_requirements = ['pytz', 'tzlocal']

version = '2.2.0'
version = '2.2.1'

try:
import importlib
Expand Down
2 changes: 2 additions & 0 deletions tasklib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .backends import TaskWarrior
from .task import Task
from .serializing import local_zone

__version__ = '2.2.1'

0 comments on commit d035a34

Please sign in to comment.