-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid pkg_resources import if it can (#44)
- Loading branch information
1 parent
47c5ffa
commit 925b616
Showing
1 changed file
with
11 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
import pkg_resources | ||
|
||
from .flatten_dict import flatten, unflatten # noqa: F401 | ||
|
||
|
||
__all__ = ["flatten_dict", "reducer", "splitter"] | ||
__version__ = pkg_resources.get_distribution("flatten-dict").version | ||
__all__ = ["flatten", "unflatten", "splitter"] | ||
|
||
try: | ||
from importlib.metadata import distribution | ||
except ImportError: | ||
try: | ||
from importlib_metadata import distribution | ||
except ImportError: | ||
from pkg_resources import get_distribution as distribution | ||
|
||
__version__ = distribution("flatten-dict").version |