Skip to content

Commit

Permalink
Use importlib.metadata to set __version__
Browse files Browse the repository at this point in the history
This way we don't have to remember to update the version in two places
every release.  The version will only need to be set in pyproject.toml
  • Loading branch information
bgreen-litl committed Jun 8, 2022
1 parent b87ebb6 commit 596a295
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backoff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
For examples and full documentation see the README at
https://github.com/litl/backoff
"""
from backoff._decorator import on_predicate, on_exception
import importlib.metadata

from backoff._decorator import on_exception, on_predicate
from backoff._jitter import full_jitter, random_jitter
from backoff._wait_gen import constant, expo, fibo, runtime

Expand All @@ -27,4 +29,4 @@
'random_jitter',
]

__version__ = '2.1.0'
__version__ = importlib.metadata.version("backoff")

0 comments on commit 596a295

Please sign in to comment.