Commit 027ca182 authored by Steve Kowalik's avatar Steve Kowalik

Properly merge from default.

parent 337ea160
......@@ -2,11 +2,10 @@ empty:
exit 1
update-vendored:
rm -rf pkg_resources/_vendor/packaging
rm -rf pkg_resources/_vendor/pyparsing
pip install -r pkg_resources/_vendor/vendored.txt -t pkg_resources/_vendor/
sed -i -e 's/ \(pyparsing\)/ pkg_resources._vendor.\1/' \
pkg_resources/_vendor/packaging/*.py
sed -i -e 's/ \(six\)/ pkg_resources._vendor.\1/' \
rm -rf pkg_resources/_vendor/packaging*
rm -rf pkg_resources/_vendor/six*
rm -rf pkg_resources/_vendor/pyparsing*
python3 -m pip install -r pkg_resources/_vendor/vendored.txt -t pkg_resources/_vendor/
sed -i -e 's/ \(pyparsing|six\)/ pkg_resources.extern.\1/' \
pkg_resources/_vendor/packaging/*.py
rm -rf pkg_resources/_vendor/*.{egg,dist}-info
......@@ -37,7 +37,6 @@ import plistlib
import email.parser
import tempfile
import textwrap
import itertools
from pkgutil import get_importer
try:
......@@ -46,23 +45,8 @@ except ImportError:
# Python 3.2 compatibility
import imp as _imp
PY3 = sys.version_info > (3,)
PY2 = not PY3
if PY3:
from urllib.parse import urlparse, urlunparse
if PY2:
from urlparse import urlparse, urlunparse
filter = itertools.ifilter
map = itertools.imap
if PY3:
string_types = str,
else:
string_types = str, eval('unicode')
iteritems = (lambda i: i.items()) if PY3 else lambda i: i.iteritems()
from pkg_resources.extern import six
from pkg_resources.extern.six.moves import urllib
# capture these to bypass sandboxing
from os import utime
......@@ -87,18 +71,15 @@ try:
except ImportError:
pass
try:
import pkg_resources._vendor.packaging.version
import pkg_resources._vendor.packaging.specifiers
import pkg_resources._vendor.packaging.requirements
import pkg_resources._vendor.packaging.markers
packaging = pkg_resources._vendor.packaging
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import packaging.version
import packaging.specifiers
from pkg_resources.extern import packaging
__import__('pkg_resources.extern.packaging.version')
__import__('pkg_resources.extern.packaging.specifiers')
__import__('pkg_resources._vendor.packaging.requirements')
__import__('pkg_resources._vendor.packaging.markers')
filter = six.moves.filter
map = six.moves.map
if (3, 0) < sys.version_info < (3, 3):
msg = (
......@@ -557,7 +538,7 @@ run_main = run_script
def get_distribution(dist):
"""Return a current distribution object for a Requirement or string"""
if isinstance(dist, string_types):
if isinstance(dist, six.string_types):
dist = Requirement.parse(dist)
if isinstance(dist, Requirement):
dist = get_provider(dist)
......@@ -2134,7 +2115,7 @@ def _set_parent_ns(packageName):
def yield_lines(strs):
"""Yield non-empty/non-comment lines of a string or sequence"""
if isinstance(strs, string_types):
if isinstance(strs, six.string_types):
for s in strs.splitlines():
s = s.strip()
# skip blank lines/comments
......@@ -2289,9 +2270,9 @@ class EntryPoint(object):
def _remove_md5_fragment(location):
if not location:
return ''
parsed = urlparse(location)
parsed = urllib.parse.urlparse(location)
if parsed[-1].startswith('md5='):
return urlunparse(parsed[:-1] + ('',))
return urllib.parse.urlunparse(parsed[:-1] + ('',))
return location
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment