From 375d875ee13469bb7e09051dcbf59b2258d19b82 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Fri, 21 Aug 2015 18:53:22 +0200 Subject: [PATCH 01/25] Fix typo in exception --- mypy/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/build.py b/mypy/build.py index bfe8886a5116f..41d1f5528e2d9 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -437,7 +437,7 @@ def lookup_state(self, module: str) -> 'State': for state in self.states: if state.id == module: return state - raise RuntimeError('%s not found' % str) + raise RuntimeError('%s not found' % module) def all_imported_modules_in_file(self, file: MypyFile) -> List[Tuple[str, int]]: From 5b69072ceac0a8eaf7d58a2f22a2337e33e2b556 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Tue, 4 Aug 2015 09:56:39 +0200 Subject: [PATCH 02/25] Catch incomplete TypeVisitor implementations Use the @abstractmethod decorator on abstract methods which are implemented in all subtypes. Part of #730 --- mypy/types.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mypy/types.py b/mypy/types.py index be03b4b2ad86b..fdb7d33a76a3d 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -492,6 +492,7 @@ class TypeVisitor(Generic[T]): The parameter T is the return type of the visit methods. """ + @abstractmethod def visit_unbound_type(self, t: UnboundType) -> T: pass @@ -501,41 +502,49 @@ def visit_type_list(self, t: TypeList) -> T: def visit_error_type(self, t: ErrorType) -> T: pass + @abstractmethod def visit_any(self, t: AnyType) -> T: pass + @abstractmethod def visit_void(self, t: Void) -> T: pass + @abstractmethod def visit_none_type(self, t: NoneTyp) -> T: pass def visit_erased_type(self, t: ErasedType) -> T: pass + @abstractmethod def visit_type_var(self, t: TypeVarType) -> T: pass + @abstractmethod def visit_instance(self, t: Instance) -> T: pass + @abstractmethod def visit_callable_type(self, t: CallableType) -> T: pass def visit_overloaded(self, t: Overloaded) -> T: pass + @abstractmethod def visit_tuple_type(self, t: TupleType) -> T: pass def visit_star_type(self, t: StarType) -> T: pass + @abstractmethod def visit_union_type(self, t: UnionType) -> T: pass def visit_ellipsis_type(self, t: EllipsisType) -> T: - assert False # XXX catch visitors that don't have this implemented yet + pass class TypeTranslator(TypeVisitor[Type]): From 19c922be3a295f761902482931c385693a0188fb Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 24 Aug 2015 09:03:21 +0200 Subject: [PATCH 03/25] Raise error on unimplemented abstract method call This helps to point out the offending unimplemented abstract methods in subtypes. Part of #730. --- mypy/types.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mypy/types.py b/mypy/types.py index fdb7d33a76a3d..cd9f30cad5cab 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -492,15 +492,21 @@ class TypeVisitor(Generic[T]): The parameter T is the return type of the visit methods. """ + def _notimplemented_helper(self) -> NotImplementedError: + return NotImplementedError("Method visit_type_list not implemented in " + + "'{}'\n".format(type(self).__name__) + + "This is a known bug, track development in " + + "'https://github.com/JukkaL/mypy/issues/730'") + @abstractmethod def visit_unbound_type(self, t: UnboundType) -> T: pass def visit_type_list(self, t: TypeList) -> T: - pass + raise self._notimplemented_helper() def visit_error_type(self, t: ErrorType) -> T: - pass + raise self._notimplemented_helper() @abstractmethod def visit_any(self, t: AnyType) -> T: @@ -515,7 +521,7 @@ def visit_none_type(self, t: NoneTyp) -> T: pass def visit_erased_type(self, t: ErasedType) -> T: - pass + raise self._notimplemented_helper() @abstractmethod def visit_type_var(self, t: TypeVarType) -> T: @@ -530,21 +536,21 @@ def visit_callable_type(self, t: CallableType) -> T: pass def visit_overloaded(self, t: Overloaded) -> T: - pass + raise self._notimplemented_helper() @abstractmethod def visit_tuple_type(self, t: TupleType) -> T: pass def visit_star_type(self, t: StarType) -> T: - pass + raise self._notimplemented_helper() @abstractmethod def visit_union_type(self, t: UnionType) -> T: pass def visit_ellipsis_type(self, t: EllipsisType) -> T: - pass + raise self._notimplemented_helper() class TypeTranslator(TypeVisitor[Type]): From 2f2d84b3f8b2d0bf53f75da89b12139d8344d4d6 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Sun, 23 Aug 2015 15:02:57 +0200 Subject: [PATCH 04/25] Add SameTypeVisitor.visit_overloaded() implementation part of #730 --- mypy/sametypes.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mypy/sametypes.py b/mypy/sametypes.py index acb4e7c987c2b..7ea1a437a5c3d 100644 --- a/mypy/sametypes.py +++ b/mypy/sametypes.py @@ -2,7 +2,7 @@ from mypy.types import ( Type, UnboundType, ErrorType, AnyType, NoneTyp, Void, TupleType, UnionType, CallableType, - TypeVarType, Instance, TypeVisitor, ErasedType, TypeList + TypeVarType, Instance, TypeVisitor, ErasedType, TypeList, Overloaded ) @@ -91,3 +91,10 @@ def visit_union_type(self, left: UnionType) -> bool: return is_same_types(left.items, cast(UnionType, self.right).items) else: return False + + def visit_overloaded(self, left: Overloaded) -> bool: + if isinstance(self.right, Overloaded): + return is_same_types(cast(List[Type], left.items()), + cast(List[Type], cast(Overloaded, self.right).items())) + else: + return False From bf02a19443b257d5c5a981e1a9180885d0eab6b1 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 24 Aug 2015 09:08:35 +0200 Subject: [PATCH 05/25] Add visit_overloaded() to TypeTranslator. Part of #730. --- mypy/types.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mypy/types.py b/mypy/types.py index cd9f30cad5cab..ee05495c0825d 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -624,6 +624,10 @@ def translate_variables(self, variables: List[TypeVarDef]) -> List[TypeVarDef]: return variables + def visit_overloaded(self, type: Overloaded) -> Type: + items = [t.accept(self) for t in type.items()] # type: ignore + return Overloaded(items=cast(List[CallableType], items)) + class TypeStrVisitor(TypeVisitor[str]): """Visitor for pretty-printing types into strings. From 5502b38da6fc3b28e0d977526e2b2f2db525ebdb Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 24 Aug 2015 09:09:14 +0200 Subject: [PATCH 06/25] Add visit_overloaded() to TypeQuery Part of #730 --- mypy/types.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypy/types.py b/mypy/types.py index ee05495c0825d..7a5614670a7ea 100644 --- a/mypy/types.py +++ b/mypy/types.py @@ -824,6 +824,9 @@ def visit_star_type(self, t: StarType) -> bool: def visit_union_type(self, t: UnionType) -> bool: return self.query_types(t.items) + def visit_overloaded(self, t: Overloaded) -> bool: + return self.query_types(cast(List[Type], t.items())) + def query_types(self, types: List[Type]) -> bool: """Perform a query for a list of types. From d0bb829bbfdc238c1c47fe233cc945440d33f70b Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 24 Aug 2015 09:09:45 +0200 Subject: [PATCH 07/25] add visit_star_type() to TypeAnalyserPass3 Part of #730. --- mypy/typeanal.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mypy/typeanal.py b/mypy/typeanal.py index f51b301fc1317..a9d965ef15880 100644 --- a/mypy/typeanal.py +++ b/mypy/typeanal.py @@ -333,3 +333,6 @@ def visit_type_list(self, t: TypeList) -> None: def visit_type_var(self, t: TypeVarType) -> None: pass + + def visit_star_type(self, t: StarType) -> None: + pass From f577a25e365d4772f8d7cd4cc91aa29c05ed3405 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 24 Aug 2015 18:19:35 +0200 Subject: [PATCH 08/25] add visit_overloaded() to ConstraintBuilderVisitor Part of #730 --- mypy/constraints.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mypy/constraints.py b/mypy/constraints.py index e8794338c20d2..ba9136a33b22e 100644 --- a/mypy/constraints.py +++ b/mypy/constraints.py @@ -273,6 +273,12 @@ def infer_against_any(self, types: List[Type]) -> List[Constraint]: res.extend(infer_constraints(t, AnyType(), self.direction)) return res + def visit_overloaded(self, type: Overloaded) -> List[Constraint]: + res = [] # type: List[Constraint] + for t in type.items(): + res.extend(infer_constraints(t, self.actual, self.direction)) + return res + def negate_constraints(constraints: List[Constraint]) -> List[Constraint]: res = [] # type: List[Constraint] From cdab152af2904fe5ea7fd0a9b15ebd17b46c0751 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 1 Oct 2015 15:19:04 -0700 Subject: [PATCH 09/25] Add classes for better dialect control --- mypy/syntax/__init__.py | 1 + mypy/syntax/dialect.py | 127 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 mypy/syntax/__init__.py create mode 100644 mypy/syntax/dialect.py diff --git a/mypy/syntax/__init__.py b/mypy/syntax/__init__.py new file mode 100644 index 0000000000000..fa4000266849d --- /dev/null +++ b/mypy/syntax/__init__.py @@ -0,0 +1 @@ +# This page intentionally left blank diff --git a/mypy/syntax/dialect.py b/mypy/syntax/dialect.py new file mode 100644 index 0000000000000..0fd828effe27a --- /dev/null +++ b/mypy/syntax/dialect.py @@ -0,0 +1,127 @@ +"""Python dialect control. + +This may be incomplet or inkorrekt. + +Versions < 2.7 is not a priority. +Versions >= 3.0 and < 3.2 are not a priority. +Versions < 2.4 have many fundamental differences. +Versions < 2.2 have even more fundamental differences. +Versions 1.6 and 2.0 are not distinguished. +Versions < 1.6 are not even mentioned. +""" + + +from typing import ( + List, + Sequence, + Set, + Tuple, +) + +import os +import subprocess +import sys + + +# Maintain our own copy instead of using __future__ just in case we need +# to parse a newer version of python than we're running. +# Also we can add artificial ones. + +available_futures = { + # Internal pseudo-futures. + 'mypy-codec': '0.0', + 'mypy-stub': '0.0', + 'mypy-instring': '0.0', + + # Pseudo-futures from platform.python_implementation(). + # Note that only PyPy and CPython are tested. + 'variant-CPython': '0.0', + 'variant-PyPy': '0.0', + 'variant-Jython': '0.0', + 'variant-IronPython': '0.0', + + # Real features from the __future__ module. + 'nested_scopes': '2.1', + 'generators': '2.2', + 'division': '2.2', + 'absolute_import': '2.5', + 'with_statement': '2.5', + 'print_function': '2.6', + 'unicode_literals': '2.6', + 'barry_as_FLUFL': '3.1', +} + + +def check_futures(version: str, futures: Sequence[str]) -> Set[str]: + for fut in futures: + assert version >= available_futures[fut] + return set(futures) + + +class Dialect: + + def __init__(self, version: str, future_list: Sequence[str] = []) -> None: + """Construct a dialect for the given Python version and future set. + + `version` is like `'2.7.0'`, e.g. `platform.python_version()`. + `future_list` is like `['X', 'Y', 'Z']` in `from __future__ import X, Y, Z`. + """ + self.major, self.minor, self.patchlevel = [int(x) for x in version.split('.')] + future_set = check_futures(version, future_list) + self.base_version = version + self.base_future_list = future_list + self.base_future_set = future_set + + self.possible_futures = {k for (k, v) in available_futures.items() if v <= version} + + # Additional members will be set as needed by the lexer, parser, etc. + + def __repr__(self) -> str: + return 'Dialect(%r, %r)' % (self.base_version, self.base_future_list) + + def add_future(self, future: str) -> 'Dialect': + if future in self.base_future_set: + return self + return Dialect(self.base_version, self.base_future_list + [future]) + + +class Implementation: + + def __init__(self, executable: str) -> None: + command = '''if True: + import platform, sys + print((platform.python_implementation(), platform.python_version(), sys.path)) + ''' + output = subprocess.check_output([executable, '-c', command]) + impl, version, path = eval(output) # type: Tuple[str, str, List[str]] + + self.executable = executable + self.base_dialect = Dialect(version, ['variant-' + impl]) + self.stub_dialect = self.base_dialect.add_future('mypy-codec') + self.python_path = path + # TODO self.stub_path = [] + + +def default_implementation(*, force_py2: bool = False) -> Implementation: + """Return the preferred python implementation for the inferior. + + This looks at the MYPY_PYTHON environment variable, or else uses + the current python version. + + The `force_py2` argument should possibly be deprecated. + """ + if force_py2: + try_pythons = [os.getenv('MYPY_PYTHON'), 'python2', 'python2.7', 'python'] + else: + try_pythons = [os.getenv('MYPY_PYTHON'), sys.executable] + for python in try_pythons: + if python is None: + continue + try: + impl = Implementation(python) + except (OSError, subprocess.CalledProcessError): + pass + if force_py2 and impl.base_dialect.major != 2: + continue + return impl + sys.exit('No suitable python executable found') From d9bbbbfb3c5aa37fd9ada31b861789aaed1399ce Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 12 Oct 2015 17:31:23 -0700 Subject: [PATCH 10/25] Test that install actually works --- .travis.yml | 6 ++- mypy/build.py | 38 +++++++----------- mypy/main.py | 21 +--------- mypy/test/config.py | 4 +- mypy/test/helpers.py | 22 ---------- mypy/test/testpythoneval.py | 20 +++++++--- runtests.py | 80 ++++++++++++++++++++++++++----------- setup.py | 21 +++++++++- 8 files changed, 111 insertions(+), 101 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0b60e361e8892..c8ec76a98aceb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,13 @@ python: install: - pip install -r test-requirements.txt - - python setup.py install script: + - python setup.py install + - mkdir elsewhere + - cd elsewhere + - mkdir tmp-test-dirs + - ln -s ../runtests.py - python runtests.py -v notifications: diff --git a/mypy/build.py b/mypy/build.py index e611da81235e2..514aa4b3665f2 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -95,7 +95,6 @@ def build(program_path: str, argument: str = None, program_text: Union[str, bytes] = None, alt_lib_path: str = None, - bin_dir: str = None, pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, custom_typing_module: str = None, report_dirs: Dict[str, str] = {}, @@ -116,8 +115,6 @@ def build(program_path: str, program_text: the main source file contents; if omitted, read from file alt_lib_dir: an additional directory for looking up library modules (takes precedence over other directories) - bin_dir: directory containing the mypy script, used for finding data - directories; if omitted, use '.' as the data directory pyversion: Python version (major, minor) custom_typing_module: if not None, use this module id as an alias for typing flags: list of build options (e.g. COMPILE_ONLY) @@ -125,7 +122,7 @@ def build(program_path: str, flags = flags or [] module = module or '__main__' - data_dir = default_data_dir(bin_dir) + data_dir = default_data_dir() # Determine the default module search path. lib_path = default_lib_path(data_dir, target, pyversion, python_path) @@ -176,26 +173,19 @@ def build(program_path: str, return result -def default_data_dir(bin_dir: str) -> str: - # TODO fix this logic - if not bin_dir: - # Default to directory containing this file's parent. - return os.path.dirname(os.path.dirname(__file__)) - base = os.path.basename(bin_dir) - dir = os.path.dirname(bin_dir) - if (sys.platform == 'win32' and base.lower() == 'mypy' - and not os.path.isdir(os.path.join(dir, 'stubs'))): - # Installed, on Windows. - return os.path.join(dir, 'Lib', 'mypy') - elif base == 'mypy': - # Assume that we have a repo check out or unpacked source tarball. - return os.path.dirname(bin_dir) - elif base == 'bin': - # Installed to somewhere (can be under /usr/local or anywhere). - return os.path.join(dir, 'lib', 'mypy') - elif base == 'python3': - # Assume we installed python3 with brew on os x - return os.path.join(os.path.dirname(dir), 'lib', 'mypy') +def is_installed() -> bool: + return 'site-packages' in __file__ or 'dist-packages' in __file__ + + +def default_data_dir() -> str: + if is_installed(): + # we are installed + rv = os.path.join(sys.prefix, 'lib', 'mypy') + else: + # we are from from a source checkout + rv = os.path.dirname(os.path.dirname(__file__)) + if os.path.isdir(os.path.join(rv, 'stubs')): + return rv else: # Don't know where to find the data files! raise RuntimeError("Broken installation: can't determine base dir") diff --git a/mypy/main.py b/mypy/main.py index feaa2fcc8f4a5..0ca1e48a819ed 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -29,11 +29,10 @@ def __init__(self) -> None: def main() -> None: - bin_dir = find_bin_directory() path, module, program_text, options = process_options(sys.argv[1:]) try: if options.target == build.TYPE_CHECK: - type_check_only(path, module, program_text, bin_dir, options) + type_check_only(path, module, program_text, options) else: raise RuntimeError('unsupported target %d' % options.target) except CompileError as e: @@ -42,21 +41,6 @@ def main() -> None: sys.exit(1) -def find_bin_directory() -> str: - """Find the directory that contains this script. - - This is used by build to find stubs and other data files. - """ - script = __file__ - # Follow up to 5 symbolic links (cap to avoid cycles). - for i in range(5): - if os.path.islink(script): - script = readlinkabs(script) - else: - break - return os.path.dirname(script) - - def readlinkabs(link: str) -> str: """Return an absolute path to symbolic link destination.""" # Adapted from code by Greg Smith. @@ -68,12 +52,11 @@ def readlinkabs(link: str) -> str: def type_check_only(path: str, module: str, program_text: str, - bin_dir: str, options: Options) -> None: + options: Options) -> None: # Type check the program and dependencies and translate to Python. build.build(path, module=module, program_text=program_text, - bin_dir=bin_dir, target=build.TYPE_CHECK, pyversion=options.pyversion, custom_typing_module=options.custom_typing_module, diff --git a/mypy/test/config.py b/mypy/test/config.py index 83962d6972f84..27e9b3e962b82 100644 --- a/mypy/test/config.py +++ b/mypy/test/config.py @@ -4,10 +4,8 @@ import typing -PREFIX = '' - # Location of test data files such as test case descriptions. -test_data_prefix = os.path.join(PREFIX, 'mypy', 'test', 'data') +test_data_prefix = os.path.join(os.path.dirname(__file__), 'data') assert os.path.isdir(test_data_prefix), \ 'Test data prefix ({}) not set correctly'.format(test_data_prefix) diff --git a/mypy/test/helpers.py b/mypy/test/helpers.py index b6b1e5a850cf6..ddef334801a37 100644 --- a/mypy/test/helpers.py +++ b/mypy/test/helpers.py @@ -21,8 +21,6 @@ def assert_string_arrays_equal(expected: List[str], actual: List[str], Display any differences in a human-readable form. """ - actual = clean_up(actual) - if actual != expected: num_skip_start = num_skipped_prefix_lines(expected, actual) num_skip_end = num_skipped_suffix_lines(expected, actual) @@ -171,7 +169,6 @@ def assert_string_arrays_equal_wildcards(expected: List[str], msg: str) -> None: # Like above, but let a line with only '...' in expected match any number # of lines in actual. - actual = clean_up(actual) while actual != [] and actual[-1] == '': actual = actual[:-1] @@ -181,25 +178,6 @@ def assert_string_arrays_equal_wildcards(expected: List[str], assert_string_arrays_equal(expected, actual, msg) -def clean_up(a): - """Remove common directory prefix from all strings in a. - - This uses a naive string replace; it seems to work well enough. Also - remove trailing carriage returns. - """ - res = [] - for s in a: - prefix = config.PREFIX + os.sep - ss = s - for p in prefix, prefix.replace(os.sep, '/'): - if p != '/' and p != '//' and p != '\\' and p != '\\\\': - ss = ss.replace(p, '') - # Ignore spaces at end of line. - ss = re.sub(' +$', '', ss) - res.append(re.sub('\\r$', '', ss)) - return res - - def match_array(pattern: List[str], target: List[str]) -> List[str]: """Expand '...' wildcards in pattern by matching against target.""" diff --git a/mypy/test/testpythoneval.py b/mypy/test/testpythoneval.py index 07a4a0dc4f472..48f45b51c51b3 100644 --- a/mypy/test/testpythoneval.py +++ b/mypy/test/testpythoneval.py @@ -17,6 +17,7 @@ import typing +from mypy.build import is_installed from mypy.myunit import Suite, SkipTestCaseException from mypy.test.config import test_data_prefix, test_temp_dir from mypy.test.data import parse_test_cases @@ -72,7 +73,7 @@ def test_python_evaluation(testcase): # Type check the program. # This uses the same PYTHONPATH as the current process. process = subprocess.Popen([python3_path, - os.path.join(testcase.old_cwd, 'scripts', 'mypy')] + '-m', 'mypy'] + args + [program], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -83,11 +84,14 @@ def test_python_evaluation(testcase): if not process.wait(): # Set up module path for the execution. # This needs the typing module but *not* the mypy module. - vers_dir = '2.7' if py2 else '3.2' - typing_path = os.path.join(testcase.old_cwd, 'lib-typing', vers_dir) - assert os.path.isdir(typing_path) - env = os.environ.copy() - env['PYTHONPATH'] = typing_path + if is_installed(): + env = None + else: + vers_dir = '2.7' if py2 else '3.2' + typing_path = os.path.join(testcase.old_cwd, 'lib-typing', vers_dir) + assert os.path.isdir(typing_path) + env = os.environ.copy() + env['PYTHONPATH'] = typing_path process = subprocess.Popen([interpreter, program], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, @@ -110,6 +114,10 @@ def try_find_python2_interpreter(): stderr=subprocess.STDOUT) stdout, stderr = process.communicate() if b'Python 2.7' in stdout: + if is_installed(): + print('WARNING: python2 interpreter found, but' + ' typing is not installed for python2') + return None return interpreter except OSError: pass diff --git a/runtests.py b/runtests.py index 462fa1491369f..89a08e4c7f03a 100755 --- a/runtests.py +++ b/runtests.py @@ -6,7 +6,16 @@ if True: # When this is run as a script, `typing` is not available yet. import sys - from os.path import join, isdir + from os.path import ( + basename, + dirname, + isabs, + isdir, + join, + realpath, + relpath, + splitext, + ) def get_versions(): # type: () -> typing.List[str] major = sys.version_info[0] @@ -31,6 +40,10 @@ def get_versions(): # type: () -> typing.List[str] import os +# Allow this to be symlinked to support running an installed version. +SOURCE_DIR = dirname(realpath(__file__)) + + # Ideally, all tests would be `discover`able so that they can be driven # (and parallelized) by an external test driver. @@ -45,7 +58,6 @@ def __init__(self, whitelist: List[str], blacklist: List[str], self.waiter = Waiter(verbosity=verbosity, xfail=xfail) self.versions = get_versions() self.cwd = os.getcwd() - self.mypy = os.path.join(self.cwd, 'scripts', 'mypy') self.env = dict(os.environ) def prepend_path(self, name: str, paths: List[str]) -> None: @@ -74,7 +86,7 @@ def add_mypy(self, name: str, *args: str, cwd: Optional[str] = None) -> None: if not self.allow(name): return largs = list(args) - largs[0:0] = [sys.executable, self.mypy] + largs[0:0] = ['mypy', '--use-python-path'] env = self.env self.waiter.add(LazySubprocess(name, largs, cwd=cwd, env=env)) @@ -96,7 +108,7 @@ def add_mypy_mod(self, name: str, *args: str, cwd: Optional[str] = None) -> None if not self.allow(name): return largs = list(args) - largs[0:0] = [sys.executable, self.mypy, '-m'] + largs[0:0] = ['mypy', '--use-python-path', '-m'] env = self.env self.waiter.add(LazySubprocess(name, largs, cwd=cwd, env=env)) @@ -118,7 +130,7 @@ def add_mypy_string(self, name: str, *args: str, cwd: Optional[str] = None) -> N if not self.allow(name): return largs = list(args) - largs[0:0] = [sys.executable, self.mypy, '-c'] + largs[0:0] = ['mypy', '--use-python-path', '-c'] env = self.env self.waiter.add(LazySubprocess(name, largs, cwd=cwd, env=env)) @@ -144,6 +156,19 @@ def add_python2(self, name: str, *args: str, cwd: Optional[str] = None) -> None: env = self.env self.waiter.add(LazySubprocess(name, largs, cwd=cwd, env=env)) + def add_myunit(self, name: str, *args: str, cwd: Optional[str] = None, + script: bool = True) -> None: + name = 'run %s' % name + if not self.allow(name): + return + largs = list(args) + if script: + largs[0:0] = ['myunit'] + else: + largs[0:0] = [sys.executable, '-m' 'mypy.myunit'] + env = self.env + self.waiter.add(LazySubprocess(name, largs, cwd=cwd, env=env)) + def add_flake8(self, name: str, file: str, cwd: Optional[str] = None) -> None: name = 'lint %s' % name if not self.allow(name): @@ -159,28 +184,30 @@ def list_tasks(self) -> None: def add_basic(driver: Driver) -> None: if False: - driver.add_mypy('file setup.py', 'setup.py') - driver.add_flake8('file setup.py', 'setup.py') - driver.add_mypy('file runtests.py', 'runtests.py') - driver.add_flake8('file runtests.py', 'runtests.py') - driver.add_mypy('legacy entry script', 'scripts/mypy') - driver.add_flake8('legacy entry script', 'scripts/mypy') - driver.add_mypy('legacy myunit script', 'scripts/myunit') - driver.add_flake8('legacy myunit script', 'scripts/myunit') + driver.add_mypy('file setup.py', join(SOURCE_DIR, 'setup.py')) + driver.add_flake8('file setup.py', join(SOURCE_DIR, 'setup.py')) + driver.add_mypy('file runtests.py', join(SOURCE_DIR, 'runtests.py')) + driver.add_flake8('file runtests.py', join(SOURCE_DIR, 'runtests.py')) + driver.add_mypy('legacy entry script', join(SOURCE_DIR, 'scripts/mypy')) + driver.add_flake8('legacy entry script', join(SOURCE_DIR, 'scripts/mypy')) + driver.add_mypy('legacy myunit script', join(SOURCE_DIR, 'scripts/myunit')) + driver.add_flake8('legacy myunit script', join(SOURCE_DIR, 'scripts/myunit')) driver.add_mypy_mod('entry mod mypy', 'mypy') driver.add_mypy_mod('entry mod mypy.stubgen', 'mypy.stubgen') driver.add_mypy_mod('entry mod mypy.myunit', 'mypy.myunit') def find_files(base: str, prefix: str = '', suffix: str = '') -> List[str]: + base = join(SOURCE_DIR, base) return [join(root, f) for root, dirs, files in os.walk(base) for f in files if f.startswith(prefix) and f.endswith(suffix)] -def file_to_module(file: str) -> str: - rv = os.path.splitext(file)[0].replace(os.sep, '.') +def file_to_module(file: str, ignore: str = '') -> str: + file = relpath(file, join(SOURCE_DIR, ignore)) + rv = splitext(file)[0].replace(os.sep, '.') if rv.endswith('.__init__'): rv = rv[:-len('.__init__')] return rv @@ -210,9 +237,12 @@ def add_myunit(driver: Driver) -> None: elif mod == 'mypy.test.testpythoneval': # Run Python evaluation integration tests separetely since they are much slower # than proper unit tests. - driver.add_python_mod('eval-test %s' % mod, 'mypy.myunit', '-m', mod, *driver.arglist) + + # testpythoneval requires lib-typing/2.7 to be available. Ick! + driver.add_myunit('eval-test %s' % mod, '-m', mod, *driver.arglist, + cwd=SOURCE_DIR, script=False) else: - driver.add_python_mod('unit-test %s' % mod, 'mypy.myunit', '-m', mod, *driver.arglist) + driver.add_myunit('unit-test %s' % mod, '-m', mod, *driver.arglist) def add_stubs(driver: Driver) -> None: @@ -223,7 +253,7 @@ def add_stubs(driver: Driver) -> None: for pfx in ['', 'third-party-']: stubdir = join('stubs', pfx + version) for f in find_files(stubdir, suffix='.pyi'): - module = file_to_module(f[len(stubdir) + 1:]) + module = file_to_module(f, stubdir) if module not in seen: seen.add(module) driver.add_mypy_string( @@ -234,21 +264,21 @@ def add_stubs(driver: Driver) -> None: def add_libpython(driver: Driver) -> None: seen = set() # type: Set[str] for version in driver.versions: - libpython_dir = join(driver.cwd, 'lib-python', version) + libpython_dir = join('lib-python', version) for f in find_files(libpython_dir, prefix='test_', suffix='.py'): - module = file_to_module(f[len(libpython_dir) + 1:]) + module = file_to_module(f, libpython_dir) if module not in seen: seen.add(module) driver.add_mypy_mod( 'libpython (%s) module %s' % (version, module), module, - cwd=libpython_dir) + cwd=join(SOURCE_DIR, libpython_dir)) def add_samples(driver: Driver) -> None: for f in find_files('samples', suffix='.py'): if 'codec' in f: - cwd, bf = os.path.dirname(f), os.path.basename(f) + cwd, bf = dirname(f), basename(f) bf = bf[:-len('.py')] driver.add_mypy_string('codec file %s' % f, 'import mypy.codec.register, %s' % bf, @@ -276,7 +306,7 @@ def sanity() -> None: return failed = False for p in paths.split(os.pathsep): - if not os.path.isabs(p): + if not isabs(p): print('Relative PYTHONPATH entry %r' % p) failed = True if failed: @@ -328,7 +358,9 @@ def main() -> None: whitelist.append('') driver = Driver(whitelist=whitelist, blacklist=blacklist, arglist=arglist, - verbosity=verbosity, xfail=[]) + verbosity=verbosity, xfail=[ + 'run2 unittest mypy.codec.test.test_function_translation', + ]) driver.prepend_path('PATH', [join(driver.cwd, 'scripts')]) driver.prepend_path('MYPYPATH', [driver.cwd]) driver.prepend_path('PYTHONPATH', [driver.cwd]) diff --git a/setup.py b/setup.py index 0a0caa15075aa..0fecc9c8a5930 100644 --- a/setup.py +++ b/setup.py @@ -66,6 +66,22 @@ def find_data_files(base, globs): 'Topic :: Software Development', ] +# TODO recurse automatically? +# If we switch to setuptools, use find_packages? +packages = [ + 'mypy', 'mypy.test', + 'mypy.myunit', + 'mypy.codec', 'mypy.codec.test', +] + +package_data = { + 'mypy.test': [ + 'data/*.test', + 'data/fixtures/*.py', + 'data/lib-stub/*.py', + ], +} + setup(name='mypy-lang', version=version, description=description, @@ -77,8 +93,9 @@ def find_data_files(base, globs): platforms=['POSIX'], package_dir={'': 'lib-typing/3.2', 'mypy': 'mypy'}, py_modules=['typing'], - packages=['mypy'], - scripts=['scripts/mypy'], + packages=packages, + scripts=['scripts/mypy', 'scripts/myunit'], data_files=data_files, + package_data=package_data, classifiers=classifiers, ) From 449b2f94e353460a71fb22e74a7cbe603389f48c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 12 Oct 2015 22:51:39 -0700 Subject: [PATCH 11/25] Switch from distutils to setuptools --- setup.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 0fecc9c8a5930..ce36c510e8015 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ import os.path import sys -from distutils.core import setup +from setuptools import setup, find_packages from mypy.version import __version__ if sys.version_info < (3, 2, 0): @@ -66,13 +66,8 @@ def find_data_files(base, globs): 'Topic :: Software Development', ] -# TODO recurse automatically? -# If we switch to setuptools, use find_packages? -packages = [ - 'mypy', 'mypy.test', - 'mypy.myunit', - 'mypy.codec', 'mypy.codec.test', -] +packages = find_packages(exclude=['pinfer']) +print(packages) package_data = { 'mypy.test': [ From 59b632e6b5ecbeb0c5b903a5e9c26c9204dbdde0 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 12 Oct 2015 23:26:52 -0700 Subject: [PATCH 12/25] Add tox.ini --- .gitignore | 4 ++++ setup.cfg => tox.ini | 5 +++++ 2 files changed, 9 insertions(+) rename setup.cfg => tox.ini (86%) diff --git a/.gitignore b/.gitignore index a3dc564924024..503fe1f2b8d68 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,7 @@ __pycache__ docs/build/ *.iml /out/ + +/.tox/ +/MANIFEST +/lib-typing/3.2/mypy_lang.egg-info/ diff --git a/setup.cfg b/tox.ini similarity index 86% rename from setup.cfg rename to tox.ini index 4818cec154a60..51ab4c1199c7e 100644 --- a/setup.cfg +++ b/tox.ini @@ -1,3 +1,8 @@ +[tox] +envlist = py32,py33,py34,py35,pypy3 +[testenv] +commands = ./runtests.py -v + [flake8] max-line-length = 99 exclude = mypy/codec/*,mypy/test/data/lib-stub/*,mypy/test/data/fixtures/* From cc03bbc99e51d6815027115bab4bf1a74b8fffb3 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 00:09:07 -0700 Subject: [PATCH 13/25] Give a better message when data files are not found --- mypy/build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mypy/build.py b/mypy/build.py index 514aa4b3665f2..579ced21426af 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -187,8 +187,12 @@ def default_data_dir() -> str: if os.path.isdir(os.path.join(rv, 'stubs')): return rv else: - # Don't know where to find the data files! - raise RuntimeError("Broken installation: can't determine base dir") + print('Panic! Unable to locate data directory.') + print('Info:') + print(' __file__ = %s' % __file__) + print(' is_installed() = %s' % is_installed()) + print(' data_dir = %s' % rv) + sys.exit(1) def default_lib_path(data_dir: str, target: int, pyversion: Tuple[int, int], From 13e0d956ab8689d8ee0ecf5303215dfdf8b71c1c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 00:23:03 -0700 Subject: [PATCH 14/25] Put everything in package_data, not data_files --- .gitignore | 4 ++- mypy/build.py | 16 +-------- {stubs => mypy/data/stubs}/2.7/Queue.pyi | 0 {stubs => mypy/data/stubs}/2.7/StringIO.pyi | 0 {stubs => mypy/data/stubs}/2.7/UserDict.pyi | 0 {stubs => mypy/data/stubs}/2.7/__future__.pyi | 0 {stubs => mypy/data/stubs}/2.7/_random.pyi | 0 {stubs => mypy/data/stubs}/2.7/abc.pyi | 0 {stubs => mypy/data/stubs}/2.7/argparse.pyi | 0 {stubs => mypy/data/stubs}/2.7/atexit.pyi | 0 {stubs => mypy/data/stubs}/2.7/base64.pyi | 0 {stubs => mypy/data/stubs}/2.7/binascii.pyi | 0 {stubs => mypy/data/stubs}/2.7/builtins.pyi | 0 {stubs => mypy/data/stubs}/2.7/cStringIO.pyi | 0 {stubs => mypy/data/stubs}/2.7/codecs.pyi | 0 .../data/stubs}/2.7/collections.pyi | 0 {stubs => mypy/data/stubs}/2.7/compileall.pyi | 0 {stubs => mypy/data/stubs}/2.7/contextlib.pyi | 0 {stubs => mypy/data/stubs}/2.7/copy.pyi | 0 {stubs => mypy/data/stubs}/2.7/csv.pyi | 0 {stubs => mypy/data/stubs}/2.7/datetime.pyi | 0 {stubs => mypy/data/stubs}/2.7/difflib.pyi | 0 .../data/stubs}/2.7/distutils/__init__.pyi | 0 .../data/stubs}/2.7/distutils/version.pyi | 0 .../data/stubs}/2.7/email/MIMEText.pyi | 0 .../data/stubs}/2.7/email/__init__.pyi | 0 .../data/stubs}/2.7/email/mime/__init__.pyi | 0 .../data/stubs}/2.7/email/mime/base.pyi | 0 .../data/stubs}/2.7/email/mime/multipart.pyi | 0 .../stubs}/2.7/email/mime/nonmultipart.pyi | 0 .../data/stubs}/2.7/email/mime/text.pyi | 0 {stubs => mypy/data/stubs}/2.7/errno.pyi | 0 {stubs => mypy/data/stubs}/2.7/fcntl.pyi | 0 {stubs => mypy/data/stubs}/2.7/fnmatch.pyi | 0 {stubs => mypy/data/stubs}/2.7/functools.pyi | 0 {stubs => mypy/data/stubs}/2.7/gc.pyi | 0 {stubs => mypy/data/stubs}/2.7/getpass.pyi | 0 {stubs => mypy/data/stubs}/2.7/gettext.pyi | 0 {stubs => mypy/data/stubs}/2.7/glob.pyi | 0 {stubs => mypy/data/stubs}/2.7/gzip.pyi | 0 {stubs => mypy/data/stubs}/2.7/hashlib.pyi | 0 {stubs => mypy/data/stubs}/2.7/hmac.pyi | 0 .../data/stubs}/2.7/htmlentitydefs.pyi | 0 {stubs => mypy/data/stubs}/2.7/imp.pyi | 0 {stubs => mypy/data/stubs}/2.7/importlib.pyi | 0 {stubs => mypy/data/stubs}/2.7/inspect.pyi | 0 {stubs => mypy/data/stubs}/2.7/io.pyi | 0 {stubs => mypy/data/stubs}/2.7/itertools.pyi | 0 {stubs => mypy/data/stubs}/2.7/json.pyi | 0 .../data/stubs}/2.7/logging/__init__.pyi | 0 .../data/stubs}/2.7/logging/handlers.pyi | 0 {stubs => mypy/data/stubs}/2.7/marshal.pyi | 0 {stubs => mypy/data/stubs}/2.7/math.pyi | 0 {stubs => mypy/data/stubs}/2.7/md5.pyi | 0 {stubs => mypy/data/stubs}/2.7/numbers.pyi | 0 {stubs => mypy/data/stubs}/2.7/operator.pyi | 0 .../data/stubs}/2.7/os/__init__.pyi | 0 {stubs => mypy/data/stubs}/2.7/os/path.pyi | 0 {stubs => mypy/data/stubs}/2.7/pickle.pyi | 0 {stubs => mypy/data/stubs}/2.7/pipes.pyi | 0 {stubs => mypy/data/stubs}/2.7/pprint.pyi | 0 {stubs => mypy/data/stubs}/2.7/random.pyi | 0 {stubs => mypy/data/stubs}/2.7/re.pyi | 0 {stubs => mypy/data/stubs}/2.7/resource.pyi | 0 {stubs => mypy/data/stubs}/2.7/select.pyi | 0 {stubs => mypy/data/stubs}/2.7/sha.pyi | 0 {stubs => mypy/data/stubs}/2.7/shlex.pyi | 0 {stubs => mypy/data/stubs}/2.7/shutil.pyi | 0 {stubs => mypy/data/stubs}/2.7/signal.pyi | 0 {stubs => mypy/data/stubs}/2.7/simplejson.pyi | 0 {stubs => mypy/data/stubs}/2.7/smtplib.pyi | 0 {stubs => mypy/data/stubs}/2.7/socket.pyi | 0 {stubs => mypy/data/stubs}/2.7/stat.pyi | 0 {stubs => mypy/data/stubs}/2.7/string.pyi | 0 {stubs => mypy/data/stubs}/2.7/struct.pyi | 0 {stubs => mypy/data/stubs}/2.7/subprocess.pyi | 0 {stubs => mypy/data/stubs}/2.7/sys.pyi | 0 {stubs => mypy/data/stubs}/2.7/tarfile.pyi | 0 {stubs => mypy/data/stubs}/2.7/tempfile.pyi | 0 {stubs => mypy/data/stubs}/2.7/textwrap.pyi | 0 {stubs => mypy/data/stubs}/2.7/thread.pyi | 0 {stubs => mypy/data/stubs}/2.7/threading.pyi | 0 {stubs => mypy/data/stubs}/2.7/time.pyi | 0 {stubs => mypy/data/stubs}/2.7/traceback.pyi | 0 {stubs => mypy/data/stubs}/2.7/types.pyi | 0 {stubs => mypy/data/stubs}/2.7/typing.pyi | 0 .../data/stubs}/2.7/unicodedata.pyi | 0 {stubs => mypy/data/stubs}/2.7/urllib.pyi | 0 {stubs => mypy/data/stubs}/2.7/urlparse.pyi | 0 {stubs => mypy/data/stubs}/2.7/uuid.pyi | 0 .../data/stubs}/2.7/xml/__init__.pyi | 0 .../data/stubs}/2.7/xml/sax/__init__.pyi | 0 .../data/stubs}/2.7/xml/sax/handler.pyi | 0 .../data/stubs}/2.7/xml/sax/saxutils.pyi | 0 .../data/stubs}/2.7/xml/sax/xmlreader.pyi | 0 {stubs => mypy/data/stubs}/2.7/zlib.pyi | 0 {stubs => mypy/data/stubs}/3.2/__future__.pyi | 0 .../data/stubs}/3.2/_dummy_thread.pyi | 0 {stubs => mypy/data/stubs}/3.2/_io.pyi | 0 {stubs => mypy/data/stubs}/3.2/_locale.pyi | 0 .../data/stubs}/3.2/_posixsubprocess.pyi | 0 {stubs => mypy/data/stubs}/3.2/_random.pyi | 0 .../data/stubs}/3.2/_subprocess.pyi | 0 {stubs => mypy/data/stubs}/3.2/_thread.pyi | 0 {stubs => mypy/data/stubs}/3.2/abc.pyi | 0 {stubs => mypy/data/stubs}/3.2/argparse.pyi | 0 {stubs => mypy/data/stubs}/3.2/array.pyi | 0 {stubs => mypy/data/stubs}/3.2/atexit.pyi | 0 {stubs => mypy/data/stubs}/3.2/base64.pyi | 0 {stubs => mypy/data/stubs}/3.2/binascii.pyi | 0 {stubs => mypy/data/stubs}/3.2/bisect.pyi | 0 {stubs => mypy/data/stubs}/3.2/builtins.pyi | 0 {stubs => mypy/data/stubs}/3.2/bz2.pyi | 0 {stubs => mypy/data/stubs}/3.2/calendar.pyi | 0 {stubs => mypy/data/stubs}/3.2/cgi.pyi | 0 {stubs => mypy/data/stubs}/3.2/codecs.pyi | 0 .../data/stubs}/3.2/collections.pyi | 0 {stubs => mypy/data/stubs}/3.2/contextlib.pyi | 0 {stubs => mypy/data/stubs}/3.2/copy.pyi | 0 {stubs => mypy/data/stubs}/3.2/csv.pyi | 0 {stubs => mypy/data/stubs}/3.2/datetime.pyi | 0 {stubs => mypy/data/stubs}/3.2/decimal.pyi | 0 {stubs => mypy/data/stubs}/3.2/difflib.pyi | 0 .../data/stubs}/3.2/distutils/__init__.pyi | 0 .../data/stubs}/3.2/distutils/errors.pyi | 0 .../data/stubs}/3.2/distutils/spawn.pyi | 0 {stubs => mypy/data/stubs}/3.2/doctest.pyi | 0 .../data/stubs}/3.2/email/__init__.pyi | 0 .../stubs}/3.2/email/_header_value_parser.pyi | 0 .../data/stubs}/3.2/email/_parseaddr.pyi | 0 .../data/stubs}/3.2/email/_policybase.pyi | 0 .../data/stubs}/3.2/email/base64mime.pyi | 0 .../data/stubs}/3.2/email/charset.pyi | 0 .../data/stubs}/3.2/email/contentmanager.pyi | 0 .../data/stubs}/3.2/email/encoders.pyi | 0 .../data/stubs}/3.2/email/errors.pyi | 0 .../data/stubs}/3.2/email/feedparser.pyi | 0 .../data/stubs}/3.2/email/generator.pyi | 0 .../data/stubs}/3.2/email/header.pyi | 0 .../data/stubs}/3.2/email/headerregistry.pyi | 0 .../data/stubs}/3.2/email/iterators.pyi | 0 .../data/stubs}/3.2/email/message.pyi | 0 .../data/stubs}/3.2/email/mime/__init__.pyi | 0 .../stubs}/3.2/email/mime/application.pyi | 0 .../data/stubs}/3.2/email/mime/audio.pyi | 0 .../data/stubs}/3.2/email/mime/base.pyi | 0 .../data/stubs}/3.2/email/mime/image.pyi | 0 .../data/stubs}/3.2/email/mime/message.pyi | 0 .../data/stubs}/3.2/email/mime/multipart.pyi | 0 .../stubs}/3.2/email/mime/nonmultipart.pyi | 0 .../data/stubs}/3.2/email/mime/text.pyi | 0 .../data/stubs}/3.2/email/parser.pyi | 0 .../data/stubs}/3.2/email/policy.pyi | 0 .../data/stubs}/3.2/email/quoprimime.pyi | 0 .../data/stubs}/3.2/email/utils.pyi | 0 .../data/stubs}/3.2/encodings/__init__.pyi | 0 .../data/stubs}/3.2/encodings/utf_8.pyi | 0 {stubs => mypy/data/stubs}/3.2/errno.pyi | 0 {stubs => mypy/data/stubs}/3.2/fcntl.pyi | 0 {stubs => mypy/data/stubs}/3.2/fnmatch.pyi | 0 {stubs => mypy/data/stubs}/3.2/functools.pyi | 0 {stubs => mypy/data/stubs}/3.2/gc.pyi | 0 {stubs => mypy/data/stubs}/3.2/getopt.pyi | 0 {stubs => mypy/data/stubs}/3.2/getpass.pyi | 0 {stubs => mypy/data/stubs}/3.2/gettext.pyi | 0 {stubs => mypy/data/stubs}/3.2/glob.pyi | 0 {stubs => mypy/data/stubs}/3.2/grp.pyi | 0 {stubs => mypy/data/stubs}/3.2/hashlib.pyi | 0 {stubs => mypy/data/stubs}/3.2/heapq.pyi | 0 .../data/stubs}/3.2/http/__init__.pyi | 0 .../data/stubs}/3.2/http/client.pyi | 0 .../data/stubs}/3.2/http/cookiejar.pyi | 0 {stubs => mypy/data/stubs}/3.2/imp.pyi | 0 {stubs => mypy/data/stubs}/3.2/importlib.pyi | 0 {stubs => mypy/data/stubs}/3.2/inspect.pyi | 0 {stubs => mypy/data/stubs}/3.2/io.pyi | 0 {stubs => mypy/data/stubs}/3.2/itertools.pyi | 0 {stubs => mypy/data/stubs}/3.2/json.pyi | 0 {stubs => mypy/data/stubs}/3.2/linecache.pyi | 0 {stubs => mypy/data/stubs}/3.2/locale.pyi | 0 .../data/stubs}/3.2/logging/__init__.pyi | 0 .../data/stubs}/3.2/logging/handlers.pyi | 0 {stubs => mypy/data/stubs}/3.2/math.pyi | 0 {stubs => mypy/data/stubs}/3.2/msvcrt.pyi | 0 .../stubs}/3.2/multiprocessing/__init__.pyi | 0 .../stubs}/3.2/multiprocessing/managers.pyi | 0 .../data/stubs}/3.2/multiprocessing/pool.pyi | 0 {stubs => mypy/data/stubs}/3.2/operator.pyi | 0 .../data/stubs}/3.2/os/__init__.pyi | 0 {stubs => mypy/data/stubs}/3.2/os/path.pyi | 0 {stubs => mypy/data/stubs}/3.2/pickle.pyi | 0 {stubs => mypy/data/stubs}/3.2/pipes.pyi | 0 {stubs => mypy/data/stubs}/3.2/platform.pyi | 0 {stubs => mypy/data/stubs}/3.2/posix.pyi | 0 {stubs => mypy/data/stubs}/3.2/posixpath.pyi | 0 {stubs => mypy/data/stubs}/3.2/pprint.pyi | 0 {stubs => mypy/data/stubs}/3.2/pwd.pyi | 0 {stubs => mypy/data/stubs}/3.2/queue.pyi | 0 {stubs => mypy/data/stubs}/3.2/random.pyi | 0 {stubs => mypy/data/stubs}/3.2/re.pyi | 0 {stubs => mypy/data/stubs}/3.2/resource.pyi | 0 {stubs => mypy/data/stubs}/3.2/select.pyi | 0 {stubs => mypy/data/stubs}/3.2/shlex.pyi | 0 {stubs => mypy/data/stubs}/3.2/shutil.pyi | 0 {stubs => mypy/data/stubs}/3.2/signal.pyi | 0 {stubs => mypy/data/stubs}/3.2/smtplib.pyi | 0 {stubs => mypy/data/stubs}/3.2/socket.pyi | 0 .../data/stubs}/3.2/socketserver.pyi | 0 {stubs => mypy/data/stubs}/3.2/ssl.pyi | 0 {stubs => mypy/data/stubs}/3.2/stat.pyi | 0 {stubs => mypy/data/stubs}/3.2/string.pyi | 0 {stubs => mypy/data/stubs}/3.2/struct.pyi | 0 {stubs => mypy/data/stubs}/3.2/subprocess.pyi | 0 {stubs => mypy/data/stubs}/3.2/sys.pyi | 0 {stubs => mypy/data/stubs}/3.2/sysconfig.pyi | 0 {stubs => mypy/data/stubs}/3.2/tarfile.pyi | 0 {stubs => mypy/data/stubs}/3.2/tempfile.pyi | 0 {stubs => mypy/data/stubs}/3.2/textwrap.pyi | 0 {stubs => mypy/data/stubs}/3.2/threading.pyi | 0 {stubs => mypy/data/stubs}/3.2/time.pyi | 0 {stubs => mypy/data/stubs}/3.2/token.pyi | 0 {stubs => mypy/data/stubs}/3.2/traceback.pyi | 0 {stubs => mypy/data/stubs}/3.2/types.pyi | 0 {stubs => mypy/data/stubs}/3.2/typing.pyi | 0 .../data/stubs}/3.2/unicodedata.pyi | 0 {stubs => mypy/data/stubs}/3.2/unittest.pyi | 0 .../data/stubs}/3.2/urllib/__init__.pyi | 0 .../data/stubs}/3.2/urllib/error.pyi | 0 .../data/stubs}/3.2/urllib/parse.pyi | 0 .../data/stubs}/3.2/urllib/request.pyi | 0 {stubs => mypy/data/stubs}/3.2/uuid.pyi | 0 {stubs => mypy/data/stubs}/3.2/warnings.pyi | 0 {stubs => mypy/data/stubs}/3.2/weakref.pyi | 0 {stubs => mypy/data/stubs}/3.2/webbrowser.pyi | 0 .../data/stubs}/3.2/xml/__init__.pyi | 0 .../stubs}/3.2/xml/etree/ElementInclude.pyi | 0 .../data/stubs}/3.2/xml/etree/ElementPath.pyi | 0 .../data/stubs}/3.2/xml/etree/ElementTree.pyi | 0 .../data/stubs}/3.2/xml/etree/__init__.pyi | 0 .../stubs}/3.2/xml/etree/cElementTree.pyi | 0 {stubs => mypy/data/stubs}/3.2/zipfile.pyi | 0 {stubs => mypy/data/stubs}/3.2/zlib.pyi | 0 {stubs => mypy/data/stubs}/3.3/do-not-remove | 0 {stubs => mypy/data/stubs}/3.3/ipaddress.pyi | 0 .../data/stubs}/3.4/asyncio/__init__.pyi | 0 .../data/stubs}/3.4/asyncio/events.pyi | 0 .../data/stubs}/3.4/asyncio/futures.pyi | 0 .../data/stubs}/3.4/asyncio/queues.pyi | 0 .../data/stubs}/3.4/asyncio/tasks.pyi | 0 {stubs => mypy/data/stubs}/3.4/enum.pyi | 0 {stubs => mypy/data/stubs}/3.4/pathlib.pyi | 0 .../third-party-2.7/Crypto/Cipher/AES.pyi | 0 .../Crypto/Cipher/__init__.pyi | 0 .../Crypto/Random/__init__.pyi | 0 .../third-party-2.7/Crypto/Random/random.pyi | 0 .../third-party-2.7/Crypto/__init__.pyi | 0 .../third-party-2.7/OpenSSL/__init__.pyi | 0 .../stubs}/third-party-2.7/OpenSSL/crypto.pyi | 0 .../stubs}/third-party-2.7/boto/__init__.pyi | 0 .../third-party-2.7/boto/connection.pyi | 0 .../third-party-2.7/boto/ec2/__init__.pyi | 0 .../third-party-2.7/boto/ec2/elb/__init__.pyi | 0 .../third-party-2.7/concurrent/__init__.pyi | 0 .../concurrent/futures/__init__.pyi | 0 .../data/stubs}/third-party-2.7/croniter.pyi | 0 .../third-party-2.7/fb303/FacebookService.pyi | 0 .../stubs}/third-party-2.7/fb303/__init__.pyi | 0 .../data/stubs}/third-party-2.7/gflags.pyi | 0 .../third-party-2.7/google/__init__.pyi | 0 .../google/protobuf/__init__.pyi | 0 .../google/protobuf/descriptor.pyi | 0 .../google/protobuf/descriptor_pb2.pyi | 0 .../google/protobuf/internal/__init__.pyi | 0 .../google/protobuf/internal/decoder.pyi | 0 .../google/protobuf/internal/encoder.pyi | 0 .../protobuf/internal/enum_type_wrapper.pyi | 0 .../google/protobuf/internal/wire_format.pyi | 0 .../google/protobuf/message.pyi | 0 .../google/protobuf/reflection.pyi | 0 .../stubs}/third-party-2.7/kazoo/__init__.pyi | 0 .../stubs}/third-party-2.7/kazoo/client.pyi | 0 .../third-party-2.7/kazoo/exceptions.pyi | 0 .../third-party-2.7/kazoo/recipe/__init__.pyi | 0 .../third-party-2.7/kazoo/recipe/watchers.pyi | 0 .../data/stubs}/third-party-2.7/pycurl.pyi | 0 .../stubs}/third-party-2.7/redis/__init__.pyi | 0 .../stubs}/third-party-2.7/redis/client.pyi | 0 .../third-party-2.7/redis/connection.pyi | 0 .../third-party-2.7/redis/exceptions.pyi | 0 .../stubs}/third-party-2.7/redis/utils.pyi | 0 .../third-party-2.7/requests/__init__.pyi | 0 .../third-party-2.7/requests/adapters.pyi | 0 .../stubs}/third-party-2.7/requests/api.pyi | 0 .../stubs}/third-party-2.7/requests/auth.pyi | 0 .../third-party-2.7/requests/compat.pyi | 0 .../third-party-2.7/requests/cookies.pyi | 0 .../third-party-2.7/requests/exceptions.pyi | 0 .../stubs}/third-party-2.7/requests/hooks.pyi | 0 .../third-party-2.7/requests/models.pyi | 0 .../requests/packages/__init__.pyi | 0 .../requests/packages/urllib3/__init__.pyi | 0 .../packages/urllib3/_collections.pyi | 0 .../requests/packages/urllib3/connection.pyi | 0 .../packages/urllib3/connectionpool.pyi | 0 .../packages/urllib3/contrib/__init__.pyi | 0 .../requests/packages/urllib3/exceptions.pyi | 0 .../requests/packages/urllib3/fields.pyi | 0 .../requests/packages/urllib3/filepost.pyi | 0 .../packages/urllib3/packages/__init__.pyi | 0 .../ssl_match_hostname/_implementation.pyi | 0 .../requests/packages/urllib3/poolmanager.pyi | 0 .../requests/packages/urllib3/request.pyi | 0 .../requests/packages/urllib3/response.pyi | 0 .../packages/urllib3/util/__init__.pyi | 0 .../packages/urllib3/util/connection.pyi | 0 .../packages/urllib3/util/request.pyi | 0 .../packages/urllib3/util/response.pyi | 0 .../requests/packages/urllib3/util/retry.pyi | 0 .../packages/urllib3/util/timeout.pyi | 0 .../requests/packages/urllib3/util/url.pyi | 0 .../third-party-2.7/requests/sessions.pyi | 0 .../third-party-2.7/requests/status_codes.pyi | 0 .../third-party-2.7/requests/structures.pyi | 0 .../stubs}/third-party-2.7/requests/utils.pyi | 0 .../third-party-2.7/routes/__init__.pyi | 0 .../stubs}/third-party-2.7/routes/mapper.pyi | 0 .../stubs}/third-party-2.7/routes/util.pyi | 0 .../third-party-2.7/scribe/__init__.pyi | 0 .../stubs}/third-party-2.7/scribe/scribe.pyi | 0 .../stubs}/third-party-2.7/scribe/ttypes.pyi | 0 .../third-party-2.7/sqlalchemy/__init__.pyi | 0 .../sqlalchemy/databases/__init__.pyi | 0 .../sqlalchemy/databases/mysql.pyi | 0 .../sqlalchemy/dialects/__init__.pyi | 0 .../sqlalchemy/dialects/mysql/__init__.pyi | 0 .../sqlalchemy/dialects/mysql/base.pyi | 0 .../sqlalchemy/engine/__init__.pyi | 0 .../sqlalchemy/engine/strategies.pyi | 0 .../third-party-2.7/sqlalchemy/engine/url.pyi | 0 .../stubs}/third-party-2.7/sqlalchemy/exc.pyi | 0 .../third-party-2.7/sqlalchemy/inspection.pyi | 0 .../sqlalchemy/orm/__init__.pyi | 0 .../sqlalchemy/orm/session.pyi | 0 .../third-party-2.7/sqlalchemy/pool.pyi | 0 .../third-party-2.7/sqlalchemy/schema.pyi | 0 .../sqlalchemy/sql/__init__.pyi | 0 .../sqlalchemy/sql/expression.pyi | 0 .../sqlalchemy/sql/visitors.pyi | 0 .../third-party-2.7/sqlalchemy/types.pyi | 0 .../sqlalchemy/util/__init__.pyi | 0 .../sqlalchemy/util/_collections.pyi | 0 .../sqlalchemy/util/compat.pyi | 0 .../sqlalchemy/util/deprecations.pyi | 0 .../sqlalchemy/util/langhelpers.pyi | 0 .../stubs}/third-party-2.7/thrift/Thrift.pyi | 0 .../third-party-2.7/thrift/__init__.pyi | 0 .../thrift/protocol/TBinaryProtocol.pyi | 0 .../thrift/protocol/TProtocol.pyi | 0 .../thrift/protocol/__init__.pyi | 0 .../thrift/transport/TSocket.pyi | 0 .../thrift/transport/TTransport.pyi | 0 .../thrift/transport/__init__.pyi | 0 .../third-party-2.7/tornado/__init__.pyi | 0 .../third-party-2.7/tornado/concurrent.pyi | 0 .../stubs}/third-party-2.7/tornado/gen.pyi | 0 .../third-party-2.7/tornado/httpclient.pyi | 0 .../third-party-2.7/tornado/httpserver.pyi | 0 .../third-party-2.7/tornado/httputil.pyi | 0 .../stubs}/third-party-2.7/tornado/ioloop.pyi | 0 .../third-party-2.7/tornado/netutil.pyi | 0 .../third-party-2.7/tornado/tcpserver.pyi | 0 .../stubs}/third-party-2.7/tornado/util.pyi | 0 .../stubs}/third-party-2.7/tornado/web.pyi | 0 .../stubs}/third-party-2.7/yaml/__init__.pyi | 0 .../stubs}/third-party-2.7/yaml/composer.pyi | 0 .../third-party-2.7/yaml/constructor.pyi | 0 .../stubs}/third-party-2.7/yaml/dumper.pyi | 0 .../stubs}/third-party-2.7/yaml/emitter.pyi | 0 .../stubs}/third-party-2.7/yaml/error.pyi | 0 .../stubs}/third-party-2.7/yaml/events.pyi | 0 .../stubs}/third-party-2.7/yaml/loader.pyi | 0 .../stubs}/third-party-2.7/yaml/nodes.pyi | 0 .../stubs}/third-party-2.7/yaml/parser.pyi | 0 .../stubs}/third-party-2.7/yaml/reader.pyi | 0 .../third-party-2.7/yaml/representer.pyi | 0 .../stubs}/third-party-2.7/yaml/resolver.pyi | 0 .../stubs}/third-party-2.7/yaml/scanner.pyi | 0 .../third-party-2.7/yaml/serializer.pyi | 0 .../stubs}/third-party-2.7/yaml/tokens.pyi | 0 .../third-party-3.2/docutils/__init__.pyi | 0 .../third-party-3.2/docutils/examples.pyi | 0 .../stubs}/third-party-3.2/docutils/nodes.pyi | 0 .../docutils/parsers/__init__.pyi | 0 .../docutils/parsers/rst/__init__.pyi | 0 .../docutils/parsers/rst/nodes.pyi | 0 .../docutils/parsers/rst/roles.pyi | 0 .../docutils/parsers/rst/states.pyi | 0 .../stubs}/third-party-3.2/lxml/__init__.pyi | 0 .../stubs}/third-party-3.2/lxml/etree.pyi | 0 .../third-party-3.2/requests/__init__.pyi | 0 .../third-party-3.2/requests/adapters.pyi | 0 .../stubs}/third-party-3.2/requests/api.pyi | 0 .../stubs}/third-party-3.2/requests/auth.pyi | 0 .../third-party-3.2/requests/compat.pyi | 0 .../third-party-3.2/requests/cookies.pyi | 0 .../third-party-3.2/requests/exceptions.pyi | 0 .../stubs}/third-party-3.2/requests/hooks.pyi | 0 .../third-party-3.2/requests/models.pyi | 0 .../requests/packages/__init__.pyi | 0 .../requests/packages/urllib3/__init__.pyi | 0 .../packages/urllib3/_collections.pyi | 0 .../requests/packages/urllib3/connection.pyi | 0 .../packages/urllib3/connectionpool.pyi | 0 .../packages/urllib3/contrib/__init__.pyi | 0 .../requests/packages/urllib3/exceptions.pyi | 0 .../requests/packages/urllib3/fields.pyi | 0 .../requests/packages/urllib3/filepost.pyi | 0 .../packages/urllib3/packages/__init__.pyi | 0 .../packages/ssl_match_hostname/__init__.pyi | 0 .../ssl_match_hostname/_implementation.pyi | 0 .../requests/packages/urllib3/poolmanager.pyi | 0 .../requests/packages/urllib3/request.pyi | 0 .../requests/packages/urllib3/response.pyi | 0 .../packages/urllib3/util/__init__.pyi | 0 .../packages/urllib3/util/connection.pyi | 0 .../packages/urllib3/util/request.pyi | 0 .../packages/urllib3/util/response.pyi | 0 .../requests/packages/urllib3/util/retry.pyi | 0 .../requests/packages/urllib3/util/ssl_.pyi | 0 .../packages/urllib3/util/timeout.pyi | 0 .../requests/packages/urllib3/util/url.pyi | 0 .../third-party-3.2/requests/sessions.pyi | 0 .../third-party-3.2/requests/status_codes.pyi | 0 .../third-party-3.2/requests/structures.pyi | 0 .../stubs}/third-party-3.2/requests/utils.pyi | 0 {xml => mypy/data/xml}/mypy-html.css | 0 {xml => mypy/data/xml}/mypy-html.xslt | 0 {xml => mypy/data/xml}/mypy-txt.xslt | 0 {xml => mypy/data/xml}/mypy.xsd | 0 setup.py | 36 ++++--------------- tox.ini | 1 + 441 files changed, 12 insertions(+), 45 deletions(-) rename {stubs => mypy/data/stubs}/2.7/Queue.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/StringIO.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/UserDict.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/__future__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/_random.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/abc.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/argparse.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/atexit.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/base64.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/binascii.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/builtins.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/cStringIO.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/codecs.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/collections.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/compileall.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/contextlib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/copy.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/csv.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/datetime.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/difflib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/distutils/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/distutils/version.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/MIMEText.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/mime/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/mime/base.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/mime/multipart.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/mime/nonmultipart.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/email/mime/text.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/errno.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/fcntl.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/fnmatch.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/functools.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/gc.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/getpass.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/gettext.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/glob.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/gzip.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/hashlib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/hmac.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/htmlentitydefs.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/imp.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/importlib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/inspect.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/io.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/itertools.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/json.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/logging/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/logging/handlers.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/marshal.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/math.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/md5.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/numbers.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/operator.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/os/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/os/path.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/pickle.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/pipes.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/pprint.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/random.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/re.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/resource.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/select.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/sha.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/shlex.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/shutil.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/signal.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/simplejson.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/smtplib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/socket.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/stat.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/string.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/struct.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/subprocess.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/sys.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/tarfile.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/tempfile.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/textwrap.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/thread.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/threading.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/time.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/traceback.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/types.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/typing.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/unicodedata.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/urllib.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/urlparse.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/uuid.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/xml/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/xml/sax/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/xml/sax/handler.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/xml/sax/saxutils.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/xml/sax/xmlreader.pyi (100%) rename {stubs => mypy/data/stubs}/2.7/zlib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/__future__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_dummy_thread.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_io.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_locale.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_posixsubprocess.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_random.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_subprocess.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/_thread.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/abc.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/argparse.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/array.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/atexit.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/base64.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/binascii.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/bisect.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/builtins.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/bz2.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/calendar.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/cgi.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/codecs.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/collections.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/contextlib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/copy.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/csv.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/datetime.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/decimal.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/difflib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/distutils/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/distutils/errors.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/distutils/spawn.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/doctest.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/_header_value_parser.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/_parseaddr.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/_policybase.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/base64mime.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/charset.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/contentmanager.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/encoders.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/errors.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/feedparser.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/generator.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/header.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/headerregistry.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/iterators.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/message.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/application.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/audio.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/base.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/image.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/message.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/multipart.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/nonmultipart.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/mime/text.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/parser.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/policy.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/quoprimime.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/email/utils.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/encodings/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/encodings/utf_8.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/errno.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/fcntl.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/fnmatch.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/functools.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/gc.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/getopt.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/getpass.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/gettext.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/glob.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/grp.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/hashlib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/heapq.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/http/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/http/client.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/http/cookiejar.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/imp.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/importlib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/inspect.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/io.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/itertools.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/json.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/linecache.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/locale.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/logging/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/logging/handlers.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/math.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/msvcrt.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/multiprocessing/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/multiprocessing/managers.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/multiprocessing/pool.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/operator.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/os/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/os/path.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/pickle.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/pipes.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/platform.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/posix.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/posixpath.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/pprint.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/pwd.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/queue.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/random.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/re.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/resource.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/select.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/shlex.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/shutil.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/signal.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/smtplib.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/socket.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/socketserver.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/ssl.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/stat.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/string.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/struct.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/subprocess.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/sys.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/sysconfig.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/tarfile.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/tempfile.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/textwrap.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/threading.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/time.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/token.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/traceback.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/types.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/typing.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/unicodedata.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/unittest.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/urllib/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/urllib/error.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/urllib/parse.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/urllib/request.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/uuid.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/warnings.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/weakref.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/webbrowser.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/etree/ElementInclude.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/etree/ElementPath.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/etree/ElementTree.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/etree/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/xml/etree/cElementTree.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/zipfile.pyi (100%) rename {stubs => mypy/data/stubs}/3.2/zlib.pyi (100%) rename {stubs => mypy/data/stubs}/3.3/do-not-remove (100%) rename {stubs => mypy/data/stubs}/3.3/ipaddress.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/asyncio/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/asyncio/events.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/asyncio/futures.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/asyncio/queues.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/asyncio/tasks.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/enum.pyi (100%) rename {stubs => mypy/data/stubs}/3.4/pathlib.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/Crypto/Cipher/AES.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/Crypto/Cipher/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/Crypto/Random/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/Crypto/Random/random.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/Crypto/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/OpenSSL/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/OpenSSL/crypto.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/boto/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/boto/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/boto/ec2/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/boto/ec2/elb/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/concurrent/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/concurrent/futures/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/croniter.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/fb303/FacebookService.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/fb303/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/gflags.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/descriptor.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/descriptor_pb2.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/internal/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/internal/decoder.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/internal/encoder.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/internal/enum_type_wrapper.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/internal/wire_format.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/message.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/google/protobuf/reflection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/kazoo/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/kazoo/client.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/kazoo/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/kazoo/recipe/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/kazoo/recipe/watchers.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/pycurl.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/redis/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/redis/client.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/redis/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/redis/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/redis/utils.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/adapters.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/api.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/auth.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/compat.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/cookies.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/hooks.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/models.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/_collections.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/connectionpool.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/contrib/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/fields.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/filepost.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/packages/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/poolmanager.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/request.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/response.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/request.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/response.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/retry.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/timeout.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/packages/urllib3/util/url.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/sessions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/status_codes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/structures.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/requests/utils.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/routes/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/routes/mapper.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/routes/util.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/scribe/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/scribe/scribe.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/scribe/ttypes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/databases/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/databases/mysql.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/dialects/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/dialects/mysql/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/dialects/mysql/base.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/engine/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/engine/strategies.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/engine/url.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/exc.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/inspection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/orm/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/orm/session.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/pool.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/schema.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/sql/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/sql/expression.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/sql/visitors.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/types.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/util/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/util/_collections.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/util/compat.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/util/deprecations.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/sqlalchemy/util/langhelpers.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/Thrift.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/protocol/TBinaryProtocol.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/protocol/TProtocol.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/protocol/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/transport/TSocket.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/transport/TTransport.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/thrift/transport/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/concurrent.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/gen.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/httpclient.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/httpserver.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/httputil.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/ioloop.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/netutil.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/tcpserver.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/util.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/tornado/web.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/composer.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/constructor.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/dumper.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/emitter.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/error.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/events.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/loader.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/nodes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/parser.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/reader.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/representer.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/resolver.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/scanner.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/serializer.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-2.7/yaml/tokens.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/examples.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/nodes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/parsers/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/parsers/rst/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/parsers/rst/nodes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/parsers/rst/roles.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/docutils/parsers/rst/states.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/lxml/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/lxml/etree.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/adapters.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/api.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/auth.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/compat.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/cookies.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/hooks.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/models.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/_collections.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/connectionpool.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/contrib/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/exceptions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/fields.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/filepost.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/packages/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/poolmanager.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/request.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/response.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/__init__.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/connection.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/request.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/response.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/retry.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/ssl_.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/timeout.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/packages/urllib3/util/url.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/sessions.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/status_codes.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/structures.pyi (100%) rename {stubs => mypy/data/stubs}/third-party-3.2/requests/utils.pyi (100%) rename {xml => mypy/data/xml}/mypy-html.css (100%) rename {xml => mypy/data/xml}/mypy-html.xslt (100%) rename {xml => mypy/data/xml}/mypy-txt.xslt (100%) rename {xml => mypy/data/xml}/mypy.xsd (100%) diff --git a/.gitignore b/.gitignore index 503fe1f2b8d68..0fd8769526819 100644 --- a/.gitignore +++ b/.gitignore @@ -3,12 +3,14 @@ __pycache__ *.pyc *~ @* -/build /env docs/build/ *.iml /out/ +/build +/dist + /.tox/ /MANIFEST /lib-typing/3.2/mypy_lang.egg-info/ diff --git a/mypy/build.py b/mypy/build.py index 579ced21426af..dafb9ae723f00 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -178,21 +178,7 @@ def is_installed() -> bool: def default_data_dir() -> str: - if is_installed(): - # we are installed - rv = os.path.join(sys.prefix, 'lib', 'mypy') - else: - # we are from from a source checkout - rv = os.path.dirname(os.path.dirname(__file__)) - if os.path.isdir(os.path.join(rv, 'stubs')): - return rv - else: - print('Panic! Unable to locate data directory.') - print('Info:') - print(' __file__ = %s' % __file__) - print(' is_installed() = %s' % is_installed()) - print(' data_dir = %s' % rv) - sys.exit(1) + return os.path.join(os.path.dirname(__file__), 'data') def default_lib_path(data_dir: str, target: int, pyversion: Tuple[int, int], diff --git a/stubs/2.7/Queue.pyi b/mypy/data/stubs/2.7/Queue.pyi similarity index 100% rename from stubs/2.7/Queue.pyi rename to mypy/data/stubs/2.7/Queue.pyi diff --git a/stubs/2.7/StringIO.pyi b/mypy/data/stubs/2.7/StringIO.pyi similarity index 100% rename from stubs/2.7/StringIO.pyi rename to mypy/data/stubs/2.7/StringIO.pyi diff --git a/stubs/2.7/UserDict.pyi b/mypy/data/stubs/2.7/UserDict.pyi similarity index 100% rename from stubs/2.7/UserDict.pyi rename to mypy/data/stubs/2.7/UserDict.pyi diff --git a/stubs/2.7/__future__.pyi b/mypy/data/stubs/2.7/__future__.pyi similarity index 100% rename from stubs/2.7/__future__.pyi rename to mypy/data/stubs/2.7/__future__.pyi diff --git a/stubs/2.7/_random.pyi b/mypy/data/stubs/2.7/_random.pyi similarity index 100% rename from stubs/2.7/_random.pyi rename to mypy/data/stubs/2.7/_random.pyi diff --git a/stubs/2.7/abc.pyi b/mypy/data/stubs/2.7/abc.pyi similarity index 100% rename from stubs/2.7/abc.pyi rename to mypy/data/stubs/2.7/abc.pyi diff --git a/stubs/2.7/argparse.pyi b/mypy/data/stubs/2.7/argparse.pyi similarity index 100% rename from stubs/2.7/argparse.pyi rename to mypy/data/stubs/2.7/argparse.pyi diff --git a/stubs/2.7/atexit.pyi b/mypy/data/stubs/2.7/atexit.pyi similarity index 100% rename from stubs/2.7/atexit.pyi rename to mypy/data/stubs/2.7/atexit.pyi diff --git a/stubs/2.7/base64.pyi b/mypy/data/stubs/2.7/base64.pyi similarity index 100% rename from stubs/2.7/base64.pyi rename to mypy/data/stubs/2.7/base64.pyi diff --git a/stubs/2.7/binascii.pyi b/mypy/data/stubs/2.7/binascii.pyi similarity index 100% rename from stubs/2.7/binascii.pyi rename to mypy/data/stubs/2.7/binascii.pyi diff --git a/stubs/2.7/builtins.pyi b/mypy/data/stubs/2.7/builtins.pyi similarity index 100% rename from stubs/2.7/builtins.pyi rename to mypy/data/stubs/2.7/builtins.pyi diff --git a/stubs/2.7/cStringIO.pyi b/mypy/data/stubs/2.7/cStringIO.pyi similarity index 100% rename from stubs/2.7/cStringIO.pyi rename to mypy/data/stubs/2.7/cStringIO.pyi diff --git a/stubs/2.7/codecs.pyi b/mypy/data/stubs/2.7/codecs.pyi similarity index 100% rename from stubs/2.7/codecs.pyi rename to mypy/data/stubs/2.7/codecs.pyi diff --git a/stubs/2.7/collections.pyi b/mypy/data/stubs/2.7/collections.pyi similarity index 100% rename from stubs/2.7/collections.pyi rename to mypy/data/stubs/2.7/collections.pyi diff --git a/stubs/2.7/compileall.pyi b/mypy/data/stubs/2.7/compileall.pyi similarity index 100% rename from stubs/2.7/compileall.pyi rename to mypy/data/stubs/2.7/compileall.pyi diff --git a/stubs/2.7/contextlib.pyi b/mypy/data/stubs/2.7/contextlib.pyi similarity index 100% rename from stubs/2.7/contextlib.pyi rename to mypy/data/stubs/2.7/contextlib.pyi diff --git a/stubs/2.7/copy.pyi b/mypy/data/stubs/2.7/copy.pyi similarity index 100% rename from stubs/2.7/copy.pyi rename to mypy/data/stubs/2.7/copy.pyi diff --git a/stubs/2.7/csv.pyi b/mypy/data/stubs/2.7/csv.pyi similarity index 100% rename from stubs/2.7/csv.pyi rename to mypy/data/stubs/2.7/csv.pyi diff --git a/stubs/2.7/datetime.pyi b/mypy/data/stubs/2.7/datetime.pyi similarity index 100% rename from stubs/2.7/datetime.pyi rename to mypy/data/stubs/2.7/datetime.pyi diff --git a/stubs/2.7/difflib.pyi b/mypy/data/stubs/2.7/difflib.pyi similarity index 100% rename from stubs/2.7/difflib.pyi rename to mypy/data/stubs/2.7/difflib.pyi diff --git a/stubs/2.7/distutils/__init__.pyi b/mypy/data/stubs/2.7/distutils/__init__.pyi similarity index 100% rename from stubs/2.7/distutils/__init__.pyi rename to mypy/data/stubs/2.7/distutils/__init__.pyi diff --git a/stubs/2.7/distutils/version.pyi b/mypy/data/stubs/2.7/distutils/version.pyi similarity index 100% rename from stubs/2.7/distutils/version.pyi rename to mypy/data/stubs/2.7/distutils/version.pyi diff --git a/stubs/2.7/email/MIMEText.pyi b/mypy/data/stubs/2.7/email/MIMEText.pyi similarity index 100% rename from stubs/2.7/email/MIMEText.pyi rename to mypy/data/stubs/2.7/email/MIMEText.pyi diff --git a/stubs/2.7/email/__init__.pyi b/mypy/data/stubs/2.7/email/__init__.pyi similarity index 100% rename from stubs/2.7/email/__init__.pyi rename to mypy/data/stubs/2.7/email/__init__.pyi diff --git a/stubs/2.7/email/mime/__init__.pyi b/mypy/data/stubs/2.7/email/mime/__init__.pyi similarity index 100% rename from stubs/2.7/email/mime/__init__.pyi rename to mypy/data/stubs/2.7/email/mime/__init__.pyi diff --git a/stubs/2.7/email/mime/base.pyi b/mypy/data/stubs/2.7/email/mime/base.pyi similarity index 100% rename from stubs/2.7/email/mime/base.pyi rename to mypy/data/stubs/2.7/email/mime/base.pyi diff --git a/stubs/2.7/email/mime/multipart.pyi b/mypy/data/stubs/2.7/email/mime/multipart.pyi similarity index 100% rename from stubs/2.7/email/mime/multipart.pyi rename to mypy/data/stubs/2.7/email/mime/multipart.pyi diff --git a/stubs/2.7/email/mime/nonmultipart.pyi b/mypy/data/stubs/2.7/email/mime/nonmultipart.pyi similarity index 100% rename from stubs/2.7/email/mime/nonmultipart.pyi rename to mypy/data/stubs/2.7/email/mime/nonmultipart.pyi diff --git a/stubs/2.7/email/mime/text.pyi b/mypy/data/stubs/2.7/email/mime/text.pyi similarity index 100% rename from stubs/2.7/email/mime/text.pyi rename to mypy/data/stubs/2.7/email/mime/text.pyi diff --git a/stubs/2.7/errno.pyi b/mypy/data/stubs/2.7/errno.pyi similarity index 100% rename from stubs/2.7/errno.pyi rename to mypy/data/stubs/2.7/errno.pyi diff --git a/stubs/2.7/fcntl.pyi b/mypy/data/stubs/2.7/fcntl.pyi similarity index 100% rename from stubs/2.7/fcntl.pyi rename to mypy/data/stubs/2.7/fcntl.pyi diff --git a/stubs/2.7/fnmatch.pyi b/mypy/data/stubs/2.7/fnmatch.pyi similarity index 100% rename from stubs/2.7/fnmatch.pyi rename to mypy/data/stubs/2.7/fnmatch.pyi diff --git a/stubs/2.7/functools.pyi b/mypy/data/stubs/2.7/functools.pyi similarity index 100% rename from stubs/2.7/functools.pyi rename to mypy/data/stubs/2.7/functools.pyi diff --git a/stubs/2.7/gc.pyi b/mypy/data/stubs/2.7/gc.pyi similarity index 100% rename from stubs/2.7/gc.pyi rename to mypy/data/stubs/2.7/gc.pyi diff --git a/stubs/2.7/getpass.pyi b/mypy/data/stubs/2.7/getpass.pyi similarity index 100% rename from stubs/2.7/getpass.pyi rename to mypy/data/stubs/2.7/getpass.pyi diff --git a/stubs/2.7/gettext.pyi b/mypy/data/stubs/2.7/gettext.pyi similarity index 100% rename from stubs/2.7/gettext.pyi rename to mypy/data/stubs/2.7/gettext.pyi diff --git a/stubs/2.7/glob.pyi b/mypy/data/stubs/2.7/glob.pyi similarity index 100% rename from stubs/2.7/glob.pyi rename to mypy/data/stubs/2.7/glob.pyi diff --git a/stubs/2.7/gzip.pyi b/mypy/data/stubs/2.7/gzip.pyi similarity index 100% rename from stubs/2.7/gzip.pyi rename to mypy/data/stubs/2.7/gzip.pyi diff --git a/stubs/2.7/hashlib.pyi b/mypy/data/stubs/2.7/hashlib.pyi similarity index 100% rename from stubs/2.7/hashlib.pyi rename to mypy/data/stubs/2.7/hashlib.pyi diff --git a/stubs/2.7/hmac.pyi b/mypy/data/stubs/2.7/hmac.pyi similarity index 100% rename from stubs/2.7/hmac.pyi rename to mypy/data/stubs/2.7/hmac.pyi diff --git a/stubs/2.7/htmlentitydefs.pyi b/mypy/data/stubs/2.7/htmlentitydefs.pyi similarity index 100% rename from stubs/2.7/htmlentitydefs.pyi rename to mypy/data/stubs/2.7/htmlentitydefs.pyi diff --git a/stubs/2.7/imp.pyi b/mypy/data/stubs/2.7/imp.pyi similarity index 100% rename from stubs/2.7/imp.pyi rename to mypy/data/stubs/2.7/imp.pyi diff --git a/stubs/2.7/importlib.pyi b/mypy/data/stubs/2.7/importlib.pyi similarity index 100% rename from stubs/2.7/importlib.pyi rename to mypy/data/stubs/2.7/importlib.pyi diff --git a/stubs/2.7/inspect.pyi b/mypy/data/stubs/2.7/inspect.pyi similarity index 100% rename from stubs/2.7/inspect.pyi rename to mypy/data/stubs/2.7/inspect.pyi diff --git a/stubs/2.7/io.pyi b/mypy/data/stubs/2.7/io.pyi similarity index 100% rename from stubs/2.7/io.pyi rename to mypy/data/stubs/2.7/io.pyi diff --git a/stubs/2.7/itertools.pyi b/mypy/data/stubs/2.7/itertools.pyi similarity index 100% rename from stubs/2.7/itertools.pyi rename to mypy/data/stubs/2.7/itertools.pyi diff --git a/stubs/2.7/json.pyi b/mypy/data/stubs/2.7/json.pyi similarity index 100% rename from stubs/2.7/json.pyi rename to mypy/data/stubs/2.7/json.pyi diff --git a/stubs/2.7/logging/__init__.pyi b/mypy/data/stubs/2.7/logging/__init__.pyi similarity index 100% rename from stubs/2.7/logging/__init__.pyi rename to mypy/data/stubs/2.7/logging/__init__.pyi diff --git a/stubs/2.7/logging/handlers.pyi b/mypy/data/stubs/2.7/logging/handlers.pyi similarity index 100% rename from stubs/2.7/logging/handlers.pyi rename to mypy/data/stubs/2.7/logging/handlers.pyi diff --git a/stubs/2.7/marshal.pyi b/mypy/data/stubs/2.7/marshal.pyi similarity index 100% rename from stubs/2.7/marshal.pyi rename to mypy/data/stubs/2.7/marshal.pyi diff --git a/stubs/2.7/math.pyi b/mypy/data/stubs/2.7/math.pyi similarity index 100% rename from stubs/2.7/math.pyi rename to mypy/data/stubs/2.7/math.pyi diff --git a/stubs/2.7/md5.pyi b/mypy/data/stubs/2.7/md5.pyi similarity index 100% rename from stubs/2.7/md5.pyi rename to mypy/data/stubs/2.7/md5.pyi diff --git a/stubs/2.7/numbers.pyi b/mypy/data/stubs/2.7/numbers.pyi similarity index 100% rename from stubs/2.7/numbers.pyi rename to mypy/data/stubs/2.7/numbers.pyi diff --git a/stubs/2.7/operator.pyi b/mypy/data/stubs/2.7/operator.pyi similarity index 100% rename from stubs/2.7/operator.pyi rename to mypy/data/stubs/2.7/operator.pyi diff --git a/stubs/2.7/os/__init__.pyi b/mypy/data/stubs/2.7/os/__init__.pyi similarity index 100% rename from stubs/2.7/os/__init__.pyi rename to mypy/data/stubs/2.7/os/__init__.pyi diff --git a/stubs/2.7/os/path.pyi b/mypy/data/stubs/2.7/os/path.pyi similarity index 100% rename from stubs/2.7/os/path.pyi rename to mypy/data/stubs/2.7/os/path.pyi diff --git a/stubs/2.7/pickle.pyi b/mypy/data/stubs/2.7/pickle.pyi similarity index 100% rename from stubs/2.7/pickle.pyi rename to mypy/data/stubs/2.7/pickle.pyi diff --git a/stubs/2.7/pipes.pyi b/mypy/data/stubs/2.7/pipes.pyi similarity index 100% rename from stubs/2.7/pipes.pyi rename to mypy/data/stubs/2.7/pipes.pyi diff --git a/stubs/2.7/pprint.pyi b/mypy/data/stubs/2.7/pprint.pyi similarity index 100% rename from stubs/2.7/pprint.pyi rename to mypy/data/stubs/2.7/pprint.pyi diff --git a/stubs/2.7/random.pyi b/mypy/data/stubs/2.7/random.pyi similarity index 100% rename from stubs/2.7/random.pyi rename to mypy/data/stubs/2.7/random.pyi diff --git a/stubs/2.7/re.pyi b/mypy/data/stubs/2.7/re.pyi similarity index 100% rename from stubs/2.7/re.pyi rename to mypy/data/stubs/2.7/re.pyi diff --git a/stubs/2.7/resource.pyi b/mypy/data/stubs/2.7/resource.pyi similarity index 100% rename from stubs/2.7/resource.pyi rename to mypy/data/stubs/2.7/resource.pyi diff --git a/stubs/2.7/select.pyi b/mypy/data/stubs/2.7/select.pyi similarity index 100% rename from stubs/2.7/select.pyi rename to mypy/data/stubs/2.7/select.pyi diff --git a/stubs/2.7/sha.pyi b/mypy/data/stubs/2.7/sha.pyi similarity index 100% rename from stubs/2.7/sha.pyi rename to mypy/data/stubs/2.7/sha.pyi diff --git a/stubs/2.7/shlex.pyi b/mypy/data/stubs/2.7/shlex.pyi similarity index 100% rename from stubs/2.7/shlex.pyi rename to mypy/data/stubs/2.7/shlex.pyi diff --git a/stubs/2.7/shutil.pyi b/mypy/data/stubs/2.7/shutil.pyi similarity index 100% rename from stubs/2.7/shutil.pyi rename to mypy/data/stubs/2.7/shutil.pyi diff --git a/stubs/2.7/signal.pyi b/mypy/data/stubs/2.7/signal.pyi similarity index 100% rename from stubs/2.7/signal.pyi rename to mypy/data/stubs/2.7/signal.pyi diff --git a/stubs/2.7/simplejson.pyi b/mypy/data/stubs/2.7/simplejson.pyi similarity index 100% rename from stubs/2.7/simplejson.pyi rename to mypy/data/stubs/2.7/simplejson.pyi diff --git a/stubs/2.7/smtplib.pyi b/mypy/data/stubs/2.7/smtplib.pyi similarity index 100% rename from stubs/2.7/smtplib.pyi rename to mypy/data/stubs/2.7/smtplib.pyi diff --git a/stubs/2.7/socket.pyi b/mypy/data/stubs/2.7/socket.pyi similarity index 100% rename from stubs/2.7/socket.pyi rename to mypy/data/stubs/2.7/socket.pyi diff --git a/stubs/2.7/stat.pyi b/mypy/data/stubs/2.7/stat.pyi similarity index 100% rename from stubs/2.7/stat.pyi rename to mypy/data/stubs/2.7/stat.pyi diff --git a/stubs/2.7/string.pyi b/mypy/data/stubs/2.7/string.pyi similarity index 100% rename from stubs/2.7/string.pyi rename to mypy/data/stubs/2.7/string.pyi diff --git a/stubs/2.7/struct.pyi b/mypy/data/stubs/2.7/struct.pyi similarity index 100% rename from stubs/2.7/struct.pyi rename to mypy/data/stubs/2.7/struct.pyi diff --git a/stubs/2.7/subprocess.pyi b/mypy/data/stubs/2.7/subprocess.pyi similarity index 100% rename from stubs/2.7/subprocess.pyi rename to mypy/data/stubs/2.7/subprocess.pyi diff --git a/stubs/2.7/sys.pyi b/mypy/data/stubs/2.7/sys.pyi similarity index 100% rename from stubs/2.7/sys.pyi rename to mypy/data/stubs/2.7/sys.pyi diff --git a/stubs/2.7/tarfile.pyi b/mypy/data/stubs/2.7/tarfile.pyi similarity index 100% rename from stubs/2.7/tarfile.pyi rename to mypy/data/stubs/2.7/tarfile.pyi diff --git a/stubs/2.7/tempfile.pyi b/mypy/data/stubs/2.7/tempfile.pyi similarity index 100% rename from stubs/2.7/tempfile.pyi rename to mypy/data/stubs/2.7/tempfile.pyi diff --git a/stubs/2.7/textwrap.pyi b/mypy/data/stubs/2.7/textwrap.pyi similarity index 100% rename from stubs/2.7/textwrap.pyi rename to mypy/data/stubs/2.7/textwrap.pyi diff --git a/stubs/2.7/thread.pyi b/mypy/data/stubs/2.7/thread.pyi similarity index 100% rename from stubs/2.7/thread.pyi rename to mypy/data/stubs/2.7/thread.pyi diff --git a/stubs/2.7/threading.pyi b/mypy/data/stubs/2.7/threading.pyi similarity index 100% rename from stubs/2.7/threading.pyi rename to mypy/data/stubs/2.7/threading.pyi diff --git a/stubs/2.7/time.pyi b/mypy/data/stubs/2.7/time.pyi similarity index 100% rename from stubs/2.7/time.pyi rename to mypy/data/stubs/2.7/time.pyi diff --git a/stubs/2.7/traceback.pyi b/mypy/data/stubs/2.7/traceback.pyi similarity index 100% rename from stubs/2.7/traceback.pyi rename to mypy/data/stubs/2.7/traceback.pyi diff --git a/stubs/2.7/types.pyi b/mypy/data/stubs/2.7/types.pyi similarity index 100% rename from stubs/2.7/types.pyi rename to mypy/data/stubs/2.7/types.pyi diff --git a/stubs/2.7/typing.pyi b/mypy/data/stubs/2.7/typing.pyi similarity index 100% rename from stubs/2.7/typing.pyi rename to mypy/data/stubs/2.7/typing.pyi diff --git a/stubs/2.7/unicodedata.pyi b/mypy/data/stubs/2.7/unicodedata.pyi similarity index 100% rename from stubs/2.7/unicodedata.pyi rename to mypy/data/stubs/2.7/unicodedata.pyi diff --git a/stubs/2.7/urllib.pyi b/mypy/data/stubs/2.7/urllib.pyi similarity index 100% rename from stubs/2.7/urllib.pyi rename to mypy/data/stubs/2.7/urllib.pyi diff --git a/stubs/2.7/urlparse.pyi b/mypy/data/stubs/2.7/urlparse.pyi similarity index 100% rename from stubs/2.7/urlparse.pyi rename to mypy/data/stubs/2.7/urlparse.pyi diff --git a/stubs/2.7/uuid.pyi b/mypy/data/stubs/2.7/uuid.pyi similarity index 100% rename from stubs/2.7/uuid.pyi rename to mypy/data/stubs/2.7/uuid.pyi diff --git a/stubs/2.7/xml/__init__.pyi b/mypy/data/stubs/2.7/xml/__init__.pyi similarity index 100% rename from stubs/2.7/xml/__init__.pyi rename to mypy/data/stubs/2.7/xml/__init__.pyi diff --git a/stubs/2.7/xml/sax/__init__.pyi b/mypy/data/stubs/2.7/xml/sax/__init__.pyi similarity index 100% rename from stubs/2.7/xml/sax/__init__.pyi rename to mypy/data/stubs/2.7/xml/sax/__init__.pyi diff --git a/stubs/2.7/xml/sax/handler.pyi b/mypy/data/stubs/2.7/xml/sax/handler.pyi similarity index 100% rename from stubs/2.7/xml/sax/handler.pyi rename to mypy/data/stubs/2.7/xml/sax/handler.pyi diff --git a/stubs/2.7/xml/sax/saxutils.pyi b/mypy/data/stubs/2.7/xml/sax/saxutils.pyi similarity index 100% rename from stubs/2.7/xml/sax/saxutils.pyi rename to mypy/data/stubs/2.7/xml/sax/saxutils.pyi diff --git a/stubs/2.7/xml/sax/xmlreader.pyi b/mypy/data/stubs/2.7/xml/sax/xmlreader.pyi similarity index 100% rename from stubs/2.7/xml/sax/xmlreader.pyi rename to mypy/data/stubs/2.7/xml/sax/xmlreader.pyi diff --git a/stubs/2.7/zlib.pyi b/mypy/data/stubs/2.7/zlib.pyi similarity index 100% rename from stubs/2.7/zlib.pyi rename to mypy/data/stubs/2.7/zlib.pyi diff --git a/stubs/3.2/__future__.pyi b/mypy/data/stubs/3.2/__future__.pyi similarity index 100% rename from stubs/3.2/__future__.pyi rename to mypy/data/stubs/3.2/__future__.pyi diff --git a/stubs/3.2/_dummy_thread.pyi b/mypy/data/stubs/3.2/_dummy_thread.pyi similarity index 100% rename from stubs/3.2/_dummy_thread.pyi rename to mypy/data/stubs/3.2/_dummy_thread.pyi diff --git a/stubs/3.2/_io.pyi b/mypy/data/stubs/3.2/_io.pyi similarity index 100% rename from stubs/3.2/_io.pyi rename to mypy/data/stubs/3.2/_io.pyi diff --git a/stubs/3.2/_locale.pyi b/mypy/data/stubs/3.2/_locale.pyi similarity index 100% rename from stubs/3.2/_locale.pyi rename to mypy/data/stubs/3.2/_locale.pyi diff --git a/stubs/3.2/_posixsubprocess.pyi b/mypy/data/stubs/3.2/_posixsubprocess.pyi similarity index 100% rename from stubs/3.2/_posixsubprocess.pyi rename to mypy/data/stubs/3.2/_posixsubprocess.pyi diff --git a/stubs/3.2/_random.pyi b/mypy/data/stubs/3.2/_random.pyi similarity index 100% rename from stubs/3.2/_random.pyi rename to mypy/data/stubs/3.2/_random.pyi diff --git a/stubs/3.2/_subprocess.pyi b/mypy/data/stubs/3.2/_subprocess.pyi similarity index 100% rename from stubs/3.2/_subprocess.pyi rename to mypy/data/stubs/3.2/_subprocess.pyi diff --git a/stubs/3.2/_thread.pyi b/mypy/data/stubs/3.2/_thread.pyi similarity index 100% rename from stubs/3.2/_thread.pyi rename to mypy/data/stubs/3.2/_thread.pyi diff --git a/stubs/3.2/abc.pyi b/mypy/data/stubs/3.2/abc.pyi similarity index 100% rename from stubs/3.2/abc.pyi rename to mypy/data/stubs/3.2/abc.pyi diff --git a/stubs/3.2/argparse.pyi b/mypy/data/stubs/3.2/argparse.pyi similarity index 100% rename from stubs/3.2/argparse.pyi rename to mypy/data/stubs/3.2/argparse.pyi diff --git a/stubs/3.2/array.pyi b/mypy/data/stubs/3.2/array.pyi similarity index 100% rename from stubs/3.2/array.pyi rename to mypy/data/stubs/3.2/array.pyi diff --git a/stubs/3.2/atexit.pyi b/mypy/data/stubs/3.2/atexit.pyi similarity index 100% rename from stubs/3.2/atexit.pyi rename to mypy/data/stubs/3.2/atexit.pyi diff --git a/stubs/3.2/base64.pyi b/mypy/data/stubs/3.2/base64.pyi similarity index 100% rename from stubs/3.2/base64.pyi rename to mypy/data/stubs/3.2/base64.pyi diff --git a/stubs/3.2/binascii.pyi b/mypy/data/stubs/3.2/binascii.pyi similarity index 100% rename from stubs/3.2/binascii.pyi rename to mypy/data/stubs/3.2/binascii.pyi diff --git a/stubs/3.2/bisect.pyi b/mypy/data/stubs/3.2/bisect.pyi similarity index 100% rename from stubs/3.2/bisect.pyi rename to mypy/data/stubs/3.2/bisect.pyi diff --git a/stubs/3.2/builtins.pyi b/mypy/data/stubs/3.2/builtins.pyi similarity index 100% rename from stubs/3.2/builtins.pyi rename to mypy/data/stubs/3.2/builtins.pyi diff --git a/stubs/3.2/bz2.pyi b/mypy/data/stubs/3.2/bz2.pyi similarity index 100% rename from stubs/3.2/bz2.pyi rename to mypy/data/stubs/3.2/bz2.pyi diff --git a/stubs/3.2/calendar.pyi b/mypy/data/stubs/3.2/calendar.pyi similarity index 100% rename from stubs/3.2/calendar.pyi rename to mypy/data/stubs/3.2/calendar.pyi diff --git a/stubs/3.2/cgi.pyi b/mypy/data/stubs/3.2/cgi.pyi similarity index 100% rename from stubs/3.2/cgi.pyi rename to mypy/data/stubs/3.2/cgi.pyi diff --git a/stubs/3.2/codecs.pyi b/mypy/data/stubs/3.2/codecs.pyi similarity index 100% rename from stubs/3.2/codecs.pyi rename to mypy/data/stubs/3.2/codecs.pyi diff --git a/stubs/3.2/collections.pyi b/mypy/data/stubs/3.2/collections.pyi similarity index 100% rename from stubs/3.2/collections.pyi rename to mypy/data/stubs/3.2/collections.pyi diff --git a/stubs/3.2/contextlib.pyi b/mypy/data/stubs/3.2/contextlib.pyi similarity index 100% rename from stubs/3.2/contextlib.pyi rename to mypy/data/stubs/3.2/contextlib.pyi diff --git a/stubs/3.2/copy.pyi b/mypy/data/stubs/3.2/copy.pyi similarity index 100% rename from stubs/3.2/copy.pyi rename to mypy/data/stubs/3.2/copy.pyi diff --git a/stubs/3.2/csv.pyi b/mypy/data/stubs/3.2/csv.pyi similarity index 100% rename from stubs/3.2/csv.pyi rename to mypy/data/stubs/3.2/csv.pyi diff --git a/stubs/3.2/datetime.pyi b/mypy/data/stubs/3.2/datetime.pyi similarity index 100% rename from stubs/3.2/datetime.pyi rename to mypy/data/stubs/3.2/datetime.pyi diff --git a/stubs/3.2/decimal.pyi b/mypy/data/stubs/3.2/decimal.pyi similarity index 100% rename from stubs/3.2/decimal.pyi rename to mypy/data/stubs/3.2/decimal.pyi diff --git a/stubs/3.2/difflib.pyi b/mypy/data/stubs/3.2/difflib.pyi similarity index 100% rename from stubs/3.2/difflib.pyi rename to mypy/data/stubs/3.2/difflib.pyi diff --git a/stubs/3.2/distutils/__init__.pyi b/mypy/data/stubs/3.2/distutils/__init__.pyi similarity index 100% rename from stubs/3.2/distutils/__init__.pyi rename to mypy/data/stubs/3.2/distutils/__init__.pyi diff --git a/stubs/3.2/distutils/errors.pyi b/mypy/data/stubs/3.2/distutils/errors.pyi similarity index 100% rename from stubs/3.2/distutils/errors.pyi rename to mypy/data/stubs/3.2/distutils/errors.pyi diff --git a/stubs/3.2/distutils/spawn.pyi b/mypy/data/stubs/3.2/distutils/spawn.pyi similarity index 100% rename from stubs/3.2/distutils/spawn.pyi rename to mypy/data/stubs/3.2/distutils/spawn.pyi diff --git a/stubs/3.2/doctest.pyi b/mypy/data/stubs/3.2/doctest.pyi similarity index 100% rename from stubs/3.2/doctest.pyi rename to mypy/data/stubs/3.2/doctest.pyi diff --git a/stubs/3.2/email/__init__.pyi b/mypy/data/stubs/3.2/email/__init__.pyi similarity index 100% rename from stubs/3.2/email/__init__.pyi rename to mypy/data/stubs/3.2/email/__init__.pyi diff --git a/stubs/3.2/email/_header_value_parser.pyi b/mypy/data/stubs/3.2/email/_header_value_parser.pyi similarity index 100% rename from stubs/3.2/email/_header_value_parser.pyi rename to mypy/data/stubs/3.2/email/_header_value_parser.pyi diff --git a/stubs/3.2/email/_parseaddr.pyi b/mypy/data/stubs/3.2/email/_parseaddr.pyi similarity index 100% rename from stubs/3.2/email/_parseaddr.pyi rename to mypy/data/stubs/3.2/email/_parseaddr.pyi diff --git a/stubs/3.2/email/_policybase.pyi b/mypy/data/stubs/3.2/email/_policybase.pyi similarity index 100% rename from stubs/3.2/email/_policybase.pyi rename to mypy/data/stubs/3.2/email/_policybase.pyi diff --git a/stubs/3.2/email/base64mime.pyi b/mypy/data/stubs/3.2/email/base64mime.pyi similarity index 100% rename from stubs/3.2/email/base64mime.pyi rename to mypy/data/stubs/3.2/email/base64mime.pyi diff --git a/stubs/3.2/email/charset.pyi b/mypy/data/stubs/3.2/email/charset.pyi similarity index 100% rename from stubs/3.2/email/charset.pyi rename to mypy/data/stubs/3.2/email/charset.pyi diff --git a/stubs/3.2/email/contentmanager.pyi b/mypy/data/stubs/3.2/email/contentmanager.pyi similarity index 100% rename from stubs/3.2/email/contentmanager.pyi rename to mypy/data/stubs/3.2/email/contentmanager.pyi diff --git a/stubs/3.2/email/encoders.pyi b/mypy/data/stubs/3.2/email/encoders.pyi similarity index 100% rename from stubs/3.2/email/encoders.pyi rename to mypy/data/stubs/3.2/email/encoders.pyi diff --git a/stubs/3.2/email/errors.pyi b/mypy/data/stubs/3.2/email/errors.pyi similarity index 100% rename from stubs/3.2/email/errors.pyi rename to mypy/data/stubs/3.2/email/errors.pyi diff --git a/stubs/3.2/email/feedparser.pyi b/mypy/data/stubs/3.2/email/feedparser.pyi similarity index 100% rename from stubs/3.2/email/feedparser.pyi rename to mypy/data/stubs/3.2/email/feedparser.pyi diff --git a/stubs/3.2/email/generator.pyi b/mypy/data/stubs/3.2/email/generator.pyi similarity index 100% rename from stubs/3.2/email/generator.pyi rename to mypy/data/stubs/3.2/email/generator.pyi diff --git a/stubs/3.2/email/header.pyi b/mypy/data/stubs/3.2/email/header.pyi similarity index 100% rename from stubs/3.2/email/header.pyi rename to mypy/data/stubs/3.2/email/header.pyi diff --git a/stubs/3.2/email/headerregistry.pyi b/mypy/data/stubs/3.2/email/headerregistry.pyi similarity index 100% rename from stubs/3.2/email/headerregistry.pyi rename to mypy/data/stubs/3.2/email/headerregistry.pyi diff --git a/stubs/3.2/email/iterators.pyi b/mypy/data/stubs/3.2/email/iterators.pyi similarity index 100% rename from stubs/3.2/email/iterators.pyi rename to mypy/data/stubs/3.2/email/iterators.pyi diff --git a/stubs/3.2/email/message.pyi b/mypy/data/stubs/3.2/email/message.pyi similarity index 100% rename from stubs/3.2/email/message.pyi rename to mypy/data/stubs/3.2/email/message.pyi diff --git a/stubs/3.2/email/mime/__init__.pyi b/mypy/data/stubs/3.2/email/mime/__init__.pyi similarity index 100% rename from stubs/3.2/email/mime/__init__.pyi rename to mypy/data/stubs/3.2/email/mime/__init__.pyi diff --git a/stubs/3.2/email/mime/application.pyi b/mypy/data/stubs/3.2/email/mime/application.pyi similarity index 100% rename from stubs/3.2/email/mime/application.pyi rename to mypy/data/stubs/3.2/email/mime/application.pyi diff --git a/stubs/3.2/email/mime/audio.pyi b/mypy/data/stubs/3.2/email/mime/audio.pyi similarity index 100% rename from stubs/3.2/email/mime/audio.pyi rename to mypy/data/stubs/3.2/email/mime/audio.pyi diff --git a/stubs/3.2/email/mime/base.pyi b/mypy/data/stubs/3.2/email/mime/base.pyi similarity index 100% rename from stubs/3.2/email/mime/base.pyi rename to mypy/data/stubs/3.2/email/mime/base.pyi diff --git a/stubs/3.2/email/mime/image.pyi b/mypy/data/stubs/3.2/email/mime/image.pyi similarity index 100% rename from stubs/3.2/email/mime/image.pyi rename to mypy/data/stubs/3.2/email/mime/image.pyi diff --git a/stubs/3.2/email/mime/message.pyi b/mypy/data/stubs/3.2/email/mime/message.pyi similarity index 100% rename from stubs/3.2/email/mime/message.pyi rename to mypy/data/stubs/3.2/email/mime/message.pyi diff --git a/stubs/3.2/email/mime/multipart.pyi b/mypy/data/stubs/3.2/email/mime/multipart.pyi similarity index 100% rename from stubs/3.2/email/mime/multipart.pyi rename to mypy/data/stubs/3.2/email/mime/multipart.pyi diff --git a/stubs/3.2/email/mime/nonmultipart.pyi b/mypy/data/stubs/3.2/email/mime/nonmultipart.pyi similarity index 100% rename from stubs/3.2/email/mime/nonmultipart.pyi rename to mypy/data/stubs/3.2/email/mime/nonmultipart.pyi diff --git a/stubs/3.2/email/mime/text.pyi b/mypy/data/stubs/3.2/email/mime/text.pyi similarity index 100% rename from stubs/3.2/email/mime/text.pyi rename to mypy/data/stubs/3.2/email/mime/text.pyi diff --git a/stubs/3.2/email/parser.pyi b/mypy/data/stubs/3.2/email/parser.pyi similarity index 100% rename from stubs/3.2/email/parser.pyi rename to mypy/data/stubs/3.2/email/parser.pyi diff --git a/stubs/3.2/email/policy.pyi b/mypy/data/stubs/3.2/email/policy.pyi similarity index 100% rename from stubs/3.2/email/policy.pyi rename to mypy/data/stubs/3.2/email/policy.pyi diff --git a/stubs/3.2/email/quoprimime.pyi b/mypy/data/stubs/3.2/email/quoprimime.pyi similarity index 100% rename from stubs/3.2/email/quoprimime.pyi rename to mypy/data/stubs/3.2/email/quoprimime.pyi diff --git a/stubs/3.2/email/utils.pyi b/mypy/data/stubs/3.2/email/utils.pyi similarity index 100% rename from stubs/3.2/email/utils.pyi rename to mypy/data/stubs/3.2/email/utils.pyi diff --git a/stubs/3.2/encodings/__init__.pyi b/mypy/data/stubs/3.2/encodings/__init__.pyi similarity index 100% rename from stubs/3.2/encodings/__init__.pyi rename to mypy/data/stubs/3.2/encodings/__init__.pyi diff --git a/stubs/3.2/encodings/utf_8.pyi b/mypy/data/stubs/3.2/encodings/utf_8.pyi similarity index 100% rename from stubs/3.2/encodings/utf_8.pyi rename to mypy/data/stubs/3.2/encodings/utf_8.pyi diff --git a/stubs/3.2/errno.pyi b/mypy/data/stubs/3.2/errno.pyi similarity index 100% rename from stubs/3.2/errno.pyi rename to mypy/data/stubs/3.2/errno.pyi diff --git a/stubs/3.2/fcntl.pyi b/mypy/data/stubs/3.2/fcntl.pyi similarity index 100% rename from stubs/3.2/fcntl.pyi rename to mypy/data/stubs/3.2/fcntl.pyi diff --git a/stubs/3.2/fnmatch.pyi b/mypy/data/stubs/3.2/fnmatch.pyi similarity index 100% rename from stubs/3.2/fnmatch.pyi rename to mypy/data/stubs/3.2/fnmatch.pyi diff --git a/stubs/3.2/functools.pyi b/mypy/data/stubs/3.2/functools.pyi similarity index 100% rename from stubs/3.2/functools.pyi rename to mypy/data/stubs/3.2/functools.pyi diff --git a/stubs/3.2/gc.pyi b/mypy/data/stubs/3.2/gc.pyi similarity index 100% rename from stubs/3.2/gc.pyi rename to mypy/data/stubs/3.2/gc.pyi diff --git a/stubs/3.2/getopt.pyi b/mypy/data/stubs/3.2/getopt.pyi similarity index 100% rename from stubs/3.2/getopt.pyi rename to mypy/data/stubs/3.2/getopt.pyi diff --git a/stubs/3.2/getpass.pyi b/mypy/data/stubs/3.2/getpass.pyi similarity index 100% rename from stubs/3.2/getpass.pyi rename to mypy/data/stubs/3.2/getpass.pyi diff --git a/stubs/3.2/gettext.pyi b/mypy/data/stubs/3.2/gettext.pyi similarity index 100% rename from stubs/3.2/gettext.pyi rename to mypy/data/stubs/3.2/gettext.pyi diff --git a/stubs/3.2/glob.pyi b/mypy/data/stubs/3.2/glob.pyi similarity index 100% rename from stubs/3.2/glob.pyi rename to mypy/data/stubs/3.2/glob.pyi diff --git a/stubs/3.2/grp.pyi b/mypy/data/stubs/3.2/grp.pyi similarity index 100% rename from stubs/3.2/grp.pyi rename to mypy/data/stubs/3.2/grp.pyi diff --git a/stubs/3.2/hashlib.pyi b/mypy/data/stubs/3.2/hashlib.pyi similarity index 100% rename from stubs/3.2/hashlib.pyi rename to mypy/data/stubs/3.2/hashlib.pyi diff --git a/stubs/3.2/heapq.pyi b/mypy/data/stubs/3.2/heapq.pyi similarity index 100% rename from stubs/3.2/heapq.pyi rename to mypy/data/stubs/3.2/heapq.pyi diff --git a/stubs/3.2/http/__init__.pyi b/mypy/data/stubs/3.2/http/__init__.pyi similarity index 100% rename from stubs/3.2/http/__init__.pyi rename to mypy/data/stubs/3.2/http/__init__.pyi diff --git a/stubs/3.2/http/client.pyi b/mypy/data/stubs/3.2/http/client.pyi similarity index 100% rename from stubs/3.2/http/client.pyi rename to mypy/data/stubs/3.2/http/client.pyi diff --git a/stubs/3.2/http/cookiejar.pyi b/mypy/data/stubs/3.2/http/cookiejar.pyi similarity index 100% rename from stubs/3.2/http/cookiejar.pyi rename to mypy/data/stubs/3.2/http/cookiejar.pyi diff --git a/stubs/3.2/imp.pyi b/mypy/data/stubs/3.2/imp.pyi similarity index 100% rename from stubs/3.2/imp.pyi rename to mypy/data/stubs/3.2/imp.pyi diff --git a/stubs/3.2/importlib.pyi b/mypy/data/stubs/3.2/importlib.pyi similarity index 100% rename from stubs/3.2/importlib.pyi rename to mypy/data/stubs/3.2/importlib.pyi diff --git a/stubs/3.2/inspect.pyi b/mypy/data/stubs/3.2/inspect.pyi similarity index 100% rename from stubs/3.2/inspect.pyi rename to mypy/data/stubs/3.2/inspect.pyi diff --git a/stubs/3.2/io.pyi b/mypy/data/stubs/3.2/io.pyi similarity index 100% rename from stubs/3.2/io.pyi rename to mypy/data/stubs/3.2/io.pyi diff --git a/stubs/3.2/itertools.pyi b/mypy/data/stubs/3.2/itertools.pyi similarity index 100% rename from stubs/3.2/itertools.pyi rename to mypy/data/stubs/3.2/itertools.pyi diff --git a/stubs/3.2/json.pyi b/mypy/data/stubs/3.2/json.pyi similarity index 100% rename from stubs/3.2/json.pyi rename to mypy/data/stubs/3.2/json.pyi diff --git a/stubs/3.2/linecache.pyi b/mypy/data/stubs/3.2/linecache.pyi similarity index 100% rename from stubs/3.2/linecache.pyi rename to mypy/data/stubs/3.2/linecache.pyi diff --git a/stubs/3.2/locale.pyi b/mypy/data/stubs/3.2/locale.pyi similarity index 100% rename from stubs/3.2/locale.pyi rename to mypy/data/stubs/3.2/locale.pyi diff --git a/stubs/3.2/logging/__init__.pyi b/mypy/data/stubs/3.2/logging/__init__.pyi similarity index 100% rename from stubs/3.2/logging/__init__.pyi rename to mypy/data/stubs/3.2/logging/__init__.pyi diff --git a/stubs/3.2/logging/handlers.pyi b/mypy/data/stubs/3.2/logging/handlers.pyi similarity index 100% rename from stubs/3.2/logging/handlers.pyi rename to mypy/data/stubs/3.2/logging/handlers.pyi diff --git a/stubs/3.2/math.pyi b/mypy/data/stubs/3.2/math.pyi similarity index 100% rename from stubs/3.2/math.pyi rename to mypy/data/stubs/3.2/math.pyi diff --git a/stubs/3.2/msvcrt.pyi b/mypy/data/stubs/3.2/msvcrt.pyi similarity index 100% rename from stubs/3.2/msvcrt.pyi rename to mypy/data/stubs/3.2/msvcrt.pyi diff --git a/stubs/3.2/multiprocessing/__init__.pyi b/mypy/data/stubs/3.2/multiprocessing/__init__.pyi similarity index 100% rename from stubs/3.2/multiprocessing/__init__.pyi rename to mypy/data/stubs/3.2/multiprocessing/__init__.pyi diff --git a/stubs/3.2/multiprocessing/managers.pyi b/mypy/data/stubs/3.2/multiprocessing/managers.pyi similarity index 100% rename from stubs/3.2/multiprocessing/managers.pyi rename to mypy/data/stubs/3.2/multiprocessing/managers.pyi diff --git a/stubs/3.2/multiprocessing/pool.pyi b/mypy/data/stubs/3.2/multiprocessing/pool.pyi similarity index 100% rename from stubs/3.2/multiprocessing/pool.pyi rename to mypy/data/stubs/3.2/multiprocessing/pool.pyi diff --git a/stubs/3.2/operator.pyi b/mypy/data/stubs/3.2/operator.pyi similarity index 100% rename from stubs/3.2/operator.pyi rename to mypy/data/stubs/3.2/operator.pyi diff --git a/stubs/3.2/os/__init__.pyi b/mypy/data/stubs/3.2/os/__init__.pyi similarity index 100% rename from stubs/3.2/os/__init__.pyi rename to mypy/data/stubs/3.2/os/__init__.pyi diff --git a/stubs/3.2/os/path.pyi b/mypy/data/stubs/3.2/os/path.pyi similarity index 100% rename from stubs/3.2/os/path.pyi rename to mypy/data/stubs/3.2/os/path.pyi diff --git a/stubs/3.2/pickle.pyi b/mypy/data/stubs/3.2/pickle.pyi similarity index 100% rename from stubs/3.2/pickle.pyi rename to mypy/data/stubs/3.2/pickle.pyi diff --git a/stubs/3.2/pipes.pyi b/mypy/data/stubs/3.2/pipes.pyi similarity index 100% rename from stubs/3.2/pipes.pyi rename to mypy/data/stubs/3.2/pipes.pyi diff --git a/stubs/3.2/platform.pyi b/mypy/data/stubs/3.2/platform.pyi similarity index 100% rename from stubs/3.2/platform.pyi rename to mypy/data/stubs/3.2/platform.pyi diff --git a/stubs/3.2/posix.pyi b/mypy/data/stubs/3.2/posix.pyi similarity index 100% rename from stubs/3.2/posix.pyi rename to mypy/data/stubs/3.2/posix.pyi diff --git a/stubs/3.2/posixpath.pyi b/mypy/data/stubs/3.2/posixpath.pyi similarity index 100% rename from stubs/3.2/posixpath.pyi rename to mypy/data/stubs/3.2/posixpath.pyi diff --git a/stubs/3.2/pprint.pyi b/mypy/data/stubs/3.2/pprint.pyi similarity index 100% rename from stubs/3.2/pprint.pyi rename to mypy/data/stubs/3.2/pprint.pyi diff --git a/stubs/3.2/pwd.pyi b/mypy/data/stubs/3.2/pwd.pyi similarity index 100% rename from stubs/3.2/pwd.pyi rename to mypy/data/stubs/3.2/pwd.pyi diff --git a/stubs/3.2/queue.pyi b/mypy/data/stubs/3.2/queue.pyi similarity index 100% rename from stubs/3.2/queue.pyi rename to mypy/data/stubs/3.2/queue.pyi diff --git a/stubs/3.2/random.pyi b/mypy/data/stubs/3.2/random.pyi similarity index 100% rename from stubs/3.2/random.pyi rename to mypy/data/stubs/3.2/random.pyi diff --git a/stubs/3.2/re.pyi b/mypy/data/stubs/3.2/re.pyi similarity index 100% rename from stubs/3.2/re.pyi rename to mypy/data/stubs/3.2/re.pyi diff --git a/stubs/3.2/resource.pyi b/mypy/data/stubs/3.2/resource.pyi similarity index 100% rename from stubs/3.2/resource.pyi rename to mypy/data/stubs/3.2/resource.pyi diff --git a/stubs/3.2/select.pyi b/mypy/data/stubs/3.2/select.pyi similarity index 100% rename from stubs/3.2/select.pyi rename to mypy/data/stubs/3.2/select.pyi diff --git a/stubs/3.2/shlex.pyi b/mypy/data/stubs/3.2/shlex.pyi similarity index 100% rename from stubs/3.2/shlex.pyi rename to mypy/data/stubs/3.2/shlex.pyi diff --git a/stubs/3.2/shutil.pyi b/mypy/data/stubs/3.2/shutil.pyi similarity index 100% rename from stubs/3.2/shutil.pyi rename to mypy/data/stubs/3.2/shutil.pyi diff --git a/stubs/3.2/signal.pyi b/mypy/data/stubs/3.2/signal.pyi similarity index 100% rename from stubs/3.2/signal.pyi rename to mypy/data/stubs/3.2/signal.pyi diff --git a/stubs/3.2/smtplib.pyi b/mypy/data/stubs/3.2/smtplib.pyi similarity index 100% rename from stubs/3.2/smtplib.pyi rename to mypy/data/stubs/3.2/smtplib.pyi diff --git a/stubs/3.2/socket.pyi b/mypy/data/stubs/3.2/socket.pyi similarity index 100% rename from stubs/3.2/socket.pyi rename to mypy/data/stubs/3.2/socket.pyi diff --git a/stubs/3.2/socketserver.pyi b/mypy/data/stubs/3.2/socketserver.pyi similarity index 100% rename from stubs/3.2/socketserver.pyi rename to mypy/data/stubs/3.2/socketserver.pyi diff --git a/stubs/3.2/ssl.pyi b/mypy/data/stubs/3.2/ssl.pyi similarity index 100% rename from stubs/3.2/ssl.pyi rename to mypy/data/stubs/3.2/ssl.pyi diff --git a/stubs/3.2/stat.pyi b/mypy/data/stubs/3.2/stat.pyi similarity index 100% rename from stubs/3.2/stat.pyi rename to mypy/data/stubs/3.2/stat.pyi diff --git a/stubs/3.2/string.pyi b/mypy/data/stubs/3.2/string.pyi similarity index 100% rename from stubs/3.2/string.pyi rename to mypy/data/stubs/3.2/string.pyi diff --git a/stubs/3.2/struct.pyi b/mypy/data/stubs/3.2/struct.pyi similarity index 100% rename from stubs/3.2/struct.pyi rename to mypy/data/stubs/3.2/struct.pyi diff --git a/stubs/3.2/subprocess.pyi b/mypy/data/stubs/3.2/subprocess.pyi similarity index 100% rename from stubs/3.2/subprocess.pyi rename to mypy/data/stubs/3.2/subprocess.pyi diff --git a/stubs/3.2/sys.pyi b/mypy/data/stubs/3.2/sys.pyi similarity index 100% rename from stubs/3.2/sys.pyi rename to mypy/data/stubs/3.2/sys.pyi diff --git a/stubs/3.2/sysconfig.pyi b/mypy/data/stubs/3.2/sysconfig.pyi similarity index 100% rename from stubs/3.2/sysconfig.pyi rename to mypy/data/stubs/3.2/sysconfig.pyi diff --git a/stubs/3.2/tarfile.pyi b/mypy/data/stubs/3.2/tarfile.pyi similarity index 100% rename from stubs/3.2/tarfile.pyi rename to mypy/data/stubs/3.2/tarfile.pyi diff --git a/stubs/3.2/tempfile.pyi b/mypy/data/stubs/3.2/tempfile.pyi similarity index 100% rename from stubs/3.2/tempfile.pyi rename to mypy/data/stubs/3.2/tempfile.pyi diff --git a/stubs/3.2/textwrap.pyi b/mypy/data/stubs/3.2/textwrap.pyi similarity index 100% rename from stubs/3.2/textwrap.pyi rename to mypy/data/stubs/3.2/textwrap.pyi diff --git a/stubs/3.2/threading.pyi b/mypy/data/stubs/3.2/threading.pyi similarity index 100% rename from stubs/3.2/threading.pyi rename to mypy/data/stubs/3.2/threading.pyi diff --git a/stubs/3.2/time.pyi b/mypy/data/stubs/3.2/time.pyi similarity index 100% rename from stubs/3.2/time.pyi rename to mypy/data/stubs/3.2/time.pyi diff --git a/stubs/3.2/token.pyi b/mypy/data/stubs/3.2/token.pyi similarity index 100% rename from stubs/3.2/token.pyi rename to mypy/data/stubs/3.2/token.pyi diff --git a/stubs/3.2/traceback.pyi b/mypy/data/stubs/3.2/traceback.pyi similarity index 100% rename from stubs/3.2/traceback.pyi rename to mypy/data/stubs/3.2/traceback.pyi diff --git a/stubs/3.2/types.pyi b/mypy/data/stubs/3.2/types.pyi similarity index 100% rename from stubs/3.2/types.pyi rename to mypy/data/stubs/3.2/types.pyi diff --git a/stubs/3.2/typing.pyi b/mypy/data/stubs/3.2/typing.pyi similarity index 100% rename from stubs/3.2/typing.pyi rename to mypy/data/stubs/3.2/typing.pyi diff --git a/stubs/3.2/unicodedata.pyi b/mypy/data/stubs/3.2/unicodedata.pyi similarity index 100% rename from stubs/3.2/unicodedata.pyi rename to mypy/data/stubs/3.2/unicodedata.pyi diff --git a/stubs/3.2/unittest.pyi b/mypy/data/stubs/3.2/unittest.pyi similarity index 100% rename from stubs/3.2/unittest.pyi rename to mypy/data/stubs/3.2/unittest.pyi diff --git a/stubs/3.2/urllib/__init__.pyi b/mypy/data/stubs/3.2/urllib/__init__.pyi similarity index 100% rename from stubs/3.2/urllib/__init__.pyi rename to mypy/data/stubs/3.2/urllib/__init__.pyi diff --git a/stubs/3.2/urllib/error.pyi b/mypy/data/stubs/3.2/urllib/error.pyi similarity index 100% rename from stubs/3.2/urllib/error.pyi rename to mypy/data/stubs/3.2/urllib/error.pyi diff --git a/stubs/3.2/urllib/parse.pyi b/mypy/data/stubs/3.2/urllib/parse.pyi similarity index 100% rename from stubs/3.2/urllib/parse.pyi rename to mypy/data/stubs/3.2/urllib/parse.pyi diff --git a/stubs/3.2/urllib/request.pyi b/mypy/data/stubs/3.2/urllib/request.pyi similarity index 100% rename from stubs/3.2/urllib/request.pyi rename to mypy/data/stubs/3.2/urllib/request.pyi diff --git a/stubs/3.2/uuid.pyi b/mypy/data/stubs/3.2/uuid.pyi similarity index 100% rename from stubs/3.2/uuid.pyi rename to mypy/data/stubs/3.2/uuid.pyi diff --git a/stubs/3.2/warnings.pyi b/mypy/data/stubs/3.2/warnings.pyi similarity index 100% rename from stubs/3.2/warnings.pyi rename to mypy/data/stubs/3.2/warnings.pyi diff --git a/stubs/3.2/weakref.pyi b/mypy/data/stubs/3.2/weakref.pyi similarity index 100% rename from stubs/3.2/weakref.pyi rename to mypy/data/stubs/3.2/weakref.pyi diff --git a/stubs/3.2/webbrowser.pyi b/mypy/data/stubs/3.2/webbrowser.pyi similarity index 100% rename from stubs/3.2/webbrowser.pyi rename to mypy/data/stubs/3.2/webbrowser.pyi diff --git a/stubs/3.2/xml/__init__.pyi b/mypy/data/stubs/3.2/xml/__init__.pyi similarity index 100% rename from stubs/3.2/xml/__init__.pyi rename to mypy/data/stubs/3.2/xml/__init__.pyi diff --git a/stubs/3.2/xml/etree/ElementInclude.pyi b/mypy/data/stubs/3.2/xml/etree/ElementInclude.pyi similarity index 100% rename from stubs/3.2/xml/etree/ElementInclude.pyi rename to mypy/data/stubs/3.2/xml/etree/ElementInclude.pyi diff --git a/stubs/3.2/xml/etree/ElementPath.pyi b/mypy/data/stubs/3.2/xml/etree/ElementPath.pyi similarity index 100% rename from stubs/3.2/xml/etree/ElementPath.pyi rename to mypy/data/stubs/3.2/xml/etree/ElementPath.pyi diff --git a/stubs/3.2/xml/etree/ElementTree.pyi b/mypy/data/stubs/3.2/xml/etree/ElementTree.pyi similarity index 100% rename from stubs/3.2/xml/etree/ElementTree.pyi rename to mypy/data/stubs/3.2/xml/etree/ElementTree.pyi diff --git a/stubs/3.2/xml/etree/__init__.pyi b/mypy/data/stubs/3.2/xml/etree/__init__.pyi similarity index 100% rename from stubs/3.2/xml/etree/__init__.pyi rename to mypy/data/stubs/3.2/xml/etree/__init__.pyi diff --git a/stubs/3.2/xml/etree/cElementTree.pyi b/mypy/data/stubs/3.2/xml/etree/cElementTree.pyi similarity index 100% rename from stubs/3.2/xml/etree/cElementTree.pyi rename to mypy/data/stubs/3.2/xml/etree/cElementTree.pyi diff --git a/stubs/3.2/zipfile.pyi b/mypy/data/stubs/3.2/zipfile.pyi similarity index 100% rename from stubs/3.2/zipfile.pyi rename to mypy/data/stubs/3.2/zipfile.pyi diff --git a/stubs/3.2/zlib.pyi b/mypy/data/stubs/3.2/zlib.pyi similarity index 100% rename from stubs/3.2/zlib.pyi rename to mypy/data/stubs/3.2/zlib.pyi diff --git a/stubs/3.3/do-not-remove b/mypy/data/stubs/3.3/do-not-remove similarity index 100% rename from stubs/3.3/do-not-remove rename to mypy/data/stubs/3.3/do-not-remove diff --git a/stubs/3.3/ipaddress.pyi b/mypy/data/stubs/3.3/ipaddress.pyi similarity index 100% rename from stubs/3.3/ipaddress.pyi rename to mypy/data/stubs/3.3/ipaddress.pyi diff --git a/stubs/3.4/asyncio/__init__.pyi b/mypy/data/stubs/3.4/asyncio/__init__.pyi similarity index 100% rename from stubs/3.4/asyncio/__init__.pyi rename to mypy/data/stubs/3.4/asyncio/__init__.pyi diff --git a/stubs/3.4/asyncio/events.pyi b/mypy/data/stubs/3.4/asyncio/events.pyi similarity index 100% rename from stubs/3.4/asyncio/events.pyi rename to mypy/data/stubs/3.4/asyncio/events.pyi diff --git a/stubs/3.4/asyncio/futures.pyi b/mypy/data/stubs/3.4/asyncio/futures.pyi similarity index 100% rename from stubs/3.4/asyncio/futures.pyi rename to mypy/data/stubs/3.4/asyncio/futures.pyi diff --git a/stubs/3.4/asyncio/queues.pyi b/mypy/data/stubs/3.4/asyncio/queues.pyi similarity index 100% rename from stubs/3.4/asyncio/queues.pyi rename to mypy/data/stubs/3.4/asyncio/queues.pyi diff --git a/stubs/3.4/asyncio/tasks.pyi b/mypy/data/stubs/3.4/asyncio/tasks.pyi similarity index 100% rename from stubs/3.4/asyncio/tasks.pyi rename to mypy/data/stubs/3.4/asyncio/tasks.pyi diff --git a/stubs/3.4/enum.pyi b/mypy/data/stubs/3.4/enum.pyi similarity index 100% rename from stubs/3.4/enum.pyi rename to mypy/data/stubs/3.4/enum.pyi diff --git a/stubs/3.4/pathlib.pyi b/mypy/data/stubs/3.4/pathlib.pyi similarity index 100% rename from stubs/3.4/pathlib.pyi rename to mypy/data/stubs/3.4/pathlib.pyi diff --git a/stubs/third-party-2.7/Crypto/Cipher/AES.pyi b/mypy/data/stubs/third-party-2.7/Crypto/Cipher/AES.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/Cipher/AES.pyi rename to mypy/data/stubs/third-party-2.7/Crypto/Cipher/AES.pyi diff --git a/stubs/third-party-2.7/Crypto/Cipher/__init__.pyi b/mypy/data/stubs/third-party-2.7/Crypto/Cipher/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/Cipher/__init__.pyi rename to mypy/data/stubs/third-party-2.7/Crypto/Cipher/__init__.pyi diff --git a/stubs/third-party-2.7/Crypto/Random/__init__.pyi b/mypy/data/stubs/third-party-2.7/Crypto/Random/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/Random/__init__.pyi rename to mypy/data/stubs/third-party-2.7/Crypto/Random/__init__.pyi diff --git a/stubs/third-party-2.7/Crypto/Random/random.pyi b/mypy/data/stubs/third-party-2.7/Crypto/Random/random.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/Random/random.pyi rename to mypy/data/stubs/third-party-2.7/Crypto/Random/random.pyi diff --git a/stubs/third-party-2.7/Crypto/__init__.pyi b/mypy/data/stubs/third-party-2.7/Crypto/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/Crypto/__init__.pyi rename to mypy/data/stubs/third-party-2.7/Crypto/__init__.pyi diff --git a/stubs/third-party-2.7/OpenSSL/__init__.pyi b/mypy/data/stubs/third-party-2.7/OpenSSL/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/OpenSSL/__init__.pyi rename to mypy/data/stubs/third-party-2.7/OpenSSL/__init__.pyi diff --git a/stubs/third-party-2.7/OpenSSL/crypto.pyi b/mypy/data/stubs/third-party-2.7/OpenSSL/crypto.pyi similarity index 100% rename from stubs/third-party-2.7/OpenSSL/crypto.pyi rename to mypy/data/stubs/third-party-2.7/OpenSSL/crypto.pyi diff --git a/stubs/third-party-2.7/boto/__init__.pyi b/mypy/data/stubs/third-party-2.7/boto/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/boto/__init__.pyi rename to mypy/data/stubs/third-party-2.7/boto/__init__.pyi diff --git a/stubs/third-party-2.7/boto/connection.pyi b/mypy/data/stubs/third-party-2.7/boto/connection.pyi similarity index 100% rename from stubs/third-party-2.7/boto/connection.pyi rename to mypy/data/stubs/third-party-2.7/boto/connection.pyi diff --git a/stubs/third-party-2.7/boto/ec2/__init__.pyi b/mypy/data/stubs/third-party-2.7/boto/ec2/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/boto/ec2/__init__.pyi rename to mypy/data/stubs/third-party-2.7/boto/ec2/__init__.pyi diff --git a/stubs/third-party-2.7/boto/ec2/elb/__init__.pyi b/mypy/data/stubs/third-party-2.7/boto/ec2/elb/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/boto/ec2/elb/__init__.pyi rename to mypy/data/stubs/third-party-2.7/boto/ec2/elb/__init__.pyi diff --git a/stubs/third-party-2.7/concurrent/__init__.pyi b/mypy/data/stubs/third-party-2.7/concurrent/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/concurrent/__init__.pyi rename to mypy/data/stubs/third-party-2.7/concurrent/__init__.pyi diff --git a/stubs/third-party-2.7/concurrent/futures/__init__.pyi b/mypy/data/stubs/third-party-2.7/concurrent/futures/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/concurrent/futures/__init__.pyi rename to mypy/data/stubs/third-party-2.7/concurrent/futures/__init__.pyi diff --git a/stubs/third-party-2.7/croniter.pyi b/mypy/data/stubs/third-party-2.7/croniter.pyi similarity index 100% rename from stubs/third-party-2.7/croniter.pyi rename to mypy/data/stubs/third-party-2.7/croniter.pyi diff --git a/stubs/third-party-2.7/fb303/FacebookService.pyi b/mypy/data/stubs/third-party-2.7/fb303/FacebookService.pyi similarity index 100% rename from stubs/third-party-2.7/fb303/FacebookService.pyi rename to mypy/data/stubs/third-party-2.7/fb303/FacebookService.pyi diff --git a/stubs/third-party-2.7/fb303/__init__.pyi b/mypy/data/stubs/third-party-2.7/fb303/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/fb303/__init__.pyi rename to mypy/data/stubs/third-party-2.7/fb303/__init__.pyi diff --git a/stubs/third-party-2.7/gflags.pyi b/mypy/data/stubs/third-party-2.7/gflags.pyi similarity index 100% rename from stubs/third-party-2.7/gflags.pyi rename to mypy/data/stubs/third-party-2.7/gflags.pyi diff --git a/stubs/third-party-2.7/google/__init__.pyi b/mypy/data/stubs/third-party-2.7/google/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/google/__init__.pyi rename to mypy/data/stubs/third-party-2.7/google/__init__.pyi diff --git a/stubs/third-party-2.7/google/protobuf/__init__.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/__init__.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/__init__.pyi diff --git a/stubs/third-party-2.7/google/protobuf/descriptor.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/descriptor.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/descriptor.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/descriptor.pyi diff --git a/stubs/third-party-2.7/google/protobuf/descriptor_pb2.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/descriptor_pb2.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/descriptor_pb2.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/descriptor_pb2.pyi diff --git a/stubs/third-party-2.7/google/protobuf/internal/__init__.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/internal/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/internal/__init__.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/internal/__init__.pyi diff --git a/stubs/third-party-2.7/google/protobuf/internal/decoder.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/internal/decoder.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/internal/decoder.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/internal/decoder.pyi diff --git a/stubs/third-party-2.7/google/protobuf/internal/encoder.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/internal/encoder.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/internal/encoder.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/internal/encoder.pyi diff --git a/stubs/third-party-2.7/google/protobuf/internal/enum_type_wrapper.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/internal/enum_type_wrapper.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/internal/enum_type_wrapper.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/internal/enum_type_wrapper.pyi diff --git a/stubs/third-party-2.7/google/protobuf/internal/wire_format.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/internal/wire_format.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/internal/wire_format.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/internal/wire_format.pyi diff --git a/stubs/third-party-2.7/google/protobuf/message.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/message.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/message.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/message.pyi diff --git a/stubs/third-party-2.7/google/protobuf/reflection.pyi b/mypy/data/stubs/third-party-2.7/google/protobuf/reflection.pyi similarity index 100% rename from stubs/third-party-2.7/google/protobuf/reflection.pyi rename to mypy/data/stubs/third-party-2.7/google/protobuf/reflection.pyi diff --git a/stubs/third-party-2.7/kazoo/__init__.pyi b/mypy/data/stubs/third-party-2.7/kazoo/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/kazoo/__init__.pyi rename to mypy/data/stubs/third-party-2.7/kazoo/__init__.pyi diff --git a/stubs/third-party-2.7/kazoo/client.pyi b/mypy/data/stubs/third-party-2.7/kazoo/client.pyi similarity index 100% rename from stubs/third-party-2.7/kazoo/client.pyi rename to mypy/data/stubs/third-party-2.7/kazoo/client.pyi diff --git a/stubs/third-party-2.7/kazoo/exceptions.pyi b/mypy/data/stubs/third-party-2.7/kazoo/exceptions.pyi similarity index 100% rename from stubs/third-party-2.7/kazoo/exceptions.pyi rename to mypy/data/stubs/third-party-2.7/kazoo/exceptions.pyi diff --git a/stubs/third-party-2.7/kazoo/recipe/__init__.pyi b/mypy/data/stubs/third-party-2.7/kazoo/recipe/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/kazoo/recipe/__init__.pyi rename to mypy/data/stubs/third-party-2.7/kazoo/recipe/__init__.pyi diff --git a/stubs/third-party-2.7/kazoo/recipe/watchers.pyi b/mypy/data/stubs/third-party-2.7/kazoo/recipe/watchers.pyi similarity index 100% rename from stubs/third-party-2.7/kazoo/recipe/watchers.pyi rename to mypy/data/stubs/third-party-2.7/kazoo/recipe/watchers.pyi diff --git a/stubs/third-party-2.7/pycurl.pyi b/mypy/data/stubs/third-party-2.7/pycurl.pyi similarity index 100% rename from stubs/third-party-2.7/pycurl.pyi rename to mypy/data/stubs/third-party-2.7/pycurl.pyi diff --git a/stubs/third-party-2.7/redis/__init__.pyi b/mypy/data/stubs/third-party-2.7/redis/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/redis/__init__.pyi rename to mypy/data/stubs/third-party-2.7/redis/__init__.pyi diff --git a/stubs/third-party-2.7/redis/client.pyi b/mypy/data/stubs/third-party-2.7/redis/client.pyi similarity index 100% rename from stubs/third-party-2.7/redis/client.pyi rename to mypy/data/stubs/third-party-2.7/redis/client.pyi diff --git a/stubs/third-party-2.7/redis/connection.pyi b/mypy/data/stubs/third-party-2.7/redis/connection.pyi similarity index 100% rename from stubs/third-party-2.7/redis/connection.pyi rename to mypy/data/stubs/third-party-2.7/redis/connection.pyi diff --git a/stubs/third-party-2.7/redis/exceptions.pyi b/mypy/data/stubs/third-party-2.7/redis/exceptions.pyi similarity index 100% rename from stubs/third-party-2.7/redis/exceptions.pyi rename to mypy/data/stubs/third-party-2.7/redis/exceptions.pyi diff --git a/stubs/third-party-2.7/redis/utils.pyi b/mypy/data/stubs/third-party-2.7/redis/utils.pyi similarity index 100% rename from stubs/third-party-2.7/redis/utils.pyi rename to mypy/data/stubs/third-party-2.7/redis/utils.pyi diff --git a/stubs/third-party-2.7/requests/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/__init__.pyi diff --git a/stubs/third-party-2.7/requests/adapters.pyi b/mypy/data/stubs/third-party-2.7/requests/adapters.pyi similarity index 100% rename from stubs/third-party-2.7/requests/adapters.pyi rename to mypy/data/stubs/third-party-2.7/requests/adapters.pyi diff --git a/stubs/third-party-2.7/requests/api.pyi b/mypy/data/stubs/third-party-2.7/requests/api.pyi similarity index 100% rename from stubs/third-party-2.7/requests/api.pyi rename to mypy/data/stubs/third-party-2.7/requests/api.pyi diff --git a/stubs/third-party-2.7/requests/auth.pyi b/mypy/data/stubs/third-party-2.7/requests/auth.pyi similarity index 100% rename from stubs/third-party-2.7/requests/auth.pyi rename to mypy/data/stubs/third-party-2.7/requests/auth.pyi diff --git a/stubs/third-party-2.7/requests/compat.pyi b/mypy/data/stubs/third-party-2.7/requests/compat.pyi similarity index 100% rename from stubs/third-party-2.7/requests/compat.pyi rename to mypy/data/stubs/third-party-2.7/requests/compat.pyi diff --git a/stubs/third-party-2.7/requests/cookies.pyi b/mypy/data/stubs/third-party-2.7/requests/cookies.pyi similarity index 100% rename from stubs/third-party-2.7/requests/cookies.pyi rename to mypy/data/stubs/third-party-2.7/requests/cookies.pyi diff --git a/stubs/third-party-2.7/requests/exceptions.pyi b/mypy/data/stubs/third-party-2.7/requests/exceptions.pyi similarity index 100% rename from stubs/third-party-2.7/requests/exceptions.pyi rename to mypy/data/stubs/third-party-2.7/requests/exceptions.pyi diff --git a/stubs/third-party-2.7/requests/hooks.pyi b/mypy/data/stubs/third-party-2.7/requests/hooks.pyi similarity index 100% rename from stubs/third-party-2.7/requests/hooks.pyi rename to mypy/data/stubs/third-party-2.7/requests/hooks.pyi diff --git a/stubs/third-party-2.7/requests/models.pyi b/mypy/data/stubs/third-party-2.7/requests/models.pyi similarity index 100% rename from stubs/third-party-2.7/requests/models.pyi rename to mypy/data/stubs/third-party-2.7/requests/models.pyi diff --git a/stubs/third-party-2.7/requests/packages/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/__init__.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/__init__.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/_collections.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/_collections.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/_collections.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/_collections.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/connection.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/connection.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/connection.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/connection.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/connectionpool.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/connectionpool.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/connectionpool.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/connectionpool.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/contrib/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/contrib/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/contrib/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/contrib/__init__.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/exceptions.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/exceptions.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/exceptions.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/exceptions.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/fields.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/fields.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/fields.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/fields.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/filepost.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/filepost.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/filepost.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/filepost.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/packages/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/packages/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/packages/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/packages/__init__.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/poolmanager.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/poolmanager.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/poolmanager.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/poolmanager.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/request.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/request.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/request.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/request.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/response.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/response.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/response.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/response.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/__init__.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/__init__.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/__init__.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/connection.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/connection.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/connection.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/connection.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/request.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/request.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/request.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/request.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/response.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/response.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/response.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/response.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/retry.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/retry.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/retry.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/retry.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/timeout.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/timeout.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/timeout.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/timeout.pyi diff --git a/stubs/third-party-2.7/requests/packages/urllib3/util/url.pyi b/mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/url.pyi similarity index 100% rename from stubs/third-party-2.7/requests/packages/urllib3/util/url.pyi rename to mypy/data/stubs/third-party-2.7/requests/packages/urllib3/util/url.pyi diff --git a/stubs/third-party-2.7/requests/sessions.pyi b/mypy/data/stubs/third-party-2.7/requests/sessions.pyi similarity index 100% rename from stubs/third-party-2.7/requests/sessions.pyi rename to mypy/data/stubs/third-party-2.7/requests/sessions.pyi diff --git a/stubs/third-party-2.7/requests/status_codes.pyi b/mypy/data/stubs/third-party-2.7/requests/status_codes.pyi similarity index 100% rename from stubs/third-party-2.7/requests/status_codes.pyi rename to mypy/data/stubs/third-party-2.7/requests/status_codes.pyi diff --git a/stubs/third-party-2.7/requests/structures.pyi b/mypy/data/stubs/third-party-2.7/requests/structures.pyi similarity index 100% rename from stubs/third-party-2.7/requests/structures.pyi rename to mypy/data/stubs/third-party-2.7/requests/structures.pyi diff --git a/stubs/third-party-2.7/requests/utils.pyi b/mypy/data/stubs/third-party-2.7/requests/utils.pyi similarity index 100% rename from stubs/third-party-2.7/requests/utils.pyi rename to mypy/data/stubs/third-party-2.7/requests/utils.pyi diff --git a/stubs/third-party-2.7/routes/__init__.pyi b/mypy/data/stubs/third-party-2.7/routes/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/routes/__init__.pyi rename to mypy/data/stubs/third-party-2.7/routes/__init__.pyi diff --git a/stubs/third-party-2.7/routes/mapper.pyi b/mypy/data/stubs/third-party-2.7/routes/mapper.pyi similarity index 100% rename from stubs/third-party-2.7/routes/mapper.pyi rename to mypy/data/stubs/third-party-2.7/routes/mapper.pyi diff --git a/stubs/third-party-2.7/routes/util.pyi b/mypy/data/stubs/third-party-2.7/routes/util.pyi similarity index 100% rename from stubs/third-party-2.7/routes/util.pyi rename to mypy/data/stubs/third-party-2.7/routes/util.pyi diff --git a/stubs/third-party-2.7/scribe/__init__.pyi b/mypy/data/stubs/third-party-2.7/scribe/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/scribe/__init__.pyi rename to mypy/data/stubs/third-party-2.7/scribe/__init__.pyi diff --git a/stubs/third-party-2.7/scribe/scribe.pyi b/mypy/data/stubs/third-party-2.7/scribe/scribe.pyi similarity index 100% rename from stubs/third-party-2.7/scribe/scribe.pyi rename to mypy/data/stubs/third-party-2.7/scribe/scribe.pyi diff --git a/stubs/third-party-2.7/scribe/ttypes.pyi b/mypy/data/stubs/third-party-2.7/scribe/ttypes.pyi similarity index 100% rename from stubs/third-party-2.7/scribe/ttypes.pyi rename to mypy/data/stubs/third-party-2.7/scribe/ttypes.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/databases/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/databases/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/databases/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/databases/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/databases/mysql.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/databases/mysql.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/databases/mysql.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/databases/mysql.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/dialects/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/dialects/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/dialects/mysql/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/mysql/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/dialects/mysql/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/mysql/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/dialects/mysql/base.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/mysql/base.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/dialects/mysql/base.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/dialects/mysql/base.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/engine/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/engine/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/engine/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/engine/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/engine/strategies.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/engine/strategies.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/engine/strategies.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/engine/strategies.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/engine/url.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/engine/url.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/engine/url.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/engine/url.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/exc.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/exc.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/exc.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/exc.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/inspection.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/inspection.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/inspection.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/inspection.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/orm/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/orm/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/orm/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/orm/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/orm/session.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/orm/session.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/orm/session.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/orm/session.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/pool.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/pool.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/pool.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/pool.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/schema.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/schema.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/schema.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/schema.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/sql/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/sql/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/sql/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/sql/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/sql/expression.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/sql/expression.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/sql/expression.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/sql/expression.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/sql/visitors.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/sql/visitors.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/sql/visitors.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/sql/visitors.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/types.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/types.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/types.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/types.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/util/__init__.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/util/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/util/__init__.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/util/__init__.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/util/_collections.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/util/_collections.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/util/_collections.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/util/_collections.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/util/compat.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/util/compat.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/util/compat.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/util/compat.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/util/deprecations.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/util/deprecations.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/util/deprecations.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/util/deprecations.pyi diff --git a/stubs/third-party-2.7/sqlalchemy/util/langhelpers.pyi b/mypy/data/stubs/third-party-2.7/sqlalchemy/util/langhelpers.pyi similarity index 100% rename from stubs/third-party-2.7/sqlalchemy/util/langhelpers.pyi rename to mypy/data/stubs/third-party-2.7/sqlalchemy/util/langhelpers.pyi diff --git a/stubs/third-party-2.7/thrift/Thrift.pyi b/mypy/data/stubs/third-party-2.7/thrift/Thrift.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/Thrift.pyi rename to mypy/data/stubs/third-party-2.7/thrift/Thrift.pyi diff --git a/stubs/third-party-2.7/thrift/__init__.pyi b/mypy/data/stubs/third-party-2.7/thrift/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/__init__.pyi rename to mypy/data/stubs/third-party-2.7/thrift/__init__.pyi diff --git a/stubs/third-party-2.7/thrift/protocol/TBinaryProtocol.pyi b/mypy/data/stubs/third-party-2.7/thrift/protocol/TBinaryProtocol.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/protocol/TBinaryProtocol.pyi rename to mypy/data/stubs/third-party-2.7/thrift/protocol/TBinaryProtocol.pyi diff --git a/stubs/third-party-2.7/thrift/protocol/TProtocol.pyi b/mypy/data/stubs/third-party-2.7/thrift/protocol/TProtocol.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/protocol/TProtocol.pyi rename to mypy/data/stubs/third-party-2.7/thrift/protocol/TProtocol.pyi diff --git a/stubs/third-party-2.7/thrift/protocol/__init__.pyi b/mypy/data/stubs/third-party-2.7/thrift/protocol/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/protocol/__init__.pyi rename to mypy/data/stubs/third-party-2.7/thrift/protocol/__init__.pyi diff --git a/stubs/third-party-2.7/thrift/transport/TSocket.pyi b/mypy/data/stubs/third-party-2.7/thrift/transport/TSocket.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/transport/TSocket.pyi rename to mypy/data/stubs/third-party-2.7/thrift/transport/TSocket.pyi diff --git a/stubs/third-party-2.7/thrift/transport/TTransport.pyi b/mypy/data/stubs/third-party-2.7/thrift/transport/TTransport.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/transport/TTransport.pyi rename to mypy/data/stubs/third-party-2.7/thrift/transport/TTransport.pyi diff --git a/stubs/third-party-2.7/thrift/transport/__init__.pyi b/mypy/data/stubs/third-party-2.7/thrift/transport/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/thrift/transport/__init__.pyi rename to mypy/data/stubs/third-party-2.7/thrift/transport/__init__.pyi diff --git a/stubs/third-party-2.7/tornado/__init__.pyi b/mypy/data/stubs/third-party-2.7/tornado/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/__init__.pyi rename to mypy/data/stubs/third-party-2.7/tornado/__init__.pyi diff --git a/stubs/third-party-2.7/tornado/concurrent.pyi b/mypy/data/stubs/third-party-2.7/tornado/concurrent.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/concurrent.pyi rename to mypy/data/stubs/third-party-2.7/tornado/concurrent.pyi diff --git a/stubs/third-party-2.7/tornado/gen.pyi b/mypy/data/stubs/third-party-2.7/tornado/gen.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/gen.pyi rename to mypy/data/stubs/third-party-2.7/tornado/gen.pyi diff --git a/stubs/third-party-2.7/tornado/httpclient.pyi b/mypy/data/stubs/third-party-2.7/tornado/httpclient.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/httpclient.pyi rename to mypy/data/stubs/third-party-2.7/tornado/httpclient.pyi diff --git a/stubs/third-party-2.7/tornado/httpserver.pyi b/mypy/data/stubs/third-party-2.7/tornado/httpserver.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/httpserver.pyi rename to mypy/data/stubs/third-party-2.7/tornado/httpserver.pyi diff --git a/stubs/third-party-2.7/tornado/httputil.pyi b/mypy/data/stubs/third-party-2.7/tornado/httputil.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/httputil.pyi rename to mypy/data/stubs/third-party-2.7/tornado/httputil.pyi diff --git a/stubs/third-party-2.7/tornado/ioloop.pyi b/mypy/data/stubs/third-party-2.7/tornado/ioloop.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/ioloop.pyi rename to mypy/data/stubs/third-party-2.7/tornado/ioloop.pyi diff --git a/stubs/third-party-2.7/tornado/netutil.pyi b/mypy/data/stubs/third-party-2.7/tornado/netutil.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/netutil.pyi rename to mypy/data/stubs/third-party-2.7/tornado/netutil.pyi diff --git a/stubs/third-party-2.7/tornado/tcpserver.pyi b/mypy/data/stubs/third-party-2.7/tornado/tcpserver.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/tcpserver.pyi rename to mypy/data/stubs/third-party-2.7/tornado/tcpserver.pyi diff --git a/stubs/third-party-2.7/tornado/util.pyi b/mypy/data/stubs/third-party-2.7/tornado/util.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/util.pyi rename to mypy/data/stubs/third-party-2.7/tornado/util.pyi diff --git a/stubs/third-party-2.7/tornado/web.pyi b/mypy/data/stubs/third-party-2.7/tornado/web.pyi similarity index 100% rename from stubs/third-party-2.7/tornado/web.pyi rename to mypy/data/stubs/third-party-2.7/tornado/web.pyi diff --git a/stubs/third-party-2.7/yaml/__init__.pyi b/mypy/data/stubs/third-party-2.7/yaml/__init__.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/__init__.pyi rename to mypy/data/stubs/third-party-2.7/yaml/__init__.pyi diff --git a/stubs/third-party-2.7/yaml/composer.pyi b/mypy/data/stubs/third-party-2.7/yaml/composer.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/composer.pyi rename to mypy/data/stubs/third-party-2.7/yaml/composer.pyi diff --git a/stubs/third-party-2.7/yaml/constructor.pyi b/mypy/data/stubs/third-party-2.7/yaml/constructor.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/constructor.pyi rename to mypy/data/stubs/third-party-2.7/yaml/constructor.pyi diff --git a/stubs/third-party-2.7/yaml/dumper.pyi b/mypy/data/stubs/third-party-2.7/yaml/dumper.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/dumper.pyi rename to mypy/data/stubs/third-party-2.7/yaml/dumper.pyi diff --git a/stubs/third-party-2.7/yaml/emitter.pyi b/mypy/data/stubs/third-party-2.7/yaml/emitter.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/emitter.pyi rename to mypy/data/stubs/third-party-2.7/yaml/emitter.pyi diff --git a/stubs/third-party-2.7/yaml/error.pyi b/mypy/data/stubs/third-party-2.7/yaml/error.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/error.pyi rename to mypy/data/stubs/third-party-2.7/yaml/error.pyi diff --git a/stubs/third-party-2.7/yaml/events.pyi b/mypy/data/stubs/third-party-2.7/yaml/events.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/events.pyi rename to mypy/data/stubs/third-party-2.7/yaml/events.pyi diff --git a/stubs/third-party-2.7/yaml/loader.pyi b/mypy/data/stubs/third-party-2.7/yaml/loader.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/loader.pyi rename to mypy/data/stubs/third-party-2.7/yaml/loader.pyi diff --git a/stubs/third-party-2.7/yaml/nodes.pyi b/mypy/data/stubs/third-party-2.7/yaml/nodes.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/nodes.pyi rename to mypy/data/stubs/third-party-2.7/yaml/nodes.pyi diff --git a/stubs/third-party-2.7/yaml/parser.pyi b/mypy/data/stubs/third-party-2.7/yaml/parser.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/parser.pyi rename to mypy/data/stubs/third-party-2.7/yaml/parser.pyi diff --git a/stubs/third-party-2.7/yaml/reader.pyi b/mypy/data/stubs/third-party-2.7/yaml/reader.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/reader.pyi rename to mypy/data/stubs/third-party-2.7/yaml/reader.pyi diff --git a/stubs/third-party-2.7/yaml/representer.pyi b/mypy/data/stubs/third-party-2.7/yaml/representer.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/representer.pyi rename to mypy/data/stubs/third-party-2.7/yaml/representer.pyi diff --git a/stubs/third-party-2.7/yaml/resolver.pyi b/mypy/data/stubs/third-party-2.7/yaml/resolver.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/resolver.pyi rename to mypy/data/stubs/third-party-2.7/yaml/resolver.pyi diff --git a/stubs/third-party-2.7/yaml/scanner.pyi b/mypy/data/stubs/third-party-2.7/yaml/scanner.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/scanner.pyi rename to mypy/data/stubs/third-party-2.7/yaml/scanner.pyi diff --git a/stubs/third-party-2.7/yaml/serializer.pyi b/mypy/data/stubs/third-party-2.7/yaml/serializer.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/serializer.pyi rename to mypy/data/stubs/third-party-2.7/yaml/serializer.pyi diff --git a/stubs/third-party-2.7/yaml/tokens.pyi b/mypy/data/stubs/third-party-2.7/yaml/tokens.pyi similarity index 100% rename from stubs/third-party-2.7/yaml/tokens.pyi rename to mypy/data/stubs/third-party-2.7/yaml/tokens.pyi diff --git a/stubs/third-party-3.2/docutils/__init__.pyi b/mypy/data/stubs/third-party-3.2/docutils/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/__init__.pyi rename to mypy/data/stubs/third-party-3.2/docutils/__init__.pyi diff --git a/stubs/third-party-3.2/docutils/examples.pyi b/mypy/data/stubs/third-party-3.2/docutils/examples.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/examples.pyi rename to mypy/data/stubs/third-party-3.2/docutils/examples.pyi diff --git a/stubs/third-party-3.2/docutils/nodes.pyi b/mypy/data/stubs/third-party-3.2/docutils/nodes.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/nodes.pyi rename to mypy/data/stubs/third-party-3.2/docutils/nodes.pyi diff --git a/stubs/third-party-3.2/docutils/parsers/__init__.pyi b/mypy/data/stubs/third-party-3.2/docutils/parsers/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/parsers/__init__.pyi rename to mypy/data/stubs/third-party-3.2/docutils/parsers/__init__.pyi diff --git a/stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi b/mypy/data/stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi rename to mypy/data/stubs/third-party-3.2/docutils/parsers/rst/__init__.pyi diff --git a/stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi b/mypy/data/stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi rename to mypy/data/stubs/third-party-3.2/docutils/parsers/rst/nodes.pyi diff --git a/stubs/third-party-3.2/docutils/parsers/rst/roles.pyi b/mypy/data/stubs/third-party-3.2/docutils/parsers/rst/roles.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/parsers/rst/roles.pyi rename to mypy/data/stubs/third-party-3.2/docutils/parsers/rst/roles.pyi diff --git a/stubs/third-party-3.2/docutils/parsers/rst/states.pyi b/mypy/data/stubs/third-party-3.2/docutils/parsers/rst/states.pyi similarity index 100% rename from stubs/third-party-3.2/docutils/parsers/rst/states.pyi rename to mypy/data/stubs/third-party-3.2/docutils/parsers/rst/states.pyi diff --git a/stubs/third-party-3.2/lxml/__init__.pyi b/mypy/data/stubs/third-party-3.2/lxml/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/lxml/__init__.pyi rename to mypy/data/stubs/third-party-3.2/lxml/__init__.pyi diff --git a/stubs/third-party-3.2/lxml/etree.pyi b/mypy/data/stubs/third-party-3.2/lxml/etree.pyi similarity index 100% rename from stubs/third-party-3.2/lxml/etree.pyi rename to mypy/data/stubs/third-party-3.2/lxml/etree.pyi diff --git a/stubs/third-party-3.2/requests/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/__init__.pyi diff --git a/stubs/third-party-3.2/requests/adapters.pyi b/mypy/data/stubs/third-party-3.2/requests/adapters.pyi similarity index 100% rename from stubs/third-party-3.2/requests/adapters.pyi rename to mypy/data/stubs/third-party-3.2/requests/adapters.pyi diff --git a/stubs/third-party-3.2/requests/api.pyi b/mypy/data/stubs/third-party-3.2/requests/api.pyi similarity index 100% rename from stubs/third-party-3.2/requests/api.pyi rename to mypy/data/stubs/third-party-3.2/requests/api.pyi diff --git a/stubs/third-party-3.2/requests/auth.pyi b/mypy/data/stubs/third-party-3.2/requests/auth.pyi similarity index 100% rename from stubs/third-party-3.2/requests/auth.pyi rename to mypy/data/stubs/third-party-3.2/requests/auth.pyi diff --git a/stubs/third-party-3.2/requests/compat.pyi b/mypy/data/stubs/third-party-3.2/requests/compat.pyi similarity index 100% rename from stubs/third-party-3.2/requests/compat.pyi rename to mypy/data/stubs/third-party-3.2/requests/compat.pyi diff --git a/stubs/third-party-3.2/requests/cookies.pyi b/mypy/data/stubs/third-party-3.2/requests/cookies.pyi similarity index 100% rename from stubs/third-party-3.2/requests/cookies.pyi rename to mypy/data/stubs/third-party-3.2/requests/cookies.pyi diff --git a/stubs/third-party-3.2/requests/exceptions.pyi b/mypy/data/stubs/third-party-3.2/requests/exceptions.pyi similarity index 100% rename from stubs/third-party-3.2/requests/exceptions.pyi rename to mypy/data/stubs/third-party-3.2/requests/exceptions.pyi diff --git a/stubs/third-party-3.2/requests/hooks.pyi b/mypy/data/stubs/third-party-3.2/requests/hooks.pyi similarity index 100% rename from stubs/third-party-3.2/requests/hooks.pyi rename to mypy/data/stubs/third-party-3.2/requests/hooks.pyi diff --git a/stubs/third-party-3.2/requests/models.pyi b/mypy/data/stubs/third-party-3.2/requests/models.pyi similarity index 100% rename from stubs/third-party-3.2/requests/models.pyi rename to mypy/data/stubs/third-party-3.2/requests/models.pyi diff --git a/stubs/third-party-3.2/requests/packages/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/_collections.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/_collections.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/_collections.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/_collections.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/connection.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/connection.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/connection.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/connection.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/connectionpool.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/connectionpool.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/connectionpool.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/connectionpool.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/contrib/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/contrib/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/contrib/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/contrib/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/exceptions.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/exceptions.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/exceptions.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/exceptions.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/fields.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/fields.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/fields.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/fields.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/filepost.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/filepost.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/filepost.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/filepost.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/packages/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/packages/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/poolmanager.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/poolmanager.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/poolmanager.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/poolmanager.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/request.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/request.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/request.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/request.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/response.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/response.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/response.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/response.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/__init__.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/__init__.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/__init__.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/__init__.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/connection.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/connection.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/connection.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/connection.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/request.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/request.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/request.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/request.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/response.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/response.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/response.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/response.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/retry.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/retry.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/retry.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/retry.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/ssl_.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/ssl_.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/ssl_.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/ssl_.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/timeout.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/timeout.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/timeout.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/timeout.pyi diff --git a/stubs/third-party-3.2/requests/packages/urllib3/util/url.pyi b/mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/url.pyi similarity index 100% rename from stubs/third-party-3.2/requests/packages/urllib3/util/url.pyi rename to mypy/data/stubs/third-party-3.2/requests/packages/urllib3/util/url.pyi diff --git a/stubs/third-party-3.2/requests/sessions.pyi b/mypy/data/stubs/third-party-3.2/requests/sessions.pyi similarity index 100% rename from stubs/third-party-3.2/requests/sessions.pyi rename to mypy/data/stubs/third-party-3.2/requests/sessions.pyi diff --git a/stubs/third-party-3.2/requests/status_codes.pyi b/mypy/data/stubs/third-party-3.2/requests/status_codes.pyi similarity index 100% rename from stubs/third-party-3.2/requests/status_codes.pyi rename to mypy/data/stubs/third-party-3.2/requests/status_codes.pyi diff --git a/stubs/third-party-3.2/requests/structures.pyi b/mypy/data/stubs/third-party-3.2/requests/structures.pyi similarity index 100% rename from stubs/third-party-3.2/requests/structures.pyi rename to mypy/data/stubs/third-party-3.2/requests/structures.pyi diff --git a/stubs/third-party-3.2/requests/utils.pyi b/mypy/data/stubs/third-party-3.2/requests/utils.pyi similarity index 100% rename from stubs/third-party-3.2/requests/utils.pyi rename to mypy/data/stubs/third-party-3.2/requests/utils.pyi diff --git a/xml/mypy-html.css b/mypy/data/xml/mypy-html.css similarity index 100% rename from xml/mypy-html.css rename to mypy/data/xml/mypy-html.css diff --git a/xml/mypy-html.xslt b/mypy/data/xml/mypy-html.xslt similarity index 100% rename from xml/mypy-html.xslt rename to mypy/data/xml/mypy-html.xslt diff --git a/xml/mypy-txt.xslt b/mypy/data/xml/mypy-txt.xslt similarity index 100% rename from xml/mypy-txt.xslt rename to mypy/data/xml/mypy-txt.xslt diff --git a/xml/mypy.xsd b/mypy/data/xml/mypy.xsd similarity index 100% rename from xml/mypy.xsd rename to mypy/data/xml/mypy.xsd diff --git a/setup.py b/setup.py index ce36c510e8015..ed9ceae97bada 100644 --- a/setup.py +++ b/setup.py @@ -27,33 +27,6 @@ '''.lstrip() -def find_data_files(base, globs): - """Find all interesting data files, for setup(data_files=) - - Arguments: - root: The directory to search in. - globs: A list of glob patterns to accept files. - """ - - rv_dirs = [root for root, dirs, files in os.walk(base)] - rv = [] - for rv_dir in rv_dirs: - files = [] - for pat in globs: - files += glob.glob(os.path.join(rv_dir, pat)) - if not files: - continue - target = os.path.join('lib', 'mypy', rv_dir) - rv.append((target, files)) - - return rv - -data_files = [] - -data_files += find_data_files('stubs', ['*.py', '*.pyi']) - -data_files += find_data_files('xml', ['*.xsd', '*.xslt', '*.css']) - classifiers = [ 'Development Status :: 2 - Pre-Alpha', 'Environment :: Console', @@ -67,9 +40,15 @@ def find_data_files(base, globs): ] packages = find_packages(exclude=['pinfer']) -print(packages) package_data = { + 'mypy': [ + 'data/**/*.py', + 'data/**/*.pyi', + 'xml/*.xsd', + 'xml/*.xslt', + 'xml/*.css', + ], 'mypy.test': [ 'data/*.test', 'data/fixtures/*.py', @@ -90,7 +69,6 @@ def find_data_files(base, globs): py_modules=['typing'], packages=packages, scripts=['scripts/mypy', 'scripts/myunit'], - data_files=data_files, package_data=package_data, classifiers=classifiers, ) diff --git a/tox.ini b/tox.ini index 51ab4c1199c7e..4e1f8c32e09e0 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,7 @@ [tox] envlist = py32,py33,py34,py35,pypy3 [testenv] +deps = -rtest-requirements.txt commands = ./runtests.py -v [flake8] From fdeeffcbe84d63940d06953eeb6f1bfaa3fde15b Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 00:52:29 -0700 Subject: [PATCH 15/25] Make sure tox runs the same commands as travis --- .gitignore | 13 ++++++++----- tox.ini | 7 ++++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 0fd8769526819..f8cc81bf3bf98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,19 @@ -build/ -__pycache__ +# Backup and compiled files +__pycache__/ *.pyc *~ + +# Unclassified @* /env docs/build/ *.iml /out/ -/build -/dist - +# Used by setup.py and tox +/build/ +/dist/ +/elsewhere/ /.tox/ /MANIFEST /lib-typing/3.2/mypy_lang.egg-info/ diff --git a/tox.ini b/tox.ini index 4e1f8c32e09e0..5c62770c34851 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,12 @@ envlist = py32,py33,py34,py35,pypy3 [testenv] deps = -rtest-requirements.txt -commands = ./runtests.py -v +whitelist_externals = mkdir + ln + sh +commands = mkdir -p elsewhere/tmp-test-dirs + ln -sf ../runtests.py elsewhere/ + sh -c 'cd elsewhere && python runtests.py -v' [flake8] max-line-length = 99 From 58d5e5732c95747ce2b4340055966fee4db39cbf Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 01:09:31 -0700 Subject: [PATCH 16/25] Whoops, looks like recursive globbing is not supported --- setup.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index ed9ceae97bada..e0ccf04b3166d 100644 --- a/setup.py +++ b/setup.py @@ -41,10 +41,24 @@ packages = find_packages(exclude=['pinfer']) + +def find_data_dirs(base, globs, cut): + """Find all interesting data files, for setup(data_files=) + + Arguments: + root: The directory to search in. + globs: A list of glob patterns to accept files. + """ + + rv_dirs = [os.path.relpath(root, cut) for root, dirs, files in os.walk(base)] + rv = [] + for rv_dir in rv_dirs: + for pat in globs: + rv.append(os.path.join(rv_dir, pat)) + return rv + package_data = { - 'mypy': [ - 'data/**/*.py', - 'data/**/*.pyi', + 'mypy': find_data_dirs('mypy/data', ['*.pyi'], 'mypy') + [ 'xml/*.xsd', 'xml/*.xslt', 'xml/*.css', From 90d3b894e13c61db337b9b0a929cdf11b48291c7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 01:15:36 -0700 Subject: [PATCH 17/25] Run tox from travis directly for more uniformity --- .travis.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8ec76a98aceb..ff22167074018 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,27 +1,27 @@ sudo: false language: python -python: - - "3.2" - - "3.3" - - "3.4" - - "3.5" - # Pypy build is disaabled because it doubles the travis build time, and it rarely fails - # unless one one of the other builds fails. - # - "pypy3" install: - - pip install -r test-requirements.txt + - pip install tox script: - - python setup.py install - - mkdir elsewhere - - cd elsewhere - - mkdir tmp-test-dirs - - ln -s ../runtests.py - - python runtests.py -v + - tox -e $py notifications: irc: channels: - "chat.freenode.net##mypy" use_notice: true + +matrix: + include: + - python: "3.2" + env: py=py32 + - python: "3.3" + env: py=py33 + - python: "3.4" + env: py=py34 + - python: "3.5" + env: py=py35 + - python: "pypy3" + env: py=pypy3 From e554bae489f7a65249e1f92981d4adc8a1c4f8bc Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 01:29:56 -0700 Subject: [PATCH 18/25] Check stubs again after moving --- runtests.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/runtests.py b/runtests.py index 89a08e4c7f03a..20424c6c0b96c 100755 --- a/runtests.py +++ b/runtests.py @@ -251,7 +251,7 @@ def add_stubs(driver: Driver) -> None: seen = set() # type: Set[str] for version in driver.versions: for pfx in ['', 'third-party-']: - stubdir = join('stubs', pfx + version) + stubdir = join('mypy/data/stubs', pfx + version) for f in find_files(stubdir, suffix='.pyi'): module = file_to_module(f, stubdir) if module not in seen: @@ -284,7 +284,8 @@ def add_samples(driver: Driver) -> None: 'import mypy.codec.register, %s' % bf, cwd=cwd) else: - driver.add_mypy('file %s' % f, f) + f = relpath(f, SOURCE_DIR) + driver.add_mypy('file %s' % f, f, cwd=SOURCE_DIR) def usage(status: int) -> None: @@ -366,12 +367,18 @@ def main() -> None: driver.prepend_path('PYTHONPATH', [driver.cwd]) driver.prepend_path('PYTHONPATH', [join(driver.cwd, 'lib-typing', v) for v in driver.versions]) - add_basic(driver) - add_myunit(driver) - add_imports(driver) - add_stubs(driver) - add_libpython(driver) - add_samples(driver) + for adder in [ + add_basic, + add_myunit, + add_imports, + add_stubs, + add_libpython, + add_samples, + ]: + before = len(driver.waiter.queue) + adder(driver) + if whitelist == ['']: + assert len(driver.waiter.queue) != before, 'no tasks in %s' % adder.__name__ if not list_only: driver.waiter.run() From 3ff356a2023646dece39c1bc4cfa06d0bdcfcb3c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 01:51:25 -0700 Subject: [PATCH 19/25] Fix type issue in dialect --- mypy/syntax/dialect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/syntax/dialect.py b/mypy/syntax/dialect.py index 0fd828effe27a..81760bfae5448 100644 --- a/mypy/syntax/dialect.py +++ b/mypy/syntax/dialect.py @@ -82,7 +82,7 @@ def __repr__(self) -> str: def add_future(self, future: str) -> 'Dialect': if future in self.base_future_set: return self - return Dialect(self.base_version, self.base_future_list + [future]) + return Dialect(self.base_version, list(self.base_future_list) + [future]) class Implementation: From c8ef77c9f64b8c3ae08942c5aa901abd48e4c1cb Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 09:33:43 -0700 Subject: [PATCH 20/25] Use TOXENV instead of -e and pass posargs --- .travis.yml | 12 ++++++------ tox.ini | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff22167074018..4c5e305886db4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ install: - pip install tox script: - - tox -e $py + - tox notifications: irc: @@ -16,12 +16,12 @@ notifications: matrix: include: - python: "3.2" - env: py=py32 + env: TOXENV=py32 - python: "3.3" - env: py=py33 + env: TOXENV=py33 - python: "3.4" - env: py=py34 + env: TOXENV=py34 - python: "3.5" - env: py=py35 + env: TOXENV=py35 - python: "pypy3" - env: py=pypy3 + env: TOXENV=pypy3 diff --git a/tox.ini b/tox.ini index 5c62770c34851..3a784de32313a 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ whitelist_externals = mkdir sh commands = mkdir -p elsewhere/tmp-test-dirs ln -sf ../runtests.py elsewhere/ - sh -c 'cd elsewhere && python runtests.py -v' + sh -c 'cd elsewhere && python runtests.py {posargs} -v' [flake8] max-line-length = 99 From ea5e88812fee57efb7713fe3a6e7c99c15fa9891 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 04:25:29 -0700 Subject: [PATCH 21/25] Fix assertion with blacklist --- runtests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtests.py b/runtests.py index 20424c6c0b96c..2f285ee686d0b 100755 --- a/runtests.py +++ b/runtests.py @@ -377,7 +377,7 @@ def main() -> None: ]: before = len(driver.waiter.queue) adder(driver) - if whitelist == ['']: + if whitelist == [''] and blacklist == []: assert len(driver.waiter.queue) != before, 'no tasks in %s' % adder.__name__ if not list_only: From 802a535ff991ec8e44d6b7841bc9ffc0c9a77501 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 02:09:03 -0700 Subject: [PATCH 22/25] Rename fixture stubs so they don't get byte-compiled --- mypy/stats.py | 2 +- mypy/test/data.py | 4 +++- mypy/test/data/fixtures/{alias.py => alias.pyi} | 0 .../data/fixtures/{bool-simple.py => bool-simple.pyi} | 0 mypy/test/data/fixtures/{bool.py => bool.pyi} | 0 .../data/fixtures/{classmethod.py => classmethod.pyi} | 0 mypy/test/data/fixtures/{complex.py => complex.pyi} | 0 mypy/test/data/fixtures/{dict.py => dict.pyi} | 0 mypy/test/data/fixtures/{exception.py => exception.pyi} | 0 mypy/test/data/fixtures/{for.py => for.pyi} | 0 mypy/test/data/fixtures/{function.py => function.pyi} | 0 mypy/test/data/fixtures/{isinstance.py => isinstance.pyi} | 0 .../fixtures/{isinstancelist.py => isinstancelist.pyi} | 0 mypy/test/data/fixtures/{list.py => list.pyi} | 0 mypy/test/data/fixtures/{module.py => module.pyi} | 0 mypy/test/data/fixtures/{ops.py => ops.pyi} | 0 mypy/test/data/fixtures/{primitives.py => primitives.pyi} | 0 mypy/test/data/fixtures/{property.py => property.pyi} | 0 mypy/test/data/fixtures/{python2.py => python2.pyi} | 0 mypy/test/data/fixtures/{set.py => set.pyi} | 0 mypy/test/data/fixtures/{slice.py => slice.pyi} | 0 .../data/fixtures/{staticmethod.py => staticmethod.pyi} | 0 mypy/test/data/fixtures/{transform.py => transform.pyi} | 0 .../data/fixtures/{tuple-simple.py => tuple-simple.pyi} | 0 mypy/test/data/fixtures/{tuple.py => tuple.pyi} | 0 mypy/test/data/fixtures/{union.py => union.pyi} | 0 mypy/test/data/lib-stub/{abc.py => abc.pyi} | 0 mypy/test/data/lib-stub/{builtins.py => builtins.pyi} | 0 .../data/lib-stub/{collections.py => collections.pyi} | 0 mypy/test/data/lib-stub/{typing.py => typing.pyi} | 0 mypy/test/testsemanal.py | 8 ++++---- mypy/test/testtransform.py | 6 +++--- setup.py | 4 ++-- 33 files changed, 13 insertions(+), 11 deletions(-) rename mypy/test/data/fixtures/{alias.py => alias.pyi} (100%) rename mypy/test/data/fixtures/{bool-simple.py => bool-simple.pyi} (100%) rename mypy/test/data/fixtures/{bool.py => bool.pyi} (100%) rename mypy/test/data/fixtures/{classmethod.py => classmethod.pyi} (100%) rename mypy/test/data/fixtures/{complex.py => complex.pyi} (100%) rename mypy/test/data/fixtures/{dict.py => dict.pyi} (100%) rename mypy/test/data/fixtures/{exception.py => exception.pyi} (100%) rename mypy/test/data/fixtures/{for.py => for.pyi} (100%) rename mypy/test/data/fixtures/{function.py => function.pyi} (100%) rename mypy/test/data/fixtures/{isinstance.py => isinstance.pyi} (100%) rename mypy/test/data/fixtures/{isinstancelist.py => isinstancelist.pyi} (100%) rename mypy/test/data/fixtures/{list.py => list.pyi} (100%) rename mypy/test/data/fixtures/{module.py => module.pyi} (100%) rename mypy/test/data/fixtures/{ops.py => ops.pyi} (100%) rename mypy/test/data/fixtures/{primitives.py => primitives.pyi} (100%) rename mypy/test/data/fixtures/{property.py => property.pyi} (100%) rename mypy/test/data/fixtures/{python2.py => python2.pyi} (100%) rename mypy/test/data/fixtures/{set.py => set.pyi} (100%) rename mypy/test/data/fixtures/{slice.py => slice.pyi} (100%) rename mypy/test/data/fixtures/{staticmethod.py => staticmethod.pyi} (100%) rename mypy/test/data/fixtures/{transform.py => transform.pyi} (100%) rename mypy/test/data/fixtures/{tuple-simple.py => tuple-simple.pyi} (100%) rename mypy/test/data/fixtures/{tuple.py => tuple.pyi} (100%) rename mypy/test/data/fixtures/{union.py => union.pyi} (100%) rename mypy/test/data/lib-stub/{abc.py => abc.pyi} (100%) rename mypy/test/data/lib-stub/{builtins.py => builtins.pyi} (100%) rename mypy/test/data/lib-stub/{collections.py => collections.pyi} (100%) rename mypy/test/data/lib-stub/{typing.py => typing.pyi} (100%) diff --git a/mypy/stats.py b/mypy/stats.py index 1a493d842914d..ada96f7ad1e58 100644 --- a/mypy/stats.py +++ b/mypy/stats.py @@ -223,7 +223,7 @@ def dump_type_stats(tree: Node, path: str, inferred: bool = False, def is_special_module(path: str) -> bool: - return os.path.basename(path) in ('abc.py', 'typing.py', 'builtins.py') + return os.path.basename(path) in ('abc.pyi', 'typing.pyi', 'builtins.pyi') def is_imprecise(t: Type) -> bool: diff --git a/mypy/test/data.py b/mypy/test/data.py index 73e6b9db35bfb..31351afb720cb 100644 --- a/mypy/test/data.py +++ b/mypy/test/data.py @@ -47,9 +47,11 @@ def parse_test_cases( '\n'.join(p[i].data))) elif p[i].id == 'builtins': # Use a custom source file for the std module. + if p[i].arg.endswith('.py'): + p[i].arg += 'i' mpath = os.path.join(os.path.dirname(path), p[i].arg) f = open(mpath) - files.append((os.path.join(base_path, 'builtins.py'), + files.append((os.path.join(base_path, 'builtins.pyi'), f.read())) f.close() else: diff --git a/mypy/test/data/fixtures/alias.py b/mypy/test/data/fixtures/alias.pyi similarity index 100% rename from mypy/test/data/fixtures/alias.py rename to mypy/test/data/fixtures/alias.pyi diff --git a/mypy/test/data/fixtures/bool-simple.py b/mypy/test/data/fixtures/bool-simple.pyi similarity index 100% rename from mypy/test/data/fixtures/bool-simple.py rename to mypy/test/data/fixtures/bool-simple.pyi diff --git a/mypy/test/data/fixtures/bool.py b/mypy/test/data/fixtures/bool.pyi similarity index 100% rename from mypy/test/data/fixtures/bool.py rename to mypy/test/data/fixtures/bool.pyi diff --git a/mypy/test/data/fixtures/classmethod.py b/mypy/test/data/fixtures/classmethod.pyi similarity index 100% rename from mypy/test/data/fixtures/classmethod.py rename to mypy/test/data/fixtures/classmethod.pyi diff --git a/mypy/test/data/fixtures/complex.py b/mypy/test/data/fixtures/complex.pyi similarity index 100% rename from mypy/test/data/fixtures/complex.py rename to mypy/test/data/fixtures/complex.pyi diff --git a/mypy/test/data/fixtures/dict.py b/mypy/test/data/fixtures/dict.pyi similarity index 100% rename from mypy/test/data/fixtures/dict.py rename to mypy/test/data/fixtures/dict.pyi diff --git a/mypy/test/data/fixtures/exception.py b/mypy/test/data/fixtures/exception.pyi similarity index 100% rename from mypy/test/data/fixtures/exception.py rename to mypy/test/data/fixtures/exception.pyi diff --git a/mypy/test/data/fixtures/for.py b/mypy/test/data/fixtures/for.pyi similarity index 100% rename from mypy/test/data/fixtures/for.py rename to mypy/test/data/fixtures/for.pyi diff --git a/mypy/test/data/fixtures/function.py b/mypy/test/data/fixtures/function.pyi similarity index 100% rename from mypy/test/data/fixtures/function.py rename to mypy/test/data/fixtures/function.pyi diff --git a/mypy/test/data/fixtures/isinstance.py b/mypy/test/data/fixtures/isinstance.pyi similarity index 100% rename from mypy/test/data/fixtures/isinstance.py rename to mypy/test/data/fixtures/isinstance.pyi diff --git a/mypy/test/data/fixtures/isinstancelist.py b/mypy/test/data/fixtures/isinstancelist.pyi similarity index 100% rename from mypy/test/data/fixtures/isinstancelist.py rename to mypy/test/data/fixtures/isinstancelist.pyi diff --git a/mypy/test/data/fixtures/list.py b/mypy/test/data/fixtures/list.pyi similarity index 100% rename from mypy/test/data/fixtures/list.py rename to mypy/test/data/fixtures/list.pyi diff --git a/mypy/test/data/fixtures/module.py b/mypy/test/data/fixtures/module.pyi similarity index 100% rename from mypy/test/data/fixtures/module.py rename to mypy/test/data/fixtures/module.pyi diff --git a/mypy/test/data/fixtures/ops.py b/mypy/test/data/fixtures/ops.pyi similarity index 100% rename from mypy/test/data/fixtures/ops.py rename to mypy/test/data/fixtures/ops.pyi diff --git a/mypy/test/data/fixtures/primitives.py b/mypy/test/data/fixtures/primitives.pyi similarity index 100% rename from mypy/test/data/fixtures/primitives.py rename to mypy/test/data/fixtures/primitives.pyi diff --git a/mypy/test/data/fixtures/property.py b/mypy/test/data/fixtures/property.pyi similarity index 100% rename from mypy/test/data/fixtures/property.py rename to mypy/test/data/fixtures/property.pyi diff --git a/mypy/test/data/fixtures/python2.py b/mypy/test/data/fixtures/python2.pyi similarity index 100% rename from mypy/test/data/fixtures/python2.py rename to mypy/test/data/fixtures/python2.pyi diff --git a/mypy/test/data/fixtures/set.py b/mypy/test/data/fixtures/set.pyi similarity index 100% rename from mypy/test/data/fixtures/set.py rename to mypy/test/data/fixtures/set.pyi diff --git a/mypy/test/data/fixtures/slice.py b/mypy/test/data/fixtures/slice.pyi similarity index 100% rename from mypy/test/data/fixtures/slice.py rename to mypy/test/data/fixtures/slice.pyi diff --git a/mypy/test/data/fixtures/staticmethod.py b/mypy/test/data/fixtures/staticmethod.pyi similarity index 100% rename from mypy/test/data/fixtures/staticmethod.py rename to mypy/test/data/fixtures/staticmethod.pyi diff --git a/mypy/test/data/fixtures/transform.py b/mypy/test/data/fixtures/transform.pyi similarity index 100% rename from mypy/test/data/fixtures/transform.py rename to mypy/test/data/fixtures/transform.pyi diff --git a/mypy/test/data/fixtures/tuple-simple.py b/mypy/test/data/fixtures/tuple-simple.pyi similarity index 100% rename from mypy/test/data/fixtures/tuple-simple.py rename to mypy/test/data/fixtures/tuple-simple.pyi diff --git a/mypy/test/data/fixtures/tuple.py b/mypy/test/data/fixtures/tuple.pyi similarity index 100% rename from mypy/test/data/fixtures/tuple.py rename to mypy/test/data/fixtures/tuple.pyi diff --git a/mypy/test/data/fixtures/union.py b/mypy/test/data/fixtures/union.pyi similarity index 100% rename from mypy/test/data/fixtures/union.py rename to mypy/test/data/fixtures/union.pyi diff --git a/mypy/test/data/lib-stub/abc.py b/mypy/test/data/lib-stub/abc.pyi similarity index 100% rename from mypy/test/data/lib-stub/abc.py rename to mypy/test/data/lib-stub/abc.pyi diff --git a/mypy/test/data/lib-stub/builtins.py b/mypy/test/data/lib-stub/builtins.pyi similarity index 100% rename from mypy/test/data/lib-stub/builtins.py rename to mypy/test/data/lib-stub/builtins.pyi diff --git a/mypy/test/data/lib-stub/collections.py b/mypy/test/data/lib-stub/collections.pyi similarity index 100% rename from mypy/test/data/lib-stub/collections.py rename to mypy/test/data/lib-stub/collections.pyi diff --git a/mypy/test/data/lib-stub/typing.py b/mypy/test/data/lib-stub/typing.pyi similarity index 100% rename from mypy/test/data/lib-stub/typing.py rename to mypy/test/data/lib-stub/typing.pyi diff --git a/mypy/test/testsemanal.py b/mypy/test/testsemanal.py index 3a9c14bccce39..0b8050d9941dc 100644 --- a/mypy/test/testsemanal.py +++ b/mypy/test/testsemanal.py @@ -60,10 +60,10 @@ def test_semanal(testcase): # Omit the builtins module and files with a special marker in the # path. # TODO the test is not reliable - if (not f.path.endswith((os.sep + 'builtins.py', - 'typing.py', - 'abc.py', - 'collections.py')) + if (not f.path.endswith((os.sep + 'builtins.pyi', + 'typing.pyi', + 'abc.pyi', + 'collections.pyi')) and not os.path.basename(f.path).startswith('_') and not os.path.splitext( os.path.basename(f.path))[0].endswith('_')): diff --git a/mypy/test/testtransform.py b/mypy/test/testtransform.py index eaab12cb1de88..86f860544a830 100644 --- a/mypy/test/testtransform.py +++ b/mypy/test/testtransform.py @@ -53,9 +53,9 @@ def test_transform(testcase): # Omit the builtins module and files with a special marker in the # path. # TODO the test is not reliable - if (not f.path.endswith((os.sep + 'builtins.py', - 'typing.py', - 'abc.py')) + if (not f.path.endswith((os.sep + 'builtins.pyi', + 'typing.pyi', + 'abc.pyi')) and not os.path.basename(f.path).startswith('_') and not os.path.splitext( os.path.basename(f.path))[0].endswith('_')): diff --git a/setup.py b/setup.py index e0ccf04b3166d..3a7b8103c759d 100644 --- a/setup.py +++ b/setup.py @@ -65,8 +65,8 @@ def find_data_dirs(base, globs, cut): ], 'mypy.test': [ 'data/*.test', - 'data/fixtures/*.py', - 'data/lib-stub/*.py', + 'data/fixtures/*.pyi', + 'data/lib-stub/*.pyi', ], } From a6f5990bd0852c080f1da8a91acfb3dc028ba335 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 04:06:38 -0700 Subject: [PATCH 23/25] Add stub for platform --- mypy/data/stubs/3.2/platform.pyi | 38 +++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/mypy/data/stubs/3.2/platform.pyi b/mypy/data/stubs/3.2/platform.pyi index 13d443b8ab8c1..3a614400e9c04 100644 --- a/mypy/data/stubs/3.2/platform.pyi +++ b/mypy/data/stubs/3.2/platform.pyi @@ -1,9 +1,35 @@ -# Stubs for platform +# Stubs for platform (Python 3.5) -# NOTE: These are incomplete! +from typing import Tuple, NamedTuple -from typing import Tuple +from os import devnull as DEV_NULL -def mac_ver(release: str = '', - version_info: Tuple[str, str, str] = ('', '', ''), - machine: str = '') -> Tuple[str, Tuple[str, str, str], str]: ... +def libc_ver(executable: str = ..., lib: str = '', version: str = '', chunksize: int = 16384) -> Tuple[str, str]: ... +def linux_distribution(distname: str = '', version: str = '', id: str = '', supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = True) -> Tuple[str, str, str]: ... +def dist(distname: str = '', version: str = '', id: str = '', supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ... +from os import popen +def win32_ver(release: str = '', version: str = '', csd: str = '', ptype: str = '') -> Tuple[str, str, str, str]: ... +def mac_ver(release: str = '', versioninfo: Tuple[str, str, str] = ..., machine: str = '') -> Tuple[str, Tuple[str, str, str], str]: ... +def java_ver(release: str = '', vendor: str = '', vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ... +def system_alias(system: str, release: str, version: str) -> Tuple[str, str, str]: ... +def architecture(executable: str = ..., bits: str = '', linkage: str = '') -> Tuple[str, str]: ... + +uname_result = NamedTuple('uname_result', [('system', str), ('node', str), ('release', str), ('version', str), ('machine', str), ('processor', str)]) + +def uname() -> uname_result: ... +def system() -> str: ... +def node() -> str: ... +def release() -> str: ... +def version() -> str: ... +def machine() -> str: ... +def processor() -> str: ... + +def python_implementation() -> str: ... +def python_version() -> str: ... +def python_version_tuple() -> Tuple[str, str, str]: ... +def python_branch() -> str: ... +def python_revision() -> str: ... +def python_build() -> Tuple[str, str]: ... +def python_compiler() -> str: ... + +def platform(aliased: bool = False, terse: bool = False) -> str: ... From 58bc74210458a53b0672f80d903a2c4256bfefa8 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 04:49:54 -0700 Subject: [PATCH 24/25] Ensure that lib-python is treated as stub-only --- lib-python/3.2/{base64.py => base64.pyi} | 0 lib-python/3.2/{fnmatch.py => fnmatch.pyi} | 0 lib-python/3.2/{genericpath.py => genericpath.pyi} | 0 lib-python/3.2/{getopt.py => getopt.pyi} | 0 lib-python/3.2/{glob.py => glob.pyi} | 0 lib-python/3.2/incomplete/logging/{__init__.py => __init__.pyi} | 0 lib-python/3.2/incomplete/urllib/{__init__.py => __init__.pyi} | 0 lib-python/3.2/incomplete/urllib/{parse.py => parse.pyi} | 0 lib-python/3.2/{posixpath.py => posixpath.pyi} | 0 lib-python/3.2/{pprint.py => pprint.pyi} | 0 lib-python/3.2/{random.py => random.pyi} | 0 lib-python/3.2/{shutil.py => shutil.pyi} | 0 lib-python/3.2/{subprocess.py => subprocess.pyi} | 0 lib-python/3.2/{tempfile.py => tempfile.pyi} | 0 lib-python/3.2/test/{__init__.py => __init__.pyi} | 0 .../3.2/test/subprocessdata/{fd_status.py => fd_status.pyi} | 0 .../test/subprocessdata/{input_reader.py => input_reader.pyi} | 0 lib-python/3.2/test/subprocessdata/{qcat.py => qcat.pyi} | 0 lib-python/3.2/test/subprocessdata/{qgrep.py => qgrep.pyi} | 0 .../subprocessdata/{sigchild_ignore.py => sigchild_ignore.pyi} | 0 lib-python/3.2/test/{support.py => support.pyi} | 0 lib-python/3.2/test/{test_base64.py => test_base64.pyi} | 0 lib-python/3.2/test/{test_fnmatch.py => test_fnmatch.pyi} | 0 .../3.2/test/{test_genericpath.py => test_genericpath.pyi} | 0 lib-python/3.2/test/{test_getopt.py => test_getopt.pyi} | 0 lib-python/3.2/test/{test_glob.py => test_glob.pyi} | 0 lib-python/3.2/test/{test_posixpath.py => test_posixpath.pyi} | 0 lib-python/3.2/test/{test_pprint.py => test_pprint.pyi} | 0 lib-python/3.2/test/{test_random.py => test_random.pyi} | 0 lib-python/3.2/test/{test_set.py => test_set.pyi} | 0 lib-python/3.2/test/{test_shutil.py => test_shutil.pyi} | 0 lib-python/3.2/test/{test_subprocess.py => test_subprocess.pyi} | 0 lib-python/3.2/test/{test_tempfile.py => test_tempfile.pyi} | 0 lib-python/3.2/test/{test_textwrap.py => test_textwrap.pyi} | 0 .../3.2/test/{tf_inherit_check.py => tf_inherit_check.pyi} | 0 lib-python/3.2/{textwrap.py => textwrap.pyi} | 0 runtests.py | 2 +- 37 files changed, 1 insertion(+), 1 deletion(-) rename lib-python/3.2/{base64.py => base64.pyi} (100%) rename lib-python/3.2/{fnmatch.py => fnmatch.pyi} (100%) rename lib-python/3.2/{genericpath.py => genericpath.pyi} (100%) rename lib-python/3.2/{getopt.py => getopt.pyi} (100%) rename lib-python/3.2/{glob.py => glob.pyi} (100%) rename lib-python/3.2/incomplete/logging/{__init__.py => __init__.pyi} (100%) rename lib-python/3.2/incomplete/urllib/{__init__.py => __init__.pyi} (100%) rename lib-python/3.2/incomplete/urllib/{parse.py => parse.pyi} (100%) rename lib-python/3.2/{posixpath.py => posixpath.pyi} (100%) rename lib-python/3.2/{pprint.py => pprint.pyi} (100%) rename lib-python/3.2/{random.py => random.pyi} (100%) rename lib-python/3.2/{shutil.py => shutil.pyi} (100%) rename lib-python/3.2/{subprocess.py => subprocess.pyi} (100%) rename lib-python/3.2/{tempfile.py => tempfile.pyi} (100%) rename lib-python/3.2/test/{__init__.py => __init__.pyi} (100%) rename lib-python/3.2/test/subprocessdata/{fd_status.py => fd_status.pyi} (100%) rename lib-python/3.2/test/subprocessdata/{input_reader.py => input_reader.pyi} (100%) rename lib-python/3.2/test/subprocessdata/{qcat.py => qcat.pyi} (100%) rename lib-python/3.2/test/subprocessdata/{qgrep.py => qgrep.pyi} (100%) rename lib-python/3.2/test/subprocessdata/{sigchild_ignore.py => sigchild_ignore.pyi} (100%) rename lib-python/3.2/test/{support.py => support.pyi} (100%) rename lib-python/3.2/test/{test_base64.py => test_base64.pyi} (100%) rename lib-python/3.2/test/{test_fnmatch.py => test_fnmatch.pyi} (100%) rename lib-python/3.2/test/{test_genericpath.py => test_genericpath.pyi} (100%) rename lib-python/3.2/test/{test_getopt.py => test_getopt.pyi} (100%) rename lib-python/3.2/test/{test_glob.py => test_glob.pyi} (100%) rename lib-python/3.2/test/{test_posixpath.py => test_posixpath.pyi} (100%) rename lib-python/3.2/test/{test_pprint.py => test_pprint.pyi} (100%) rename lib-python/3.2/test/{test_random.py => test_random.pyi} (100%) rename lib-python/3.2/test/{test_set.py => test_set.pyi} (100%) rename lib-python/3.2/test/{test_shutil.py => test_shutil.pyi} (100%) rename lib-python/3.2/test/{test_subprocess.py => test_subprocess.pyi} (100%) rename lib-python/3.2/test/{test_tempfile.py => test_tempfile.pyi} (100%) rename lib-python/3.2/test/{test_textwrap.py => test_textwrap.pyi} (100%) rename lib-python/3.2/test/{tf_inherit_check.py => tf_inherit_check.pyi} (100%) rename lib-python/3.2/{textwrap.py => textwrap.pyi} (100%) diff --git a/lib-python/3.2/base64.py b/lib-python/3.2/base64.pyi similarity index 100% rename from lib-python/3.2/base64.py rename to lib-python/3.2/base64.pyi diff --git a/lib-python/3.2/fnmatch.py b/lib-python/3.2/fnmatch.pyi similarity index 100% rename from lib-python/3.2/fnmatch.py rename to lib-python/3.2/fnmatch.pyi diff --git a/lib-python/3.2/genericpath.py b/lib-python/3.2/genericpath.pyi similarity index 100% rename from lib-python/3.2/genericpath.py rename to lib-python/3.2/genericpath.pyi diff --git a/lib-python/3.2/getopt.py b/lib-python/3.2/getopt.pyi similarity index 100% rename from lib-python/3.2/getopt.py rename to lib-python/3.2/getopt.pyi diff --git a/lib-python/3.2/glob.py b/lib-python/3.2/glob.pyi similarity index 100% rename from lib-python/3.2/glob.py rename to lib-python/3.2/glob.pyi diff --git a/lib-python/3.2/incomplete/logging/__init__.py b/lib-python/3.2/incomplete/logging/__init__.pyi similarity index 100% rename from lib-python/3.2/incomplete/logging/__init__.py rename to lib-python/3.2/incomplete/logging/__init__.pyi diff --git a/lib-python/3.2/incomplete/urllib/__init__.py b/lib-python/3.2/incomplete/urllib/__init__.pyi similarity index 100% rename from lib-python/3.2/incomplete/urllib/__init__.py rename to lib-python/3.2/incomplete/urllib/__init__.pyi diff --git a/lib-python/3.2/incomplete/urllib/parse.py b/lib-python/3.2/incomplete/urllib/parse.pyi similarity index 100% rename from lib-python/3.2/incomplete/urllib/parse.py rename to lib-python/3.2/incomplete/urllib/parse.pyi diff --git a/lib-python/3.2/posixpath.py b/lib-python/3.2/posixpath.pyi similarity index 100% rename from lib-python/3.2/posixpath.py rename to lib-python/3.2/posixpath.pyi diff --git a/lib-python/3.2/pprint.py b/lib-python/3.2/pprint.pyi similarity index 100% rename from lib-python/3.2/pprint.py rename to lib-python/3.2/pprint.pyi diff --git a/lib-python/3.2/random.py b/lib-python/3.2/random.pyi similarity index 100% rename from lib-python/3.2/random.py rename to lib-python/3.2/random.pyi diff --git a/lib-python/3.2/shutil.py b/lib-python/3.2/shutil.pyi similarity index 100% rename from lib-python/3.2/shutil.py rename to lib-python/3.2/shutil.pyi diff --git a/lib-python/3.2/subprocess.py b/lib-python/3.2/subprocess.pyi similarity index 100% rename from lib-python/3.2/subprocess.py rename to lib-python/3.2/subprocess.pyi diff --git a/lib-python/3.2/tempfile.py b/lib-python/3.2/tempfile.pyi similarity index 100% rename from lib-python/3.2/tempfile.py rename to lib-python/3.2/tempfile.pyi diff --git a/lib-python/3.2/test/__init__.py b/lib-python/3.2/test/__init__.pyi similarity index 100% rename from lib-python/3.2/test/__init__.py rename to lib-python/3.2/test/__init__.pyi diff --git a/lib-python/3.2/test/subprocessdata/fd_status.py b/lib-python/3.2/test/subprocessdata/fd_status.pyi similarity index 100% rename from lib-python/3.2/test/subprocessdata/fd_status.py rename to lib-python/3.2/test/subprocessdata/fd_status.pyi diff --git a/lib-python/3.2/test/subprocessdata/input_reader.py b/lib-python/3.2/test/subprocessdata/input_reader.pyi similarity index 100% rename from lib-python/3.2/test/subprocessdata/input_reader.py rename to lib-python/3.2/test/subprocessdata/input_reader.pyi diff --git a/lib-python/3.2/test/subprocessdata/qcat.py b/lib-python/3.2/test/subprocessdata/qcat.pyi similarity index 100% rename from lib-python/3.2/test/subprocessdata/qcat.py rename to lib-python/3.2/test/subprocessdata/qcat.pyi diff --git a/lib-python/3.2/test/subprocessdata/qgrep.py b/lib-python/3.2/test/subprocessdata/qgrep.pyi similarity index 100% rename from lib-python/3.2/test/subprocessdata/qgrep.py rename to lib-python/3.2/test/subprocessdata/qgrep.pyi diff --git a/lib-python/3.2/test/subprocessdata/sigchild_ignore.py b/lib-python/3.2/test/subprocessdata/sigchild_ignore.pyi similarity index 100% rename from lib-python/3.2/test/subprocessdata/sigchild_ignore.py rename to lib-python/3.2/test/subprocessdata/sigchild_ignore.pyi diff --git a/lib-python/3.2/test/support.py b/lib-python/3.2/test/support.pyi similarity index 100% rename from lib-python/3.2/test/support.py rename to lib-python/3.2/test/support.pyi diff --git a/lib-python/3.2/test/test_base64.py b/lib-python/3.2/test/test_base64.pyi similarity index 100% rename from lib-python/3.2/test/test_base64.py rename to lib-python/3.2/test/test_base64.pyi diff --git a/lib-python/3.2/test/test_fnmatch.py b/lib-python/3.2/test/test_fnmatch.pyi similarity index 100% rename from lib-python/3.2/test/test_fnmatch.py rename to lib-python/3.2/test/test_fnmatch.pyi diff --git a/lib-python/3.2/test/test_genericpath.py b/lib-python/3.2/test/test_genericpath.pyi similarity index 100% rename from lib-python/3.2/test/test_genericpath.py rename to lib-python/3.2/test/test_genericpath.pyi diff --git a/lib-python/3.2/test/test_getopt.py b/lib-python/3.2/test/test_getopt.pyi similarity index 100% rename from lib-python/3.2/test/test_getopt.py rename to lib-python/3.2/test/test_getopt.pyi diff --git a/lib-python/3.2/test/test_glob.py b/lib-python/3.2/test/test_glob.pyi similarity index 100% rename from lib-python/3.2/test/test_glob.py rename to lib-python/3.2/test/test_glob.pyi diff --git a/lib-python/3.2/test/test_posixpath.py b/lib-python/3.2/test/test_posixpath.pyi similarity index 100% rename from lib-python/3.2/test/test_posixpath.py rename to lib-python/3.2/test/test_posixpath.pyi diff --git a/lib-python/3.2/test/test_pprint.py b/lib-python/3.2/test/test_pprint.pyi similarity index 100% rename from lib-python/3.2/test/test_pprint.py rename to lib-python/3.2/test/test_pprint.pyi diff --git a/lib-python/3.2/test/test_random.py b/lib-python/3.2/test/test_random.pyi similarity index 100% rename from lib-python/3.2/test/test_random.py rename to lib-python/3.2/test/test_random.pyi diff --git a/lib-python/3.2/test/test_set.py b/lib-python/3.2/test/test_set.pyi similarity index 100% rename from lib-python/3.2/test/test_set.py rename to lib-python/3.2/test/test_set.pyi diff --git a/lib-python/3.2/test/test_shutil.py b/lib-python/3.2/test/test_shutil.pyi similarity index 100% rename from lib-python/3.2/test/test_shutil.py rename to lib-python/3.2/test/test_shutil.pyi diff --git a/lib-python/3.2/test/test_subprocess.py b/lib-python/3.2/test/test_subprocess.pyi similarity index 100% rename from lib-python/3.2/test/test_subprocess.py rename to lib-python/3.2/test/test_subprocess.pyi diff --git a/lib-python/3.2/test/test_tempfile.py b/lib-python/3.2/test/test_tempfile.pyi similarity index 100% rename from lib-python/3.2/test/test_tempfile.py rename to lib-python/3.2/test/test_tempfile.pyi diff --git a/lib-python/3.2/test/test_textwrap.py b/lib-python/3.2/test/test_textwrap.pyi similarity index 100% rename from lib-python/3.2/test/test_textwrap.py rename to lib-python/3.2/test/test_textwrap.pyi diff --git a/lib-python/3.2/test/tf_inherit_check.py b/lib-python/3.2/test/tf_inherit_check.pyi similarity index 100% rename from lib-python/3.2/test/tf_inherit_check.py rename to lib-python/3.2/test/tf_inherit_check.pyi diff --git a/lib-python/3.2/textwrap.py b/lib-python/3.2/textwrap.pyi similarity index 100% rename from lib-python/3.2/textwrap.py rename to lib-python/3.2/textwrap.pyi diff --git a/runtests.py b/runtests.py index 2f285ee686d0b..29798017f5e48 100755 --- a/runtests.py +++ b/runtests.py @@ -265,7 +265,7 @@ def add_libpython(driver: Driver) -> None: seen = set() # type: Set[str] for version in driver.versions: libpython_dir = join('lib-python', version) - for f in find_files(libpython_dir, prefix='test_', suffix='.py'): + for f in find_files(libpython_dir, prefix='test_', suffix='.pyi'): module = file_to_module(f, libpython_dir) if module not in seen: seen.add(module) From a8d7eaa1d4015e70f3f4c0f6ef7ee1b04b12c250 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 13 Oct 2015 04:12:30 -0700 Subject: [PATCH 25/25] Use new Dialect objects to store version everywhere --- mypy/build.py | 43 +++++++++++++++++--------------------- mypy/checker.py | 12 +++++------ mypy/checkexpr.py | 6 +++--- mypy/defaults.py | 2 -- mypy/lex.py | 23 +++++++++----------- mypy/main.py | 36 +++++++++++++++++-------------- mypy/parse.py | 43 +++++++++++++++++++------------------- mypy/semanal.py | 24 ++++++++++----------- mypy/stubgen.py | 26 +++++++++++------------ mypy/stubutil.py | 10 ++++----- mypy/syntax/dialect.py | 19 +++++++++++++++-- mypy/test/helpers.py | 20 +++++++++++------- mypy/test/testcheck.py | 6 +++--- mypy/test/testparse.py | 8 +++---- mypy/test/testsemanal.py | 4 ++-- mypy/test/testtransform.py | 4 ++-- 16 files changed, 149 insertions(+), 137 deletions(-) delete mode 100644 mypy/defaults.py diff --git a/mypy/build.py b/mypy/build.py index dafb9ae723f00..da71903e1fe31 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -27,7 +27,7 @@ from mypy import parse from mypy import stats from mypy.report import Reports -from mypy import defaults +from mypy.syntax.dialect import Dialect, Implementation, default_implementation # We need to know the location of this file to load data, but @@ -95,7 +95,7 @@ def build(program_path: str, argument: str = None, program_text: Union[str, bytes] = None, alt_lib_path: str = None, - pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, + implementation: Implementation = None, custom_typing_module: str = None, report_dirs: Dict[str, str] = {}, flags: List[str] = None, @@ -115,17 +115,18 @@ def build(program_path: str, program_text: the main source file contents; if omitted, read from file alt_lib_dir: an additional directory for looking up library modules (takes precedence over other directories) - pyversion: Python version (major, minor) + implementation: Python version custom_typing_module: if not None, use this module id as an alias for typing flags: list of build options (e.g. COMPILE_ONLY) """ flags = flags or [] module = module or '__main__' + implementation = implementation or default_implementation() data_dir = default_data_dir() # Determine the default module search path. - lib_path = default_lib_path(data_dir, target, pyversion, python_path) + lib_path = default_lib_path(data_dir, target, implementation, python_path) if TEST_BUILTINS in flags: # Use stub builtins (to speed up test cases and to make them easier to @@ -157,7 +158,7 @@ def build(program_path: str, # # Ignore current directory prefix in error messages. manager = BuildManager(data_dir, lib_path, target, - pyversion=pyversion, flags=flags, + dialect=implementation.base_dialect, flags=flags, ignore_prefix=os.getcwd(), custom_typing_module=custom_typing_module, reports=reports) @@ -181,7 +182,7 @@ def default_data_dir() -> str: return os.path.join(os.path.dirname(__file__), 'data') -def default_lib_path(data_dir: str, target: int, pyversion: Tuple[int, int], +def default_lib_path(data_dir: str, target: int, implementation: Implementation, python_path: bool) -> List[str]: """Return default standard library search paths.""" # IDEA: Make this more portable. @@ -196,14 +197,12 @@ def default_lib_path(data_dir: str, target: int, pyversion: Tuple[int, int], # stubs/x.y directory of the mypy installation. Additionally, stubs # for earlier versions in the same major version will be added, and # as a last resort, third-party stubs will be added. - if pyversion == 2: - major, minor = 2, 7 + major = implementation.base_dialect.major + minor = implementation.base_dialect.minor + if major == 3: + version_dir = '3.2' + third_party_dir = 'third-party-3.2' else: - # See bug #886 - major, minor = sys.version_info[0], sys.version_info[1] - version_dir = '3.2' - third_party_dir = 'third-party-3.2' - if pyversion[0] < 3: version_dir = '2.7' third_party_dir = 'third-party-2.7' path.append(os.path.join(data_dir, 'stubs', version_dir)) @@ -224,13 +223,9 @@ def default_lib_path(data_dir: str, target: int, pyversion: Tuple[int, int], if os.path.isdir(third_party_stubdir): path.append(third_party_stubdir) - # Add fallback path that can be used if we have a broken installation. - if sys.platform != 'win32': - path.append('/usr/local/lib/mypy') - # Contents of Python's sys.path go last, to prefer the stubs if python_path: - path.extend(sys.path) + path.extend(implementation.python_path) return path @@ -272,7 +267,7 @@ class BuildManager: Semantic analyzer, pass 3 type_checker: Type checker errors: Used for reporting all errors - pyversion: Python version (major, minor) + dialect: Python version flags: Build options states: States of all individual files that are being processed. Each file in a build is always represented @@ -290,7 +285,7 @@ class BuildManager: def __init__(self, data_dir: str, lib_path: List[str], target: int, - pyversion: Tuple[int, int], + dialect: Dialect, flags: List[str], ignore_prefix: str, custom_typing_module: str, @@ -300,16 +295,16 @@ def __init__(self, data_dir: str, self.errors.set_ignore_prefix(ignore_prefix) self.lib_path = lib_path self.target = target - self.pyversion = pyversion + self.dialect = dialect self.flags = flags self.custom_typing_module = custom_typing_module self.reports = reports self.semantic_analyzer = SemanticAnalyzer(lib_path, self.errors, - pyversion=pyversion) + dialect=dialect) self.semantic_analyzer_pass3 = ThirdPass(self.errors) self.type_checker = TypeChecker(self.errors, self.semantic_analyzer.modules, - self.pyversion) + dialect) self.states = [] # type: List[State] self.module_files = {} # type: Dict[str, str] self.module_deps = {} # type: Dict[Tuple[str, str], bool] @@ -720,7 +715,7 @@ def parse(self, source_text: Union[str, bytes], fnam: str) -> MypyFile: """ num_errs = self.errors().num_messages() tree = parse.parse(source_text, fnam, self.errors(), - pyversion=self.manager.pyversion, + dialect=self.manager.dialect, custom_typing_module=self.manager.custom_typing_module) tree._fullname = self.id if self.errors().num_messages() != num_errs: diff --git a/mypy/checker.py b/mypy/checker.py index f91d34f690543..a0cf3cd212ed8 100644 --- a/mypy/checker.py +++ b/mypy/checker.py @@ -33,7 +33,7 @@ from mypy.sametypes import is_same_type from mypy.messages import MessageBuilder import mypy.checkexpr -from mypy import defaults +from mypy.syntax.dialect import Dialect, default_dialect from mypy import messages from mypy.subtypes import ( is_subtype, is_equivalent, is_proper_subtype, @@ -302,7 +302,7 @@ class TypeChecker(NodeVisitor[Type]): """ # Target Python version - pyversion = defaults.PYTHON3_VERSION + dialect = None # type: Dialect # Are we type checking a stub? is_stub = False # Error message reporter @@ -337,7 +337,7 @@ class TypeChecker(NodeVisitor[Type]): modules = None # type: Dict[str, MypyFile] def __init__(self, errors: Errors, modules: Dict[str, MypyFile], - pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION) -> None: + dialect: Dialect = default_dialect()) -> None: """Construct a type checker. Use errors to report type check errors. Assume symtable has been @@ -346,7 +346,7 @@ def __init__(self, errors: Errors, modules: Dict[str, MypyFile], self.expr_checker self.errors = errors self.modules = modules - self.pyversion = pyversion + self.dialect = dialect self.msg = MessageBuilder(errors) self.type_map = {} self.binder = ConditionalTypeBinder() @@ -1548,7 +1548,7 @@ def type_check_raise(self, e: Node, s: RaiseStmt) -> None: # Good! return None # Else fall back to the checks below (which will fail). - if isinstance(typ, TupleType) and self.pyversion[0] == 2: + if isinstance(typ, TupleType) and self.dialect.major == 2: # allow `raise type, value, traceback` # https://docs.python.org/2/reference/simple_stmts.html#the-raise-statement # TODO: Also check tuple item types. @@ -1660,7 +1660,7 @@ def analyze_iterable_item_type(self, expr: Node) -> Type: method = echk.analyze_external_member_access('__iter__', iterable, expr) iterator = echk.check_call(method, [], [], expr)[0] - if self.pyversion[0] >= 3: + if self.dialect.major >= 3: nextmethod = '__next__' else: nextmethod = 'next' diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index a7c84b0cb056c..1c411d4bf2acb 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -727,7 +727,7 @@ def visit_complex_expr(self, e: ComplexExpr) -> Type: def visit_ellipsis(self, e: EllipsisExpr) -> Type: """Type check '...'.""" - if self.chk.pyversion[0] >= 3: + if self.chk.dialect.major >= 3: return self.named_type('builtins.ellipsis') else: # '...' is not valid in normal Python 2 code, but it can @@ -821,7 +821,7 @@ def visit_comparison_expr(self, e: ComparisonExpr) -> Type: return result def get_operator_method(self, op: str) -> str: - if op == '/' and self.chk.pyversion[0] == 2: + if op == '/' and self.chk.dialect.major == 2: # TODO also check for "from __future__ import division" return '__div__' else: @@ -893,7 +893,7 @@ def check_op(self, method: str, base_type: Type, arg: Node, self.msg) def get_reverse_op_method(self, method: str) -> str: - if method == '__div__' and self.chk.pyversion[0] == 2: + if method == '__div__' and self.chk.dialect.major == 2: return '__rdiv__' else: return nodes.reverse_op_methods[method] diff --git a/mypy/defaults.py b/mypy/defaults.py deleted file mode 100644 index 5a0875f525e25..0000000000000 --- a/mypy/defaults.py +++ /dev/null @@ -1,2 +0,0 @@ -PYTHON2_VERSION = (2, 7) -PYTHON3_VERSION = (3, 5) diff --git a/mypy/lex.py b/mypy/lex.py index 56f8c79afbb8a..12ed1bbbc522e 100644 --- a/mypy/lex.py +++ b/mypy/lex.py @@ -8,8 +8,8 @@ import re +from mypy.syntax.dialect import Dialect, default_dialect from mypy.util import short_type -from mypy import defaults from typing import List, Callable, Dict, Any, Match, Pattern, Set, Union, Tuple @@ -159,14 +159,13 @@ def __str__(self): def lex(string: Union[str, bytes], first_line: int = 1, - pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, - is_stub_file: bool = False) -> Tuple[List[Token], Set[int]]: + dialect: Dialect = default_dialect()) -> Tuple[List[Token], Set[int]]: """Analyze string, and return an array of token objects and the lines to ignore. The last token is always Eof. The intention is to ignore any semantic and type check errors on the ignored lines. """ - l = Lexer(pyversion, is_stub_file=is_stub_file) + l = Lexer(dialect) l.lex(string, first_line) return l.tok, l.ignored_lines @@ -293,19 +292,17 @@ class Lexer: # newlines within parentheses/brackets. open_brackets = None # type: List[str] - pyversion = defaults.PYTHON3_VERSION + dialect = None # type: Dialect # Ignore errors on these lines (defined using '# type: ignore'). ignored_lines = None # type: Set[int] - def __init__(self, pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, - is_stub_file: bool = False) -> None: + def __init__(self, dialect: Dialect = default_dialect()) -> None: self.map = [self.unknown_character] * 256 self.tok = [] self.indents = [0] self.open_brackets = [] - self.pyversion = pyversion - self.is_stub_file = is_stub_file + self.dialect = dialect self.ignored_lines = set() # Fill in the map from valid character codes to relevant lexer methods. for seq, method in [('ABCDEFGHIJKLMNOPQRSTUVWXYZ', self.lex_name), @@ -325,12 +322,12 @@ def __init__(self, pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, ('-+*/<>%&|^~=!,@', self.lex_misc)]: for c in seq: self.map[ord(c)] = method - if pyversion[0] == 2: + if dialect.major == 2: self.keywords = keywords_common | keywords2 # Decimal/hex/octal/binary literal or integer complex literal self.number_exp1 = re.compile('(0[xXoObB][0-9a-fA-F]+|[0-9]+)[lL]?') - if pyversion[0] == 3: + if dialect.major == 3: self.keywords = keywords_common | keywords3 self.number_exp1 = re.compile('0[xXoObB][0-9a-fA-F]+|[0-9]+') @@ -397,7 +394,7 @@ def find_encoding(self, text: bytes) -> Tuple[str, int]: line = 2 if result.group(1) else 1 return result.group(3).decode('ascii'), line else: - default_encoding = 'utf8' if self.pyversion[0] >= 3 else 'ascii' + default_encoding = 'utf8' if self.dialect.major >= 3 else 'ascii' return default_encoding, -1 def report_unicode_decode_error(self, exc: UnicodeDecodeError, text: bytes) -> None: @@ -487,7 +484,7 @@ def lex_number(self) -> None: self.add_token(LexError(' ' * maxlen, NUMERIC_LITERAL_ERROR)) elif len(s1) == maxlen: # Integer literal. - if self.pyversion[0] >= 3 and self.octal_int.match(s1): + if self.dialect.major >= 3 and self.octal_int.match(s1): # Python 2 style octal literal such as 0377 not supported in Python 3. self.add_token(LexError(s1, NUMERIC_LITERAL_ERROR)) else: diff --git a/mypy/main.py b/mypy/main.py index 0ca1e48a819ed..9d10682dd07a9 100644 --- a/mypy/main.py +++ b/mypy/main.py @@ -11,7 +11,7 @@ from typing import Dict, List, Tuple from mypy import build -from mypy import defaults +from mypy.syntax.dialect import Implementation, default_implementation from mypy.errors import CompileError from mypy.version import __version__ @@ -22,7 +22,7 @@ def __init__(self) -> None: # Set default options. self.target = build.TYPE_CHECK self.build_flags = [] # type: List[str] - self.pyversion = defaults.PYTHON3_VERSION + self.implementation = None # type: Implementation self.custom_typing_module = None # type: str self.report_dirs = {} # type: Dict[str, str] self.python_path = False @@ -58,7 +58,7 @@ def type_check_only(path: str, module: str, program_text: str, module=module, program_text=program_text, target=build.TYPE_CHECK, - pyversion=options.pyversion, + implementation=options.implementation, custom_typing_module=options.custom_typing_module, report_dirs=options.report_dirs, flags=options.build_flags, @@ -75,23 +75,21 @@ def process_options(args: List[str]) -> Tuple[str, str, str, Options]: options = Options() help = False ver = False + python_executable = None # type: str + force_py2 = False + while args and args[0].startswith('-'): if args[0] == '--verbose': options.build_flags.append(build.VERBOSE) args = args[1:] elif args[0] == '--py2': # Use Python 2 mode. - options.pyversion = defaults.PYTHON2_VERSION + force_py2 = True args = args[1:] - elif args[0] == '--python-version': - version_components = args[1].split(".")[0:2] - if len(version_components) != 2: - fail("Invalid python version {} (expected format: 'x.y')".format( - repr(args[1]))) - if not all(item.isdigit() for item in version_components): - fail("Found non-digit in python version: {}".format( - args[1])) - options.pyversion = (int(version_components[0]), int(version_components[1])) + elif args[0] == '--python-executable': + if len(args) < 2: + fail('argument required') + python_executable = args[1] args = args[2:] elif args[0] == '-m' and args[1:]: options.build_flags.append(build.MODULE) @@ -137,9 +135,12 @@ def process_options(args: List[str]) -> Tuple[str, str, str, Options]: if args[1:]: usage('Extra argument: {}'.format(args[1])) - if options.python_path and options.pyversion[0] == 2: - usage('Python version 2 (or --py2) specified, ' - 'but --use-python-path will search in sys.path of Python 3') + if python_executable is not None: + options.implementation = Implementation(python_executable) + if force_py2 and options.implementation.base_dialect.major != 2: + usage('given --python-executable is not --py2') + else: + options.implementation = default_implementation(force_py2=force_py2) return args[0], None, None, options @@ -182,9 +183,12 @@ def usage(msg: str = None) -> None: --verbose more verbose messages --use-python-path search for modules in sys.path of running Python --version show the current version information + --python-executable emulate this python interpreter + --py2 deprecated, automatically find a python2 interpreter Environment variables: MYPYPATH additional module search path + MYPY_PYTHON interpreter to emulate """ % ', '.join(REPORTS)) sys.exit(2) diff --git a/mypy/parse.py b/mypy/parse.py index a6ac4184db7dd..75b3c50c1d5dc 100644 --- a/mypy/parse.py +++ b/mypy/parse.py @@ -28,7 +28,7 @@ StarExpr, YieldFromStmt, YieldFromExpr, NonlocalDecl, DictionaryComprehension, SetComprehension, ComplexExpr, EllipsisExpr, YieldExpr, ExecStmt ) -from mypy import defaults +from mypy.syntax.dialect import Dialect, default_dialect from mypy import nodes from mypy.errors import Errors, CompileError from mypy.types import Void, Type, CallableType, AnyType, UnboundType @@ -68,17 +68,19 @@ def parse(source: Union[str, bytes], fnam: str = None, errors: Errors = None, - pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION, + dialect: Dialect = default_dialect(), custom_typing_module: str = None) -> MypyFile: """Parse a source file, without doing any semantic analysis. Return the parse tree. If errors is not provided, raise ParseError on failure. Otherwise, use the errors object to report parse errors. - The pyversion (major, minor) argument determines the Python syntax variant. + The dialect argument determines the Python syntax variant. """ is_stub_file = bool(fnam) and fnam.endswith('.pyi') - parser = Parser(fnam, errors, pyversion, custom_typing_module, is_stub_file=is_stub_file) + if is_stub_file: + dialect = dialect.add_future('mypy-stub') + parser = Parser(fnam, errors, dialect, custom_typing_module) tree = parser.parse(source) tree.path = fnam tree.is_stub = is_stub_file @@ -109,12 +111,11 @@ class Parser: # Lines to ignore (using # type: ignore). ignored_lines = None # type: Set[int] - def __init__(self, fnam: str, errors: Errors, pyversion: Tuple[int, int], - custom_typing_module: str = None, is_stub_file: bool = False) -> None: + def __init__(self, fnam: str, errors: Errors, dialect: Dialect, + custom_typing_module: str = None) -> None: self.raise_on_error = errors is None - self.pyversion = pyversion + self.dialect = dialect self.custom_typing_module = custom_typing_module - self.is_stub_file = is_stub_file if errors is not None: self.errors = errors else: @@ -125,8 +126,7 @@ def __init__(self, fnam: str, errors: Errors, pyversion: Tuple[int, int], self.errors.set_file('') def parse(self, s: Union[str, bytes]) -> MypyFile: - self.tok, self.ignored_lines = lex.lex(s, pyversion=self.pyversion, - is_stub_file=self.is_stub_file) + self.tok, self.ignored_lines = lex.lex(s, dialect=self.dialect) self.ind = 0 self.imports = [] self.future_options = [] @@ -762,7 +762,7 @@ def parse_statement(self) -> Tuple[Node, bool]: is_simple = False elif ts == 'global': stmt = self.parse_global_decl() - elif ts == 'nonlocal' and self.pyversion[0] >= 3: + elif ts == 'nonlocal' and self.dialect.major >= 3: stmt = self.parse_nonlocal_decl() elif ts == 'assert': stmt = self.parse_assert_stmt() @@ -776,10 +776,10 @@ def parse_statement(self) -> Tuple[Node, bool]: elif ts == '@': stmt = self.parse_decorated_function_or_class() is_simple = False - elif ts == 'print' and (self.pyversion[0] == 2 and + elif ts == 'print' and (self.dialect.major == 2 and 'print_function' not in self.future_options): stmt = self.parse_print_stmt() - elif ts == 'exec' and self.pyversion[0] == 2: + elif ts == 'exec' and self.dialect.major == 2: stmt = self.parse_exec_stmt() else: stmt = self.parse_expression_or_assignment() @@ -1034,7 +1034,7 @@ def parse_try_stmt(self) -> Node: self.expect('as') vars.append(self.parse_name_expr()) else: - if (self.pyversion[0] == 2 and + if (self.dialect.major == 2 and isinstance(types[-1], TupleExpr) and len(cast(TupleExpr, types[-1]).items) == 2 and isinstance(cast(TupleExpr, types[-1]).items[1], NameExpr)): @@ -1167,8 +1167,7 @@ def parse_expression(self, prec: int = 0, star_expr_allowed: bool = False) -> No elif isinstance(current, Keyword) and s == "yield": # The expression yield from and yield to assign expr = self.parse_yield_or_yield_from_expr() - elif isinstance(current, EllipsisToken) and (self.pyversion[0] >= 3 - or self.is_stub_file): + elif isinstance(current, EllipsisToken) and self.dialect.ellipsis: expr = self.parse_ellipsis() else: # Invalid expression. @@ -1419,7 +1418,7 @@ def parse_str_expr(self) -> Node: tok.append(t) value += t.parsed() node = None # type: Node - if self.pyversion[0] == 2 and 'unicode_literals' in self.future_options: + if self.dialect.major == 2 and 'unicode_literals' in self.future_options: node = UnicodeExpr(value) else: node = StrExpr(value) @@ -1432,7 +1431,7 @@ def parse_bytes_literal(self) -> Node: while isinstance(self.current(), BytesLit): t = cast(BytesLit, self.skip()) value += t.parsed() - if self.pyversion[0] >= 3: + if self.dialect.major >= 3: node = BytesExpr(value) # type: Node else: node = StrExpr(value) @@ -1445,7 +1444,7 @@ def parse_unicode_literal(self) -> Node: while isinstance(self.current(), UnicodeLit): t = cast(UnicodeLit, self.skip()) value += t.parsed() - if self.pyversion[0] >= 3: + if self.dialect.major >= 3: # Python 3.3 supports u'...' as an alias of '...'. node = StrExpr(value) # type: Node else: @@ -1835,11 +1834,11 @@ def usage(): sys.exit(2) args = sys.argv[1:] - pyversion = defaults.PYTHON3_VERSION + dialect = default_dialect() quiet = False while args and args[0].startswith('--'): if args[0] == '--py2': - pyversion = defaults.PYTHON2_VERSION + dialect = Dialect('2.7.0') elif args[0] == '--quiet': quiet = True else: @@ -1852,7 +1851,7 @@ def usage(): s = open(fnam, 'rb').read() errors = Errors() try: - tree = parse(s, fnam, pyversion=pyversion) + tree = parse(s, fnam, dialect=dialect) if not quiet: print(tree) except CompileError as e: diff --git a/mypy/semanal.py b/mypy/semanal.py index 22e1467dfe3b3..a854a748a0401 100644 --- a/mypy/semanal.py +++ b/mypy/semanal.py @@ -75,7 +75,7 @@ from mypy.lex import lex from mypy.parsetype import parse_type from mypy.sametypes import is_same_type -from mypy import defaults +from mypy.syntax.dialect import Dialect, default_dialect T = TypeVar('T') @@ -165,7 +165,7 @@ class SemanticAnalyzer(NodeVisitor): errors = None # type: Errors # Keeps track of generated errors def __init__(self, lib_path: List[str], errors: Errors, - pyversion: Tuple[int, int] = defaults.PYTHON3_VERSION) -> None: + dialect: Dialect = default_dialect()) -> None: """Construct semantic analyzer. Use lib_path to search for modules, and report analysis errors @@ -183,7 +183,7 @@ def __init__(self, lib_path: List[str], errors: Errors, self.lib_path = lib_path self.errors = errors self.modules = {} - self.pyversion = pyversion + self.dialect = dialect def visit_file(self, file_node: MypyFile, fnam: str) -> None: self.errors.set_file(fnam) @@ -536,7 +536,7 @@ def setup_type_promotion(self, defn: ClassDef) -> None: # _promote class decorator (undocumented faeture). promote_target = analyzed.type if not promote_target: - promotions = (TYPE_PROMOTIONS_PYTHON3 if self.pyversion[0] >= 3 + promotions = (TYPE_PROMOTIONS_PYTHON3 if self.dialect.major >= 3 else TYPE_PROMOTIONS_PYTHON2) if defn.fullname in promotions: promote_target = self.named_type_or_none(promotions[defn.fullname]) @@ -1456,7 +1456,7 @@ def visit_continue_stmt(self, s: ContinueStmt) -> None: self.fail("'continue' outside loop", s) def visit_if_stmt(self, s: IfStmt) -> None: - infer_reachability_of_if_statement(s, pyversion=self.pyversion) + infer_reachability_of_if_statement(s, dialect=self.dialect) for i in range(len(s.expr)): s.expr[i].accept(self) self.visit_block(s.body[i]) @@ -1986,7 +1986,7 @@ class FirstPass(NodeVisitor): def __init__(self, sem: SemanticAnalyzer) -> None: self.sem = sem - self.pyversion = sem.pyversion + self.dialect = sem.dialect def analyze(self, file: MypyFile, fnam: str, mod_id: str) -> None: """Perform the first analysis pass. @@ -2087,7 +2087,7 @@ def visit_decorator(self, d: Decorator) -> None: self.sem.add_symbol(d.var.name(), SymbolTableNode(GDEF, d.var), d) def visit_if_stmt(self, s: IfStmt) -> None: - infer_reachability_of_if_statement(s, pyversion=self.pyversion) + infer_reachability_of_if_statement(s, dialect=self.dialect) for node in s.body: node.accept(self) if s.else_body: @@ -2230,9 +2230,9 @@ def remove_imported_names_from_symtable(names: SymbolTable, def infer_reachability_of_if_statement(s: IfStmt, - pyversion: Tuple[int, int]) -> None: + dialect: Dialect) -> None: for i in range(len(s.expr)): - result = infer_if_condition_value(s.expr[i], pyversion) + result = infer_if_condition_value(s.expr[i], dialect) if result == ALWAYS_FALSE: # The condition is always false, so we skip the if/elif body. mark_block_unreachable(s.body[i]) @@ -2246,7 +2246,7 @@ def infer_reachability_of_if_statement(s: IfStmt, break -def infer_if_condition_value(expr: Node, pyversion: Tuple[int, int]) -> int: +def infer_if_condition_value(expr: Node, dialect: Dialect) -> int: """Infer whether if condition is always true/false. Return ALWAYS_TRUE if always true, ALWAYS_FALSE if always false, @@ -2265,9 +2265,9 @@ def infer_if_condition_value(expr: Node, pyversion: Tuple[int, int]) -> int: name = expr.name result = TRUTH_VALUE_UNKNOWN if name == 'PY2': - result = ALWAYS_TRUE if pyversion[0] == 2 else ALWAYS_FALSE + result = ALWAYS_TRUE if dialect.major == 2 else ALWAYS_FALSE elif name == 'PY3': - result = ALWAYS_TRUE if pyversion[0] == 3 else ALWAYS_FALSE + result = ALWAYS_TRUE if dialect.major == 3 else ALWAYS_FALSE elif name == 'MYPY': result = ALWAYS_TRUE if negated: diff --git a/mypy/stubgen.py b/mypy/stubgen.py index f798e1bb418d0..a25b3d3b132dc 100644 --- a/mypy/stubgen.py +++ b/mypy/stubgen.py @@ -39,7 +39,7 @@ import mypy.parse import mypy.errors import mypy.traverser -from mypy import defaults +from mypy.syntax.dialect import Dialect, default_dialect, default_implementation from mypy.nodes import ( IntExpr, UnaryExpr, StrExpr, BytesExpr, NameExpr, FloatExpr, MemberExpr, TupleExpr, ListExpr, ComparisonExpr, CallExpr, ClassDef, ARG_STAR, ARG_STAR2, ARG_NAMED @@ -49,17 +49,17 @@ def generate_stub(path, output_dir, _all_=None, target=None, add_header=False, module=None, - pyversion=defaults.PYTHON3_VERSION): + dialect=default_dialect()): source = open(path, 'rb').read() try: - ast = mypy.parse.parse(source, fnam=path, pyversion=pyversion) + ast = mypy.parse.parse(source, fnam=path, dialect=dialect) except mypy.errors.CompileError as e: # Syntax error! for m in e.messages: sys.stderr.write('%s\n' % m) exit(1) - gen = StubGenerator(_all_, pyversion=pyversion) + gen = StubGenerator(_all_, dialect=dialect) ast.accept(gen) if not target: target = os.path.join(output_dir, os.path.basename(path)) @@ -68,13 +68,13 @@ def generate_stub(path, output_dir, _all_=None, target=None, add_header=False, m os.makedirs(subdir) with open(target, 'w') as file: if add_header: - write_header(file, module, pyversion=pyversion) + write_header(file, module, dialect=dialect) file.write(''.join(gen.output())) def generate_stub_for_module(module, output_dir, quiet=False, add_header=False, sigs={}, - class_sigs={}, pyversion=defaults.PYTHON3_VERSION): - if pyversion[0] == 2: + class_sigs={}, dialect=default_dialect()): + if dialect.major == 2: module_path, module_all = load_python2_module_info(module) else: mod = importlib.import_module(module) @@ -97,7 +97,7 @@ def generate_stub_for_module(module, output_dir, quiet=False, add_header=False, target += '.pyi' target = os.path.join(output_dir, target) generate_stub(module_path, output_dir, module_all, - target=target, add_header=add_header, module=module, pyversion=pyversion) + target=target, add_header=add_header, module=module, dialect=dialect) if not quiet: print('Created %s' % target) @@ -143,7 +143,7 @@ def load_python2_module_info(module): class StubGenerator(mypy.traverser.TraverserVisitor): - def __init__(self, _all_, pyversion): + def __init__(self, _all_, dialect=default_dialect()): self._all_ = _all_ self._output = [] self._import_lines = [] @@ -154,7 +154,7 @@ def __init__(self, _all_, pyversion): self._toplevel_names = [] self._classes = [] self._base_classes = [] - self._pyversion = pyversion + self._dialect = dialect def visit_mypy_file(self, o): self._classes = find_classes(o) @@ -470,7 +470,7 @@ def main(): args = sys.argv[1:] sigs = {} class_sigs = {} - pyversion = defaults.PYTHON3_VERSION + dialect = default_implementation().base_dialect while args and args[0].startswith('--'): if args[0] == '--docpath': docpath = args[1] @@ -484,7 +484,7 @@ def main(): sigs = dict(find_unique_signatures(all_sigs)) class_sigs = dict(find_unique_signatures(all_class_sigs)) elif args[0] == '--py2': - pyversion = defaults.PYTHON2_VERSION + dialect = default_implementation(force_py2=True).base_dialect else: raise SystemExit('Unrecognized option %s' % args[0]) args = args[1:] @@ -492,7 +492,7 @@ def main(): usage() for module in args: generate_stub_for_module(module, 'out', add_header=True, sigs=sigs, class_sigs=class_sigs, - pyversion=pyversion) + dialect=dialect) def usage(): diff --git a/mypy/stubutil.py b/mypy/stubutil.py index b2547987abe1a..f7bef2c588029 100644 --- a/mypy/stubutil.py +++ b/mypy/stubutil.py @@ -1,6 +1,8 @@ import re import sys +from mypy.syntax.dialect import default_dialect + def parse_signature(sig): m = re.match(r'([.a-zA-Z0-9_]+)\(([^)]*)\)', sig) @@ -78,13 +80,9 @@ def is_c_module(module): return '__file__' not in module.__dict__ or module.__dict__['__file__'].endswith('.so') -def write_header(file, module_name, pyversion=(3, 5)): +def write_header(file, module_name, dialect=default_dialect()): if module_name: - if pyversion[0] >= 3: - version = '%d.%d' % (sys.version_info.major, - sys.version_info.minor) - else: - version = '2' + version = '%d.%d' % (dialect.major, dialect.minor) file.write('# Stubs for %s (Python %s)\n' % (module_name, version)) file.write( '#\n' diff --git a/mypy/syntax/dialect.py b/mypy/syntax/dialect.py index 81760bfae5448..4fbffb1469809 100644 --- a/mypy/syntax/dialect.py +++ b/mypy/syntax/dialect.py @@ -19,6 +19,7 @@ ) import os +import platform import subprocess import sys @@ -66,6 +67,7 @@ def __init__(self, version: str, future_list: Sequence[str] = []) -> None: `version` is like `'2.7.0'`, e.g. `platform.python_version()`. `future_list` is like `['X', 'Y', 'Z']` in `from __future__ import X, Y, Z`. """ + version = version.rstrip('+') self.major, self.minor, self.patchlevel = [int(x) for x in version.split('.')] future_set = check_futures(version, future_list) self.base_version = version @@ -74,8 +76,15 @@ def __init__(self, version: str, future_list: Sequence[str] = []) -> None: self.possible_futures = {k for (k, v) in available_futures.items() if v <= version} + # Lexer + self.ellipsis = version >= '3.0' or 'mypy-stub' in future_set + + # Parser + + # Additional members will be set as needed by the lexer, parser, etc. + def __repr__(self) -> str: return 'Dialect(%r, %r)' % (self.base_version, self.base_future_list) @@ -97,7 +106,7 @@ def __init__(self, executable: str) -> None: self.executable = executable self.base_dialect = Dialect(version, ['variant-' + impl]) - self.stub_dialect = self.base_dialect.add_future('mypy-codec') + self.stub_dialect = self.base_dialect.add_future('mypy-stub') self.python_path = path # TODO self.stub_path = [] @@ -120,8 +129,14 @@ def default_implementation(*, force_py2: bool = False) -> Implementation: try: impl = Implementation(python) except (OSError, subprocess.CalledProcessError): - pass + continue if force_py2 and impl.base_dialect.major != 2: continue return impl sys.exit('No suitable python executable found') + + +def default_dialect() -> Dialect: + version = platform.python_version() + impl = platform.python_implementation() + return Dialect(version, ['variant-' + impl]) diff --git a/mypy/test/helpers.py b/mypy/test/helpers.py index ddef334801a37..f5bfc2baf08f8 100644 --- a/mypy/test/helpers.py +++ b/mypy/test/helpers.py @@ -4,7 +4,7 @@ from typing import List, Dict, Tuple -from mypy import defaults +from mypy.syntax.dialect import Implementation, default_implementation from mypy.myunit import AssertionFailure from mypy.test import config @@ -239,15 +239,21 @@ def num_skipped_suffix_lines(a1: List[str], a2: List[str]) -> int: return max(0, num_eq - 4) -def testfile_pyversion(path: str) -> Tuple[int, int]: +DEFAULT_IMPLEMENTATION_PYTHON2 = default_implementation(force_py2=True) +DEFAULT_IMPLEMENTATION_PYTHON3 = default_implementation() +assert DEFAULT_IMPLEMENTATION_PYTHON2.base_dialect.major == 2 +assert DEFAULT_IMPLEMENTATION_PYTHON3.base_dialect.major == 3 + + +def testfile_python_implementation(path: str) -> Implementation: if path.endswith('python2.test'): - return defaults.PYTHON2_VERSION + return DEFAULT_IMPLEMENTATION_PYTHON2 else: - return defaults.PYTHON3_VERSION + return DEFAULT_IMPLEMENTATION_PYTHON3 -def testcase_pyversion(path: str, testcase_name: str) -> Tuple[int, int]: +def testcase_python_implementation(path: str, testcase_name: str) -> Implementation: if testcase_name.endswith('python2'): - return defaults.PYTHON2_VERSION + return DEFAULT_IMPLEMENTATION_PYTHON2 else: - return testfile_pyversion(path) + return testfile_python_implementation(path) diff --git a/mypy/test/testcheck.py b/mypy/test/testcheck.py index 4fc83b1411f0a..6054d67d3dafe 100644 --- a/mypy/test/testcheck.py +++ b/mypy/test/testcheck.py @@ -12,7 +12,7 @@ from mypy.test.config import test_temp_dir, test_data_prefix from mypy.test.data import parse_test_cases from mypy.test.helpers import ( - assert_string_arrays_equal, testcase_pyversion, update_testcase_output + assert_string_arrays_equal, testcase_python_implementation, update_testcase_output ) from mypy.test.testsemanal import normalize_error_messages from mypy.errors import CompileError @@ -64,7 +64,7 @@ def cases(self): def run_test(self, testcase): a = [] - pyversion = testcase_pyversion(testcase.file, testcase.name) + implementation = testcase_python_implementation(testcase.file, testcase.name) program_text = '\n'.join(testcase.input) module_name, program_name, program_text = self.parse_options(program_text) try: @@ -72,7 +72,7 @@ def run_test(self, testcase): target=build.TYPE_CHECK, module=module_name, program_text=program_text, - pyversion=pyversion, + implementation=implementation, flags=[build.TEST_BUILTINS], alt_lib_path=test_temp_dir) except CompileError as e: diff --git a/mypy/test/testparse.py b/mypy/test/testparse.py index 56b7523ad4cde..ba309fefa2bd6 100644 --- a/mypy/test/testparse.py +++ b/mypy/test/testparse.py @@ -6,7 +6,7 @@ import typing -from mypy import defaults +from mypy.syntax.dialect import Dialect, default_dialect from mypy.myunit import Suite, AssertionFailure from mypy.test.helpers import assert_string_arrays_equal from mypy.test.data import parse_test_cases @@ -35,12 +35,12 @@ def test_parser(testcase): """ if testcase.file.endswith('python2.test'): - pyversion = defaults.PYTHON2_VERSION + dialect = Dialect('2.7.0') else: - pyversion = defaults.PYTHON3_VERSION + dialect = default_dialect() try: - n = parse(bytes('\n'.join(testcase.input), 'ascii'), pyversion=pyversion, fnam='main') + n = parse(bytes('\n'.join(testcase.input), 'ascii'), dialect=dialect, fnam='main') a = str(n).split('\n') except CompileError as e: a = e.messages diff --git a/mypy/test/testsemanal.py b/mypy/test/testsemanal.py index 0b8050d9941dc..ddd5471670108 100644 --- a/mypy/test/testsemanal.py +++ b/mypy/test/testsemanal.py @@ -6,7 +6,7 @@ from mypy import build from mypy.myunit import Suite -from mypy.test.helpers import assert_string_arrays_equal, testfile_pyversion +from mypy.test.helpers import assert_string_arrays_equal, testfile_python_implementation from mypy.test.data import parse_test_cases from mypy.test.config import test_data_prefix, test_temp_dir from mypy.errors import CompileError @@ -49,7 +49,7 @@ def test_semanal(testcase): result = build.build('main', target=build.SEMANTIC_ANALYSIS, program_text=src, - pyversion=testfile_pyversion(testcase.file), + implementation=testfile_python_implementation(testcase.file), flags=[build.TEST_BUILTINS], alt_lib_path=test_temp_dir) a = [] diff --git a/mypy/test/testtransform.py b/mypy/test/testtransform.py index 86f860544a830..57eaf4b12ec14 100644 --- a/mypy/test/testtransform.py +++ b/mypy/test/testtransform.py @@ -6,7 +6,7 @@ from mypy import build from mypy.myunit import Suite -from mypy.test.helpers import assert_string_arrays_equal, testfile_pyversion +from mypy.test.helpers import assert_string_arrays_equal, testfile_python_implementation from mypy.test.data import parse_test_cases from mypy.test.config import test_data_prefix, test_temp_dir from mypy.errors import CompileError @@ -41,7 +41,7 @@ def test_transform(testcase): result = build.build('main', target=build.SEMANTIC_ANALYSIS, program_text=src, - pyversion=testfile_pyversion(testcase.file), + implementation=testfile_python_implementation(testcase.file), flags=[build.TEST_BUILTINS], alt_lib_path=test_temp_dir) a = []