Skip to content

Commit

Permalink
Merge pull request #227 from akayunov/bugfix/decrease-memory-consuption
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Oct 6, 2021
2 parents 77ea680 + 6e0e9f1 commit a83b85c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ project_urls =
packages = find:
install_requires =
setuptools
importlib-metadata;python_version < '3.8'
python_requires = >=3.6
include_package_data = True
package_dir = =src
Expand Down
10 changes: 8 additions & 2 deletions src/humanize/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Main package for humanize."""
import pkg_resources

from humanize.filesize import naturalsize
from humanize.i18n import activate, deactivate, thousands_separator
Expand All @@ -20,7 +19,14 @@
precisedelta,
)

__version__ = VERSION = pkg_resources.get_distribution(__name__).version
try:
# Python 3.8+
import importlib.metadata as importlib_metadata
except ImportError:
# <Python 3.7 and lower
import importlib_metadata

__version__ = importlib_metadata.version(__name__)


__all__ = [
Expand Down

0 comments on commit a83b85c

Please sign in to comment.