Skip to content

Commit

Permalink
Replace setuptools dependency with packaging.
Browse files Browse the repository at this point in the history
bleach had a (undeclared) dependency on setuptools via the import of pkg_resources in __init__.py. pkg_resources is mostly deprecated, and it's use should be avoided. For bleach's usage, we can directly employ the packaging library.
  • Loading branch information
benjaminp authored and g-k committed Apr 29, 2020
1 parent 2df82b5 commit b7240ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bleach/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import unicode_literals

from pkg_resources import parse_version
import packaging.version

from bleach.linkifier import (
DEFAULT_CALLBACKS,
Expand All @@ -21,7 +21,7 @@
__releasedate__ = '20200324'
# x.y.z or x.y.z.dev0 -- semver
__version__ = '3.1.4'
VERSION = parse_version(__version__)
VERSION = packaging.version.Version(__version__)


__all__ = ['clean', 'linkify']
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


install_requires = [
'packaging',
'six>=1.9.0',
# html5lib requirements
'webencodings',
Expand Down

0 comments on commit b7240ab

Please sign in to comment.