Skip to content

Commit

Permalink
fix: Replace use of deprecated pkg_resources by importlib
Browse files Browse the repository at this point in the history
`pkg_resources` is deprecated (https://setuptools.pypa.io/en/latest/pkg_resources.html).

Closes #65.
  • Loading branch information
dbaty committed Sep 20, 2023
1 parent 6b5d688 commit 1c7cc5d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cid/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import pkg_resources
try:
import importlib.metadata as importlib_metadata
except ImportError:
import importlib_metadata


__version__ = pkg_resources.get_distribution('django-cid').version
__version__ = importlib_metadata.version('django-cid')
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
install_requires=[
'django>=2.2',
],
extras_require={
":python_version < '3.8'": [
'importlib_metadata',
],
},

license="BSD",
zip_safe=False,
keywords='django logging correlation id debugging',
Expand Down

0 comments on commit 1c7cc5d

Please sign in to comment.