Skip to content

Commit 9d05e00

Browse files
committed
Import packaging naturally.
1 parent 64ffb2d commit 9d05e00

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

distutils/dist.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
from collections.abc import Iterable
1515
from email import message_from_file
1616

17+
from packaging.utils import canonicalize_name, canonicalize_version
18+
1719
from ._log import log
1820
from .debug import DEBUG
1921
from .errors import (
@@ -25,13 +27,6 @@
2527
from .fancy_getopt import FancyGetopt, translate_longopt
2628
from .util import check_environ, rfc822_escape, strtobool
2729

28-
try:
29-
from packaging.utils import canonicalize_name, canonicalize_version
30-
except ImportError as ex: # pragma: no cover
31-
raise ImportError(
32-
"Distutils should be distributed alongside setuptools and its dependencies"
33-
) from ex
34-
3530
# Regex to define acceptable Distutils command names. This is not *quite*
3631
# the same as a Python NAME -- I don't allow leading underscores. The fact
3732
# that they're very similar is no coincidence; the default naming scheme is

0 commit comments

Comments
 (0)