Commit 06872bb0 authored by Jason R. Coombs's avatar Jason R. Coombs

Update vendoring technique to match that used for packaging. Ref #229.

--HG--
branch : feature/issue-229
parent 29fa0162
......@@ -3,5 +3,9 @@ empty:
update-vendored:
rm -rf pkg_resources/_vendor/packaging
pip install -r pkg_resources/_vendor/vendored.txt -t pkg_resources/_vendor/
python3.5 -m pip install -r pkg_resources/_vendor/vendored.txt -t pkg_resources/_vendor/
rm -rf pkg_resources/_vendor/*.{egg,dist}-info
rm -rf setuptools/_vendor/six
python3.5 -m pip install -r setuptools/_vendor/vendored.txt -t setuptools/_vendor/
rm -rf setuptools/_vendor/*.{egg,dist}-info
......@@ -14,8 +14,6 @@ from pkg_resources import (parse_requirements, VersionConflict, parse_version,
packaging = pkg_resources.packaging
import six
def safe_repr(obj, short=False):
""" copied from Python2.7"""
try:
......@@ -315,7 +313,7 @@ class TestEntryPoints:
def checkSubMap(self, m):
assert len(m) == len(self.submap_expect)
for key, ep in six.iteritems(self.submap_expect):
for key, ep in self.submap_expect.items():
assert repr(m.get(key)) == repr(ep)
submap_expect = dict(
......
......@@ -148,9 +148,6 @@ setup_params = dict(
Topic :: System :: Systems Administration
Topic :: Utilities
""").strip().splitlines(),
install_requires=[
'six>=1.5',
],
extras_require={
"ssl:sys_platform=='win32'": "wincertstore==0.2",
"certs": "certifi==2015.11.20",
......
"""Extensions to the 'distutils' for large or complex distributions"""
__import__('setuptools.bootstrap').bootstrap.ensure_deps()
import os
import functools
import distutils.core
......@@ -10,7 +8,12 @@ from distutils.core import Command as _Command
from distutils.util import convert_path
from fnmatch import fnmatchcase
from six.moves import filterfalse
try:
from setuptools._vendor.six.moves import filterfalse
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
from six.moves import filterfalse
import setuptools.version
from setuptools.extension import Extension
......
This diff is collapsed.
"""
When setuptools is installed in a clean environment, it doesn't have its
dependencies, so it can't run to install its dependencies. This module
checks those dependencies and if one or more are missing, it uses vendored
versions.
"""
import os
import sys
import glob
def ensure_deps():
"""
Detect if dependencies are installed and if not, use vendored versions.
"""
try:
__import__('six')
except ImportError:
use_vendor_deps()
def use_vendor_deps():
"""
Use vendored versions
"""
here = os.path.dirname(__file__)
eggs = glob.glob(here + '/_vendor/*.egg')
sys.path.extend(eggs)
......@@ -11,7 +11,12 @@ import os
import marshal
import textwrap
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from pkg_resources import get_build_platform, Distribution, ensure_directory
from pkg_resources import EntryPoint
......
......@@ -5,7 +5,12 @@ import os
import glob
import io
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_install
......
......@@ -40,8 +40,14 @@ import subprocess
import shlex
import io
import six
from six.moves import configparser
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import configparser
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import configparser
from setuptools import Command
from setuptools.sandbox import run_setup
......
......@@ -14,7 +14,12 @@ import io
import warnings
import time
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from setuptools import Command
from setuptools.command.sdist import sdist
......
......@@ -3,7 +3,12 @@ from distutils import log
from distutils.errors import DistutilsOptionError
import os
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from setuptools import Command
......
......@@ -5,7 +5,12 @@ import os
import sys
import io
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from setuptools.utils import cs_path_exists
......
......@@ -4,7 +4,12 @@ from distutils.errors import DistutilsOptionError
import distutils
import os
from six.moves import configparser
try:
from setuptools._vendor.six.moves import configparser
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
from six.moves import configparser
from setuptools import Command
......
......@@ -2,7 +2,12 @@ from distutils.errors import DistutilsOptionError
from unittest import TestLoader
import sys
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages,
......
......@@ -16,8 +16,14 @@ import tempfile
import sys
import shutil
from six.moves import http_client, urllib
import six
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import http_client, urllib
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import http_client, urllib
from pkg_resources import iter_entry_points
......
......@@ -4,7 +4,12 @@ import marshal
from imp import PKG_DIRECTORY, PY_COMPILED, PY_SOURCE, PY_FROZEN
from distutils.version import StrictVersion
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
__all__ = [
'Require', 'find_module', 'get_module_constant', 'extract_constant'
......
......@@ -13,7 +13,12 @@ from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from setuptools.depends import Require
from setuptools import windows_support
......
......@@ -14,8 +14,14 @@ try:
except ImportError:
from urllib2 import splituser
import six
from six.moves import urllib, http_client, configparser
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import urllib, http_client, configparser
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import urllib, http_client, configparser
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
......
......@@ -8,8 +8,14 @@ import re
import contextlib
import pickle
import six
from six.moves import builtins
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import builtins
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import builtins
import pkg_resources
......
......@@ -3,7 +3,12 @@ import socket
import atexit
import re
from six.moves import urllib, http_client
try:
from setuptools._vendor.six.moves import urllib, http_client
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
from six.moves import urllib, http_client
import pkg_resources
from pkg_resources import ResolutionError, ExtractionError
......
......@@ -8,7 +8,12 @@ from distutils.errors import DistutilsSetupError
from distutils.core import Extension
from distutils.version import LooseVersion
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
import pytest
import setuptools.dist
......
......@@ -5,7 +5,12 @@ import sys
import contextlib
import site
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
@contextlib.contextmanager
......
......@@ -4,7 +4,13 @@
import time
import threading
from six.moves import BaseHTTPServer, SimpleHTTPServer
try:
from setuptools._vendor.six.moves import BaseHTTPServer, SimpleHTTPServer
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
from six.moves import BaseHTTPServer, SimpleHTTPServer
class IndexServer(BaseHTTPServer.HTTPServer):
"""Basic single-threaded http server simulating a package index
......
......@@ -3,7 +3,6 @@
import os
import re
import six
import pytest
from setuptools.dist import Distribution
......
......@@ -5,7 +5,12 @@ import site
import sys
import io
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
import pytest
......
......@@ -16,8 +16,15 @@ import itertools
import distutils.errors
import io
import six
from six.moves import urllib
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import urllib
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import urllib
import pytest
try:
from unittest import mock
......
......@@ -7,7 +7,13 @@ import glob
import os
import sys
from six.moves import urllib
try:
from setuptools._vendor.six.moves import urllib
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
from six.moves import urllib
import pytest
......
......@@ -4,8 +4,14 @@ import sys
import os
import distutils.errors
import six
from six.moves import urllib, http_client
try:
from setuptools._vendor import six
from setuptools._vendor.six.moves import urllib, http_client
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
from six.moves import urllib, http_client
from .textwrap import DALS
import pkg_resources
......
......@@ -9,7 +9,13 @@ import unicodedata
import contextlib
import io
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
import pytest
import pkg_resources
......
......@@ -6,7 +6,6 @@ import os
import site
from distutils.errors import DistutilsError
import six
import pytest
from setuptools.command.test import test
......
import unicodedata
import sys
import six
try:
from setuptools._vendor import six
except ImportError:
# fallback to naturally-installed version; allows system packagers to
# omit vendored packages.
import six
# HFS Plus uses decomposed UTF-8
def decompose(path):
......
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