Skip to content

Commit

Permalink
Prefer public packaging module to pkg_resources' private copy of it (P…
Browse files Browse the repository at this point in the history
…ython-Markdown#826)

Some distributions of `pkg_resources` remove the vendored copy of `packaging. Additionally, the vendored copy is not publicly documented and should not be relied on exclusively.  Regardless, if `pkg_resources` is installed at all, then we can be fairly certain one of `packaging` or `pkg_resources._vendor.packaging` will be available. That being the case, there is no need to list `packaging` as a dependency.

Fixes Python-Markdown#825.
  • Loading branch information
mitya57 authored and waylan committed May 16, 2019
1 parent 144768d commit f5b6579
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/change_log/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ _______, 2019: Released version 3.1.1 (a bug-fix release).

* Fixed import failure in `setup.py` when the source directory is not
on `sys.path` (#823).
* Prefer public `packaging` module to pkg_resources' private copy of
it (#825).

Mar 25, 2019: Released version 3.1 ([Notes](release-3.1.md)).

Expand Down
5 changes: 4 additions & 1 deletion markdown/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
License: BSD (see LICENSE.md for details).
"""

from pkg_resources.extern import packaging
try:
import packaging.version
except ImportError:
from pkg_resources.extern import packaging

# __version_info__ format:
# (major, minor, patch, dev/alpha/beta/rc/final, #)
Expand Down

0 comments on commit f5b6579

Please sign in to comment.