Skip to content

Commit

Permalink
Rely on importlib_metadata to load version from package metadata. Rem…
Browse files Browse the repository at this point in the history
…oves implicit dependency on setuptools/pkg_resources.
  • Loading branch information
jaraco committed Oct 21, 2018
1 parent c6a2cba commit dd16a70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
17.1
====

* Rely on
`importlib_metadata <https://pypi.org/project/importlib_metadata/>`_
for loading version from metadata. Removes implicit dependency on
setuptools and pkg_resources.

17.0
====

Expand Down
8 changes: 2 additions & 6 deletions irc/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@
from jaraco.functools import Throttler
from jaraco.stream import buffer
from more_itertools.recipes import consume

try:
import pkg_resources
except ImportError:
pass
import importlib_metadata

from . import connection
from . import events
Expand All @@ -83,7 +79,7 @@

# set the version tuple
try:
VERSION_STRING = pkg_resources.require('irc')[0].version
VERSION_STRING = importlib_metadata.version('irc')
VERSION = tuple(int(res) for res in re.findall(r'\d+', VERSION_STRING))
except Exception:
VERSION_STRING = 'unknown'
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'pytz',
'more_itertools',
'tempora>=1.6',
'importlib_metadata',
],
extras_require={
'testing': [
Expand Down

0 comments on commit dd16a70

Please sign in to comment.