Skip to content
Permalink
Browse files

Setuptools now uses the 'packaging' package from pkg_resources, unify…

…ing the behavior around resolution of that package.
  • Loading branch information...
jaraco committed Dec 24, 2014
1 parent 9063c16 commit 170657b68f4b92e7e1bf82f5e19a831f5744af67
Showing with 13 additions and 21 deletions.
  1. +8 −3 pkg_resources/__init__.py
  2. +1 −7 setuptools/command/egg_info.py
  3. +2 −7 setuptools/dist.py
  4. +2 −4 setuptools/tests/test_resources.py
@@ -75,9 +75,14 @@
except ImportError:
pass

import pkg_resources._vendor.packaging.version
import pkg_resources._vendor.packaging.specifiers
packaging = pkg_resources._vendor.packaging
try:
import packaging.version
import packaging.specifiers
except ImportError:
# fallback to vendored version
import pkg_resources._vendor.packaging.version
import pkg_resources._vendor.packaging.specifiers
packaging = pkg_resources._vendor.packaging


class PEP440Warning(RuntimeWarning):
@@ -11,13 +11,6 @@
import re
import sys

try:
import packaging.version
except ImportError:
# fallback to vendored version
import pkg_resources._vendor.packaging.version
packaging = pkg_resources._vendor.packaging

from setuptools import Command
from setuptools.command.sdist import sdist
from setuptools.compat import basestring, PY3, StringIO
@@ -28,6 +21,7 @@
safe_version, yield_lines, EntryPoint, iter_entry_points, to_filename)
import setuptools.unicode_utils as unicode_utils

from pkg_resources import packaging

class egg_info(Command):
description = "create a distribution's .egg-info directory"
@@ -13,18 +13,13 @@
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)

try:
import packaging.version
except ImportError:
# fallback to vendored version
import pkg_resources._vendor.packaging.version
packaging = pkg_resources._vendor.packaging

from setuptools.depends import Require
from setuptools.compat import basestring, PY2
from setuptools import windows_support
import pkg_resources

packaging = pkg_resources.packaging


def _get_unpatched(cls):
"""Protect against re-patching the distutils if reloaded
@@ -8,15 +8,13 @@
import shutil
from unittest import TestCase

import pkg_resources._vendor.packaging.version
import pkg_resources._vendor.packaging.specifiers
packaging = pkg_resources._vendor.packaging

import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution, EntryPoint, Requirement, safe_version, safe_name,
WorkingSet)

packaging = pkg_resources.packaging

from setuptools.command.easy_install import (get_script_header, is_sh,
nt_quote_arg)
from setuptools.compat import StringIO, iteritems, PY3

0 comments on commit 170657b

Please sign in to comment.
You can’t perform that action at this time.