Commit 089cdeb4 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #933 from pypa/feature/581-depend-not-bundle

Bundle dependencies instead of vendoring them
parents aaec654d 11676d39
......@@ -13,3 +13,4 @@ setuptools.egg-info
*.swp
*~
.hg*
requirements.txt
......@@ -15,7 +15,8 @@ matrix:
- python: 2.7
env: LC_ALL=C LC_CTYPE=C
script:
- pip install tox
# need tox and rwt to get started
- pip install tox rwt
# Output the env, to verify behavior
- env
......@@ -23,7 +24,6 @@ script:
# update egg_info based on setup.py in checkout
- python bootstrap.py
#- python -m tox
- tox
deploy:
......
v34.0.0
-------
* #581: Instead of vendoring the growing list of
dependencies that Setuptools requires to function,
Setuptools now requires these dependencies just like
any other project. Unlike other projects, however,
Setuptools cannot rely on ``setup_requires`` to
demand the dependencies it needs to install because
its own machinery would be necessary to pull those
dependencies if not present (a bootstrapping problem).
As a result, Setuptools no longer supports self upgrade or
installation in the general case. Instead, users are
directed to use pip to install and upgrade using the
``wheel`` distributions of setuptools.
Users are welcome to contrive other means to install
or upgrade Setuptools using other means, such as
pre-installing the Setuptools dependencies with pip
or a bespoke bootstrap tool, but such usage is not
recommended and is not supported.
v33.1.1
-------
......
......@@ -5,11 +5,20 @@ environment by creating a minimal egg-info directory and then invoking the
egg-info command to flesh out the egg-info directory.
"""
from __future__ import unicode_literals
import os
import io
import re
import contextlib
import tempfile
import shutil
import sys
import textwrap
import subprocess
import pip
minimal_egg_info = textwrap.dedent("""
[distutils.commands]
egg_info = setuptools.command.egg_info:egg_info
......@@ -40,7 +49,8 @@ def build_egg_info():
"""
os.mkdir('setuptools.egg-info')
with open('setuptools.egg-info/entry_points.txt', 'w') as ep:
filename = 'setuptools.egg-info/entry_points.txt'
with io.open(filename, 'w', encoding='utf-8') as ep:
ep.write(minimal_egg_info)
......@@ -52,6 +62,35 @@ def run_egg_info():
subprocess.check_call(cmd)
def gen_deps():
with io.open('setup.py', encoding='utf-8') as strm:
text = strm.read()
pattern = r'install_requires=\[(.*?)\]'
match = re.search(pattern, text, flags=re.M|re.DOTALL)
reqs = eval(match.group(1).replace('\n', ''))
with io.open('requirements.txt', 'w', encoding='utf-8') as reqs_file:
reqs_file.write('\n'.join(reqs))
@contextlib.contextmanager
def install_deps():
"Just in time make the deps available"
gen_deps()
tmpdir = tempfile.mkdtemp()
args = [
'install',
'-t', tmpdir,
'-r', 'requirements.txt',
]
pip.main(args)
os.environ['PYTHONPATH'] = tmpdir
try:
yield tmpdir
finally:
shutil.rmtree(tmpdir)
if __name__ == '__main__':
ensure_egg_info()
run_egg_info()
with install_deps():
run_egg_info()
import re
from paver.easy import task, path as Path
import pip
def remove_all(paths):
for path in paths:
path.rmtree() if path.isdir() else path.remove()
@task
def update_vendored():
vendor = Path('pkg_resources/_vendor')
# pip uninstall doesn't support -t, so do it manually
remove_all(vendor.glob('packaging*'))
remove_all(vendor.glob('six*'))
remove_all(vendor.glob('pyparsing*'))
remove_all(vendor.glob('appdirs*'))
install_args = [
'install',
'-r', str(vendor / 'vendored.txt'),
'-t', str(vendor),
]
pip.main(install_args)
packaging = vendor / 'packaging'
for file in packaging.glob('*.py'):
text = file.text()
text = re.sub(r' (pyparsing|six)', r' pkg_resources.extern.\1', text)
file.write_text(text)
remove_all(vendor.glob('*.dist-info'))
remove_all(vendor.glob('*.egg-info'))
......@@ -45,8 +45,8 @@ except ImportError:
# Python 3.2 compatibility
import imp as _imp
from pkg_resources.extern import six
from pkg_resources.extern.six.moves import urllib, map, filter
import six
from six.moves import urllib, map, filter
# capture these to bypass sandboxing
from os import utime
......@@ -67,12 +67,11 @@ try:
except ImportError:
importlib_machinery = None
from pkg_resources.extern import appdirs
from pkg_resources.extern import packaging
__import__('pkg_resources.extern.packaging.version')
__import__('pkg_resources.extern.packaging.specifiers')
__import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers')
import packaging.version
import packaging.specifiers
import packaging.requirements
import packaging.markers
import appdirs
if (3, 0) < sys.version_info < (3, 3):
raise RuntimeError("Python 3.3 or later is required")
......
This diff is collapsed.
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
__title__ = "packaging"
__summary__ = "Core utilities for Python packages"
__uri__ = "https://github.com/pypa/packaging"
__version__ = "16.8"
__author__ = "Donald Stufft and individual contributors"
__email__ = "donald@stufft.io"
__license__ = "BSD or Apache License, Version 2.0"
__copyright__ = "Copyright 2014-2016 %s" % __author__
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
__all__ = [
"__title__", "__summary__", "__uri__", "__version__", "__author__",
"__email__", "__license__", "__copyright__",
]
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
# flake8: noqa
if PY3:
string_types = str,
else:
string_types = basestring,
def with_metaclass(meta, *bases):
"""
Create a base class with a metaclass.
"""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {})
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
class Infinity(object):
def __repr__(self):
return "Infinity"
def __hash__(self):
return hash(repr(self))
def __lt__(self, other):
return False
def __le__(self, other):
return False
def __eq__(self, other):
return isinstance(other, self.__class__)
def __ne__(self, other):
return not isinstance(other, self.__class__)
def __gt__(self, other):
return True
def __ge__(self, other):
return True
def __neg__(self):
return NegativeInfinity
Infinity = Infinity()
class NegativeInfinity(object):
def __repr__(self):
return "-Infinity"
def __hash__(self):
return hash(repr(self))
def __lt__(self, other):
return True
def __le__(self, other):
return True
def __eq__(self, other):
return isinstance(other, self.__class__)
def __ne__(self, other):
return not isinstance(other, self.__class__)
def __gt__(self, other):
return False
def __ge__(self, other):
return False
def __neg__(self):
return Infinity
NegativeInfinity = NegativeInfinity()
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import operator
import os
import platform
import sys
from pkg_resources.extern.pyparsing import ParseException, ParseResults, stringStart, stringEnd
from pkg_resources.extern.pyparsing import ZeroOrMore, Group, Forward, QuotedString
from pkg_resources.extern.pyparsing import Literal as L # noqa
from ._compat import string_types
from .specifiers import Specifier, InvalidSpecifier
__all__ = [
"InvalidMarker", "UndefinedComparison", "UndefinedEnvironmentName",
"Marker", "default_environment",
]
class InvalidMarker(ValueError):
"""
An invalid marker was found, users should refer to PEP 508.
"""
class UndefinedComparison(ValueError):
"""
An invalid operation was attempted on a value that doesn't support it.
"""
class UndefinedEnvironmentName(ValueError):
"""
A name was attempted to be used that does not exist inside of the
environment.
"""
class Node(object):
def __init__(self, value):
self.value = value
def __str__(self):
return str(self.value)
def __repr__(self):
return "<{0}({1!r})>".format(self.__class__.__name__, str(self))
def serialize(self):
raise NotImplementedError
class Variable(Node):
def serialize(self):
return str(self)
class Value(Node):
def serialize(self):
return '"{0}"'.format(self)
class Op(Node):
def serialize(self):
return str(self)
VARIABLE = (
L("implementation_version") |
L("platform_python_implementation") |
L("implementation_name") |
L("python_full_version") |
L("platform_release") |
L("platform_version") |
L("platform_machine") |
L("platform_system") |
L("python_version") |
L("sys_platform") |
L("os_name") |
L("os.name") | # PEP-345
L("sys.platform") | # PEP-345
L("platform.version") | # PEP-345
L("platform.machine") | # PEP-345
L("platform.python_implementation") | # PEP-345
L("python_implementation") | # undocumented setuptools legacy
L("extra")
)
ALIASES = {
'os.name': 'os_name',
'sys.platform': 'sys_platform',
'platform.version': 'platform_version',
'platform.machine': 'platform_machine',
'platform.python_implementation': 'platform_python_implementation',
'python_implementation': 'platform_python_implementation'
}
VARIABLE.setParseAction(lambda s, l, t: Variable(ALIASES.get(t[0], t[0])))
VERSION_CMP = (
L("===") |
L("==") |
L(">=") |
L("<=") |
L("!=") |
L("~=") |
L(">") |
L("<")
)
MARKER_OP = VERSION_CMP | L("not in") | L("in")
MARKER_OP.setParseAction(lambda s, l, t: Op(t[0]))
MARKER_VALUE = QuotedString("'") | QuotedString('"')
MARKER_VALUE.setParseAction(lambda s, l, t: Value(t[0]))
BOOLOP = L("and") | L("or")
MARKER_VAR = VARIABLE | MARKER_VALUE
MARKER_ITEM = Group(MARKER_VAR + MARKER_OP + MARKER_VAR)
MARKER_ITEM.setParseAction(lambda s, l, t: tuple(t[0]))
LPAREN = L("(").suppress()
RPAREN = L(")").suppress()
MARKER_EXPR = Forward()
MARKER_ATOM = MARKER_ITEM | Group(LPAREN + MARKER_EXPR + RPAREN)
MARKER_EXPR << MARKER_ATOM + ZeroOrMore(BOOLOP + MARKER_EXPR)
MARKER = stringStart + MARKER_EXPR + stringEnd
def _coerce_parse_result(results):
if isinstance(results, ParseResults):
return [_coerce_parse_result(i) for i in results]
else:
return results
def _format_marker(marker, first=True):
assert isinstance(marker, (list, tuple, string_types))
# Sometimes we have a structure like [[...]] which is a single item list
# where the single item is itself it's own list. In that case we want skip
# the rest of this function so that we don't get extraneous () on the
# outside.
if (isinstance(marker, list) and len(marker) == 1 and
isinstance(marker[0], (list, tuple))):
return _format_marker(marker[0])
if isinstance(marker, list):
inner = (_format_marker(m, first=False) for m in marker)
if first:
return " ".join(inner)
else:
return "(" + " ".join(inner) + ")"
elif isinstance(marker, tuple):
return " ".join([m.serialize() for m in marker])
else:
return marker
_operators = {
"in": lambda lhs, rhs: lhs in rhs,
"not in": lambda lhs, rhs: lhs not in rhs,
"<": operator.lt,
"<=": operator.le,
"==": operator.eq,
"!=": operator.ne,
">=": operator.ge,
">": operator.gt,
}
def _eval_op(lhs, op, rhs):
try:
spec = Specifier("".join([op.serialize(), rhs]))
except InvalidSpecifier:
pass
else:
return spec.contains(lhs)
oper = _operators.get(op.serialize())
if oper is None:
raise UndefinedComparison(
"Undefined {0!r} on {1!r} and {2!r}.".format(op, lhs, rhs)
)
return oper(lhs, rhs)
_undefined = object()
def _get_env(environment, name):
value = environment.get(name, _undefined)
if value is _undefined:
raise UndefinedEnvironmentName(
"{0!r} does not exist in evaluation environment.".format(name)
)
return value
def _evaluate_markers(markers, environment):
groups = [[]]
for marker in markers:
assert isinstance(marker, (list, tuple, string_types))
if isinstance(marker, list):
groups[-1].append(_evaluate_markers(marker, environment))
elif isinstance(marker, tuple):
lhs, op, rhs = marker
if isinstance(lhs, Variable):
lhs_value = _get_env(environment, lhs.value)
rhs_value = rhs.value
else:
lhs_value = lhs.value
rhs_value = _get_env(environment, rhs.value)
groups[-1].append(_eval_op(lhs_value, op, rhs_value))
else:
assert marker in ["and", "or"]
if marker == "or":
groups.append([])
return any(all(item) for item in groups)
def format_full_version(info):
version = '{0.major}.{0.minor}.{0.micro}'.format(info)
kind = info.releaselevel
if kind != 'final':
version += kind[0] + str(info.serial)
return version
def default_environment():
if hasattr(sys, 'implementation'):
iver = format_full_version(sys.implementation.version)
implementation_name = sys.implementation.name
else:
iver = '0'
implementation_name = ''
return {
"implementation_name": implementation_name,
"implementation_version": iver,
"os_name": os.name,
"platform_machine": platform.machine(),
"platform_release": platform.release(),
"platform_system": platform.system(),
"platform_version": platform.version(),
"python_full_version": platform.python_version(),
"platform_python_implementation": platform.python_implementation(),
"python_version": platform.python_version()[:3],
"sys_platform": sys.platform,
}
class Marker(object):
def __init__(self, marker):
try:
self._markers = _coerce_parse_result(MARKER.parseString(marker))
except ParseException as e:
err_str = "Invalid marker: {0!r}, parse error at {1!r}".format(
marker, marker[e.loc:e.loc + 8])
raise InvalidMarker(err_str)
def __str__(self):
return _format_marker(self._markers)
def __repr__(self):
return "<Marker({0!r})>".format(str(self))
def evaluate(self, environment=None):
"""Evaluate a marker.
Return the boolean from evaluating the given marker against the
environment. environment is an optional argument to override all or
part of the determined environment.
The environment is determined from the current Python process.
"""
current_environment = default_environment()
if environment is not None:
current_environment.update(environment)
return _evaluate_markers(self._markers, current_environment)
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import string
import re
from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
from pkg_resources.extern.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
from pkg_resources.extern.pyparsing import Literal as L # noqa
from pkg_resources.extern.six.moves.urllib import parse as urlparse
from .markers import MARKER_EXPR, Marker
from .specifiers import LegacySpecifier, Specifier, SpecifierSet
class InvalidRequirement(ValueError):
"""
An invalid requirement was found, users should refer to PEP 508.
"""
ALPHANUM = Word(string.ascii_letters + string.digits)
LBRACKET = L("[").suppress()
RBRACKET = L("]").suppress()
LPAREN = L("(").suppress()
RPAREN = L(")").suppress()
COMMA = L(",").suppress()
SEMICOLON = L(";").suppress()
AT = L("@").suppress()
PUNCTUATION = Word("-_.")
IDENTIFIER_END = ALPHANUM | (ZeroOrMore(PUNCTUATION) + ALPHANUM)
IDENTIFIER = Combine(ALPHANUM + ZeroOrMore(IDENTIFIER_END))
NAME = IDENTIFIER("name")
EXTRA = IDENTIFIER
URI = Regex(r'[^ ]+')("url")
URL = (AT + URI)
EXTRAS_LIST = EXTRA + ZeroOrMore(COMMA + EXTRA)
EXTRAS = (LBRACKET + Optional(EXTRAS_LIST) + RBRACKET)("extras")
VERSION_PEP440 = Regex(Specifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_LEGACY = Regex(LegacySpecifier._regex_str, re.VERBOSE | re.IGNORECASE)
VERSION_ONE = VERSION_PEP440 ^ VERSION_LEGACY
VERSION_MANY = Combine(VERSION_ONE + ZeroOrMore(COMMA + VERSION_ONE),
joinString=",", adjacent=False)("_raw_spec")
_VERSION_SPEC = Optional(((LPAREN + VERSION_MANY + RPAREN) | VERSION_MANY))
_VERSION_SPEC.setParseAction(lambda s, l, t: t._raw_spec or '')
VERSION_SPEC = originalTextFor(_VERSION_SPEC)("specifier")
VERSION_SPEC.setParseAction(lambda s, l, t: t[1])
MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
MARKER_EXPR.setParseAction(
lambda s, l, t: Marker(s[t._original_start:t._original_end])
)
MARKER_SEPERATOR = SEMICOLON
MARKER = MARKER_SEPERATOR + MARKER_EXPR
VERSION_AND_MARKER = VERSION_SPEC + Optional(MARKER)
URL_AND_MARKER = URL + Optional(MARKER)
NAMED_REQUIREMENT = \
NAME + Optional(EXTRAS) + (URL_AND_MARKER | VERSION_AND_MARKER)
REQUIREMENT = stringStart + NAMED_REQUIREMENT + stringEnd
class Requirement(object):
"""Parse a requirement.
Parse a given requirement string into its parts, such as name, specifier,
URL, and extras. Raises InvalidRequirement on a badly-formed requirement
string.
"""
# TODO: Can we test whether something is contained within a requirement?
# If so how do we do that? Do we need to test against the _name_ of
# the thing as well as the version? What about the markers?
# TODO: Can we normalize the name and extra name?
def __init__(self, requirement_string):
try:
req = REQUIREMENT.parseString(requirement_string)
except ParseException as e:
raise InvalidRequirement(
"Invalid requirement, parse error at \"{0!r}\"".format(
requirement_string[e.loc:e.loc + 8]))
self.name = req.name
if req.url:
parsed_url = urlparse.urlparse(req.url)
if not (parsed_url.scheme and parsed_url.netloc) or (
not parsed_url.scheme and not parsed_url.netloc):
raise InvalidRequirement("Invalid URL given")
self.url = req.url
else:
self.url = None
self.extras = set(req.extras.asList() if req.extras else [])
self.specifier = SpecifierSet(req.specifier)
self.marker = req.marker if req.marker else None
def __str__(self):
parts = [self.name]
if self.extras:
parts.append("[{0}]".format(",".join(sorted(self.extras))))
if self.specifier:
parts.append(str(self.specifier))
if self.url:
parts.append("@ {0}".format(self.url))
if self.marker:
parts.append("; {0}".format(self.marker))
return "".join(parts)
def __repr__(self):
return "<Requirement({0!r})>".format(str(self))
This diff is collapsed.
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import re
_canonicalize_regex = re.compile(r"[-_.]+")
def canonicalize_name(name):
# This is taken from PEP 503.
return _canonicalize_regex.sub("-", name).lower()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
packaging==16.8
pyparsing==2.1.10
six==1.10.0
appdirs==1.4.0
import sys
class VendorImporter:
"""
A PEP 302 meta path importer for finding optionally-vendored
or otherwise naturally-installed packages from root_name.
"""
def __init__(self, root_name, vendored_names=(), vendor_pkg=None):
self.root_name = root_name
self.vendored_names = set(vendored_names)
self.vendor_pkg = vendor_pkg or root_name.replace('extern', '_vendor')
@property
def search_path(self):
"""
Search first the vendor package then as a natural package.
"""
yield self.vendor_pkg + '.'
yield ''
def find_module(self, fullname, path=None):
"""
Return self when fullname starts with root_name and the
target module is one vendored through this importer.
"""
root, base, target = fullname.partition(self.root_name + '.')
if root:
return
if not any(map(target.startswith, self.vendored_names)):
return
return self
def load_module(self, fullname):
"""
Iterate over the search path to locate and load fullname.
"""
root, base, target = fullname.partition(self.root_name + '.')
for prefix in self.search_path:
try:
extant = prefix + target
__import__(extant)
mod = sys.modules[extant]
sys.modules[fullname] = mod
# mysterious hack:
# Remove the reference to the extant package/module
# on later Python versions to cause relative imports
# in the vendor package to resolve the same modules
# as those going through this importer.
if sys.version_info > (3, 3):
del sys.modules[extant]
return mod
except ImportError:
pass
else:
raise ImportError(
"The '{target}' package is required; "
"normally this is bundled with this package so if you get "
"this warning, consult the packager of your "
"distribution.".format(**locals())
)
def install(self):
"""
Install this importer into sys.meta_path if not already present.
"""
if self not in sys.meta_path:
sys.meta_path.append(self)
names = 'packaging', 'pyparsing', 'six', 'appdirs'
VendorImporter(__name__, names).install()
......@@ -12,7 +12,7 @@ import stat
import distutils.dist
import distutils.command.install_egg_info
from pkg_resources.extern.six.moves import map
from six.moves import map
import pytest
......
......@@ -5,10 +5,10 @@ import sys
import string
import platform
from pkg_resources.extern.six.moves import map
from six.moves import map
import pytest
from pkg_resources.extern import packaging
import packaging
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
......
[build-system]
# for Setuptools, its own requirements are build requirements,
# so keep this in sync with install_requires in setup.py.
requires = [
"wheel",
"packaging>=16.8",
"six>=1.10.0",
"appdirs>=1.4.0",
]
......@@ -16,7 +16,10 @@ here = os.path.dirname(__file__)
def require_metadata():
"Prevent improper installs without necessary metadata. See #659"
if not os.path.exists('setuptools.egg-info'):
msg = "Cannot build setuptools without metadata. Run bootstrap.py"
msg = (
"Cannot build setuptools without metadata. "
"Install rwt and run `rwt -- bootstrap.py`."
)
raise RuntimeError(msg)
......@@ -159,6 +162,11 @@ setup_params = dict(
Topic :: Utilities
""").strip().splitlines(),
python_requires='>=2.6,!=3.0.*,!=3.1.*,!=3.2.*',
install_requires=[
'packaging>=16.8',
'six>=1.10.0',
'appdirs>=1.4.0',
],
extras_require={
"ssl:sys_platform=='win32'": "wincertstore==0.2",
"certs": "certifi==2016.9.26",
......
......@@ -7,7 +7,7 @@ import distutils.filelist
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools.extern.six.moves import filter, map
from six.moves import filter, map
import setuptools.version
from setuptools.extension import Extension
......
from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
......
......@@ -11,7 +11,7 @@ import os
import textwrap
import marshal
from setuptools.extern import six
import six
from pkg_resources import get_build_platform, Distribution, ensure_directory
from pkg_resources import EntryPoint
......
......@@ -10,7 +10,7 @@ from distutils.errors import DistutilsError
from distutils import log
from setuptools.extension import Library
from setuptools.extern import six
import six
try:
# Attempt to use Cython for building extensions, if available
......
......@@ -8,8 +8,8 @@ import io
import distutils.errors
import itertools
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter, filterfalse
import six
from six.moves import map, filter, filterfalse
try:
from setuptools.lib2to3_ex import Mixin2to3
......
......@@ -5,7 +5,7 @@ import os
import glob
import io
from setuptools.extern import six
import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_install
......
......@@ -40,8 +40,8 @@ import subprocess
import shlex
import io
from setuptools.extern import six
from setuptools.extern.six.moves import configparser, map
import six
from six.moves import configparser, map
from setuptools import Command
from setuptools.sandbox import run_setup
......
......@@ -16,8 +16,8 @@ import warnings
import time
import collections
from setuptools.extern import six
from setuptools.extern.six.moves import map
import six
from six.moves import map
from setuptools import Command
from setuptools.command.sdist import sdist
......@@ -30,7 +30,7 @@ from pkg_resources import (
import setuptools.unicode_utils as unicode_utils
from setuptools.glob import glob
from pkg_resources.extern import packaging
import packaging
def translate_pattern(glob):
......
......@@ -3,7 +3,7 @@ from glob import glob
from distutils.util import convert_path
from distutils.command import sdist
from setuptools.extern.six.moves import filter
from six.moves import filter
class sdist_add_defaults:
......
......@@ -4,7 +4,7 @@ from distutils.errors import DistutilsOptionError
import os
import shutil
from setuptools.extern import six
import six
from setuptools import Command
......
......@@ -5,7 +5,7 @@ import sys
import io
import contextlib
from setuptools.extern import six
import six
from .py36compat import sdist_add_defaults
......
......@@ -4,7 +4,7 @@ from distutils.errors import DistutilsOptionError
import distutils
import os
from setuptools.extern.six.moves import configparser
from six.moves import configparser
from setuptools import Command
......
......@@ -7,8 +7,8 @@ from distutils.errors import DistutilsError, DistutilsOptionError
from distutils import log
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map, filter
import six
from six.moves import map, filter
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_packages,
......
......@@ -16,8 +16,8 @@ import shutil
import itertools
import functools
from setuptools.extern import six
from setuptools.extern.six.moves import http_client, urllib
import six
from six.moves import http_client, urllib
from pkg_resources import iter_entry_points
from .upload import upload
......
......@@ -7,7 +7,7 @@ from functools import partial
from distutils.errors import DistutilsOptionError, DistutilsFileError
from setuptools.py26compat import import_module
from setuptools.extern.six import string_types
from six import string_types
def read_configuration(
......
......@@ -12,9 +12,9 @@ from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
DistutilsSetupError)
from distutils.util import rfc822_escape
from setuptools.extern import six
from setuptools.extern.six.moves import map
from pkg_resources.extern import packaging
import six
from six.moves import map
import packaging
from setuptools.depends import Require
from setuptools import windows_support
......
......@@ -4,7 +4,7 @@ import distutils.core
import distutils.errors
import distutils.extension
from setuptools.extern.six.moves import map
from six.moves import map
from .monkey import get_unpatched
......
from pkg_resources.extern import VendorImporter
names = 'six',
VendorImporter(__name__, names, 'pkg_resources._vendor').install()
......@@ -10,7 +10,7 @@ Changes include:
import os
import re
import fnmatch
from setuptools.extern.six import binary_type
from six import binary_type
__all__ = ["glob", "iglob", "escape"]
......
......@@ -10,7 +10,7 @@ import functools
import inspect
from .py26compat import import_module
from setuptools.extern import six
import six
import setuptools
......
......@@ -20,14 +20,14 @@ import sys
import platform
import itertools
import distutils.errors
from pkg_resources.extern.packaging.version import LegacyVersion
from packaging.version import LegacyVersion
from setuptools.extern.six.moves import filterfalse
from six.moves import filterfalse
from .monkey import get_unpatched
if platform.system() == 'Windows':
from setuptools.extern.six.moves import winreg
from six.moves import winreg
safe_env = os.environ
else:
"""
......
......@@ -2,7 +2,7 @@ import os
from distutils import log
import itertools
from setuptools.extern.six.moves import map
from six.moves import map
flatten = itertools.chain.from_iterable
......
......@@ -14,8 +14,8 @@ try:
except ImportError:
from urllib2 import splituser
from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client, configparser, map
import six
from six.moves import urllib, http_client, configparser, map
import setuptools
from pkg_resources import (
......
......@@ -2,7 +2,7 @@ import dis
import array
import collections
from setuptools.extern import six
import six
OpArg = collections.namedtuple('OpArg', 'opcode arg')
......
......@@ -8,8 +8,8 @@ import re
import contextlib
import pickle
from setuptools.extern import six
from setuptools.extern.six.moves import builtins, map
import six
from six.moves import builtins, map
import pkg_resources
......
......@@ -4,7 +4,7 @@ import atexit
import re
import functools
from setuptools.extern.six.moves import urllib, http_client, map, filter
from six.moves import urllib, http_client, map, filter
from pkg_resources import ResolutionError, ExtractionError
......
......@@ -8,7 +8,7 @@ from distutils.errors import DistutilsSetupError
from distutils.core import Extension
from distutils.version import LooseVersion
from setuptools.extern import six
import six
import pytest
import setuptools.dist
......
......@@ -5,7 +5,7 @@ import sys
import contextlib
import site
from setuptools.extern import six
import six
import pkg_resources
......
......@@ -4,7 +4,7 @@
import time
import threading
from setuptools.extern.six.moves import BaseHTTPServer, SimpleHTTPServer
from six.moves import BaseHTTPServer, SimpleHTTPServer
class IndexServer(BaseHTTPServer.HTTPServer):
......
......@@ -3,7 +3,7 @@
import tarfile
import io
from setuptools.extern import six
import six
import pytest
......
......@@ -2,7 +2,7 @@ import sys
import distutils.command.build_ext as orig
from distutils.sysconfig import get_config_var
from setuptools.extern import six
import six
from setuptools.command.build_ext import build_ext, get_abi3_suffix
from setuptools.dist import Distribution
......
......@@ -9,7 +9,7 @@ import sys
import io
import subprocess
from setuptools.extern import six
import six
from setuptools.command import test
import pytest
......
......@@ -3,7 +3,7 @@
from __future__ import unicode_literals
from setuptools.extern.six.moves import map
from six.moves import map
import pytest
......
......@@ -16,7 +16,7 @@ import io
import zipfile
import time
from setuptools.extern.six.moves import urllib
from six.moves import urllib
import pytest
try:
......
......@@ -6,7 +6,7 @@ import sys
from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution
from setuptools.extern.six.moves import map
from six.moves import map
import pytest
......
......@@ -7,7 +7,7 @@ import glob
import os
import sys
from setuptools.extern.six.moves import urllib
from six.moves import urllib
import pytest
from setuptools.command.easy_install import easy_install
......
......@@ -11,7 +11,7 @@ from distutils.errors import DistutilsTemplateError
from setuptools.command.egg_info import FileList, egg_info, translate_pattern
from setuptools.dist import Distribution
from setuptools.extern import six
import six
from setuptools.tests.textwrap import DALS
import pytest
......
......@@ -4,8 +4,8 @@ import sys
import os
import distutils.errors
from setuptools.extern import six
from setuptools.extern.six.moves import urllib, http_client
import six
from six.moves import urllib, http_client
import pkg_resources
import setuptools.package_index
......
......@@ -9,8 +9,8 @@ import unicodedata
import contextlib
import io
from setuptools.extern import six
from setuptools.extern.six.moves import map
import six
from six.moves import map
import pytest
......
import unicodedata
import sys
from setuptools.extern import six
import six
# HFS Plus uses decomposed UTF-8
......
pytest-flake8
pytest>=3.0.2
setuptools[ssl]
backports.unittest_mock>=1.2
......@@ -2,8 +2,8 @@ import os
import subprocess
import virtualenv
from setuptools.extern.six.moves import http_client
from setuptools.extern.six.moves import xmlrpc_client
from six.moves import http_client
from six.moves import xmlrpc_client
TOP = 200
PYPI_HOSTNAME = 'pypi.python.org'
......
[testenv]
deps=-rtests/requirements.txt
deps=
-rtests/requirements.txt
-rrequirements.txt
passenv=APPDATA USERPROFILE HOMEDRIVE HOMEPATH windir APPVEYOR
commands=py.test {posargs:-rsx}
usedevelop=True
extras=ssl
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