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

__all__ = [
    'on_predicate',
    'on_exception',
    'constant',
    'expo',
    'fibo',
    'runtime',
    'full_jitter',
    'random_jitter',
]

__version__ = '2.1.0'

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

__all__ = [
    'on_predicate',
    'on_exception',
    'constant',
    'expo',
    'fibo',
    'runtime',
    'full_jitter',
    'random_jitter',
]

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

Use importlib.metadata to set __version__
Use importlib.metadata to set __version__

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

+ import importlib.metadata
+ 
- from backoff._decorator import on_predicate, on_exception
+ 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
  
  __all__ = [
      'on_predicate',
      'on_exception',
      'constant',
      'expo',
      'fibo',
      'runtime',
      'full_jitter',
      'random_jitter',
  ]
  
- __version__ = '2.1.0'
+ __version__ = importlib.metadata.version("backoff")
  
Use importlib.metadata to set __version__
## Code Before:
from backoff._decorator import on_predicate, on_exception
from backoff._jitter import full_jitter, random_jitter
from backoff._wait_gen import constant, expo, fibo, runtime

__all__ = [
    'on_predicate',
    'on_exception',
    'constant',
    'expo',
    'fibo',
    'runtime',
    'full_jitter',
    'random_jitter',
]

__version__ = '2.1.0'

## Instruction:
Use importlib.metadata to set __version__
## Code After:
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

__all__ = [
    'on_predicate',
    'on_exception',
    'constant',
    'expo',
    'fibo',
    'runtime',
    'full_jitter',
    'random_jitter',
]

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