From 5a12ad096691e5c15e99e70a5ac7b5780d212233 Mon Sep 17 00:00:00 2001 From: David Shea Date: Jan 04 2016 18:22:41 +0000 Subject: Update to the latest git plus one bonus patch: - Don't check git submodule in subprocesses. - Improve check for "# type: ignore". - Add --pdb flag to drop into pdb upon fatal error. - Don't report internal error when using a name that could not be imported. - Write type-checking errors to stdout. Make usage() more complete. - Avoid ever relying on a not-yet-initialized MRO - When comparing template to actual arg types, stop at shortest. - Be more clever about finding a Python 2 interpreter - Basic support for partial 'None' types - Handle multiple None initializers - Remove redundant annotations - Partial type improvements - Allow assignments to function definitions - Document --pdb option. - Look for the keyword type in the right place. --- diff --git a/.gitignore b/.gitignore index b817ea2..f511ef0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /mypy-0.2.0-4167eca.tar.gz /mypy-0.2.0-2736e25.tar.gz +/mypy-0.2.0-5559de4.tar.gz diff --git a/0001-Do-not-install-typing.py.patch b/0001-Do-not-install-typing.py.patch index 58ec139..0ad7781 100644 --- a/0001-Do-not-install-typing.py.patch +++ b/0001-Do-not-install-typing.py.patch @@ -1,7 +1,7 @@ -From aeb1cd67b8dc50be56034f1c39a963bda8ce12d9 Mon Sep 17 00:00:00 2001 +From 9fa8e968afd80f656d76c1c6b1859695e3fc242b Mon Sep 17 00:00:00 2001 From: David Shea Date: Tue, 15 Dec 2015 10:06:52 -0500 -Subject: [PATCH 1/2] Do not install typing.py +Subject: [PATCH 1/3] Do not install typing.py This module is not needed with Python 3.5 --- diff --git a/0002-Look-for-typeshed-in-usr-share.patch b/0002-Look-for-typeshed-in-usr-share.patch index 7b5e247..ac99b84 100644 --- a/0002-Look-for-typeshed-in-usr-share.patch +++ b/0002-Look-for-typeshed-in-usr-share.patch @@ -1,7 +1,7 @@ -From cf1828e1689c4fed1d24922425b80ce49accb062 Mon Sep 17 00:00:00 2001 +From 093f065a9974ef0a8d3698d4338218f6c3d83fd3 Mon Sep 17 00:00:00 2001 From: David Shea Date: Tue, 15 Dec 2015 14:01:55 -0500 -Subject: [PATCH 2/2] Look for typeshed in /usr/share +Subject: [PATCH 2/3] Look for typeshed in /usr/share --- mypy/build.py | 2 +- diff --git a/0003-Fix-1095.-Look-for-the-keyword-type-in-the-right-pla.patch b/0003-Fix-1095.-Look-for-the-keyword-type-in-the-right-pla.patch new file mode 100644 index 0000000..6394c17 --- /dev/null +++ b/0003-Fix-1095.-Look-for-the-keyword-type-in-the-right-pla.patch @@ -0,0 +1,27 @@ +From edb7bf364ecf45d7879c2f4f6cd0b77fff9e0b5a Mon Sep 17 00:00:00 2001 +From: David Shea +Date: Mon, 4 Jan 2016 13:19:43 -0500 +Subject: [PATCH 3/3] Fix #1095. Look for the keyword type in the right place. + +From https://github.com/JukkaL/mypy/issues/1095#issuecomment-166725598 +--- + mypy/checkexpr.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py +index 23d3fa0..7c45cc0 100644 +--- a/mypy/checkexpr.py ++++ b/mypy/checkexpr.py +@@ -542,7 +542,8 @@ class ExpressionChecker: + nodes.ARG_NAMED] and is_duplicate_mapping( + formal_to_actual[i], actual_kinds): + if (self.chk.typing_mode_full() or +- isinstance(actual_type, TupleType)): ++ (i < len(actual_types) and ++ isinstance(actual_types[i], TupleType))): + self.msg.duplicate_argument_value(callee, i, context) + elif (kind == nodes.ARG_NAMED and formal_to_actual[i] and + actual_kinds[formal_to_actual[i][0]] != nodes.ARG_NAMED): +-- +2.6.4 + diff --git a/python3-mypy.spec b/python3-mypy.spec index 434fb6d..4ea857d 100644 --- a/python3-mypy.spec +++ b/python3-mypy.spec @@ -1,9 +1,9 @@ -%global checkout 2736e25 +%global checkout 5559de4 Name: python3-mypy # Last actual version was 0.2.0, which is 7805b2c, continues as 0.2.0_dev Version: 0.2.0 -Release: 1.dev20151220git%{?dist} +Release: 1.dev20160104git%{?dist} Summary: A static type checker for Python %{?python_provide:%python_provide python3-mypy} @@ -11,7 +11,7 @@ Summary: A static type checker for Python # package does not include those files License: MIT URL: https://github.com/JukkaL/mypy -# git archive --prefix=mypy-0.2.0-2736e25/ 2736e25 | gzip -c9 > mypy-0.2.0-2736e25.tar.gz +# git archive --prefix=mypy-0.2.0-5559de4/ 5559de4 | gzip -c9 > mypy-0.2.0-5559de4.tar.gz Source0: mypy-%{version}-%{checkout}.tar.gz # The bundled typing.py is not needed with python 3.5 @@ -21,6 +21,9 @@ Patch0: 0001-Do-not-install-typing.py.patch # bundled version Patch1: 0002-Look-for-typeshed-in-usr-share.patch +# From https://github.com/JukkaL/mypy/issues/1095#issuecomment-166725598 +Patch2: 0003-Fix-1095.-Look-for-the-keyword-type-in-the-right-pla.patch + BuildRequires: python3-devel # Needed to generate the man pages @@ -71,6 +74,23 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{_prefix}/lib/mypy %changelog +* Mon Jan 4 2016 David Shea - 0.2.0-1.dev20160104git +- Don't check git submodule in subprocesses. +- Improve check for "# type: ignore". +- Add --pdb flag to drop into pdb upon fatal error. +- Don't report internal error when using a name that could not be imported. +- Write type-checking errors to stdout. Make usage() more complete. +- Avoid ever relying on a not-yet-initialized MRO +- When comparing template to actual arg types, stop at shortest. +- Be more clever about finding a Python 2 interpreter +- Basic support for partial 'None' types +- Handle multiple None initializers +- Remove redundant annotations +- Partial type improvements +- Allow assignments to function definitions +- Document --pdb option. +- Look for the keyword type in the right place. + * Mon Dec 21 2015 David Shea - 0.2.0-1.dev20151220git - Fix an internal error when updating a partial type from an outer scope diff --git a/sources b/sources index 2a15384..3e04767 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -78ac30675f7abbe9b4baf4842f058a74 mypy-0.2.0-2736e25.tar.gz +8d0e030a53bea7653d3c0e6d75b78a5f mypy-0.2.0-5559de4.tar.gz