From c440ca53bbf38e349eeed88d09df9f7377500413 Mon Sep 17 00:00:00 2001 From: David Shea Date: Jan 07 2016 15:11:13 +0000 Subject: Fix a bug in the discovery of the typeshed files --- diff --git a/0001-Do-not-install-typing.py.patch b/0001-Do-not-install-typing.py.patch index 0ad7781..921b088 100644 --- a/0001-Do-not-install-typing.py.patch +++ b/0001-Do-not-install-typing.py.patch @@ -1,7 +1,7 @@ -From 9fa8e968afd80f656d76c1c6b1859695e3fc242b Mon Sep 17 00:00:00 2001 +From 1c9e9abb0200d60399d3587d2e9d070d4ede4381 Mon Sep 17 00:00:00 2001 From: David Shea Date: Tue, 15 Dec 2015 10:06:52 -0500 -Subject: [PATCH 1/3] Do not install typing.py +Subject: [PATCH 1/4] 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 ac99b84..a3ebc6f 100644 --- a/0002-Look-for-typeshed-in-usr-share.patch +++ b/0002-Look-for-typeshed-in-usr-share.patch @@ -1,7 +1,7 @@ -From 093f065a9974ef0a8d3698d4338218f6c3d83fd3 Mon Sep 17 00:00:00 2001 +From 80d4b998898c7ab308ae07ff7ee6e0b020f6d172 Mon Sep 17 00:00:00 2001 From: David Shea Date: Tue, 15 Dec 2015 14:01:55 -0500 -Subject: [PATCH 2/3] Look for typeshed in /usr/share +Subject: [PATCH 2/4] 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 index 6394c17..2fbff6f 100644 --- 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 @@ -1,7 +1,7 @@ -From edb7bf364ecf45d7879c2f4f6cd0b77fff9e0b5a Mon Sep 17 00:00:00 2001 +From fddb3482039c6fb23fd223ffa1976483209a72db 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. +Subject: [PATCH 3/4] Fix #1095. Look for the keyword type in the right place. From https://github.com/JukkaL/mypy/issues/1095#issuecomment-166725598 --- diff --git a/0004-Canonicalize-bin_dir-when-looking-for-data_dir.patch b/0004-Canonicalize-bin_dir-when-looking-for-data_dir.patch new file mode 100644 index 0000000..bd97edc --- /dev/null +++ b/0004-Canonicalize-bin_dir-when-looking-for-data_dir.patch @@ -0,0 +1,29 @@ +From c12dedd6d7934ca1698a66f848cd057bbf10bbee Mon Sep 17 00:00:00 2001 +From: David Shea +Date: Thu, 7 Jan 2016 10:02:27 -0500 +Subject: [PATCH 4/4] Canonicalize bin_dir when looking for data_dir. + +This way calling mypy as /bin/mypy will look for the data dir starting +in /usr instead of /. +--- + mypy/build.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/mypy/build.py b/mypy/build.py +index 2c54225..76c3326 100644 +--- a/mypy/build.py ++++ b/mypy/build.py +@@ -210,6 +210,10 @@ def default_data_dir(bin_dir: str) -> str: + if not bin_dir: + # Default to directory containing this file's parent. + return os.path.dirname(os.path.dirname(__file__)) ++ ++ # Canonicalize the path in case bin_dir is a symlink ++ bin_dir = os.path.realpath(bin_dir) ++ + base = os.path.basename(bin_dir) + dir = os.path.dirname(bin_dir) + if (sys.platform == 'win32' and base.lower() == 'scripts' +-- +2.6.4 + diff --git a/python3-mypy.spec b/python3-mypy.spec index 4ea857d..c8a06d3 100644 --- a/python3-mypy.spec +++ b/python3-mypy.spec @@ -3,7 +3,7 @@ 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.dev20160104git%{?dist} +Release: 1.dev20160104git.1%{?dist} Summary: A static type checker for Python %{?python_provide:%python_provide python3-mypy} @@ -24,6 +24,9 @@ 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 +# patch 2 breaks the data dir lookup when called as /bin/mypy instead of /usr/bin/mypy +Patch3: 0004-Canonicalize-bin_dir-when-looking-for-data_dir.patch + BuildRequires: python3-devel # Needed to generate the man pages @@ -74,6 +77,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{_prefix}/lib/mypy %changelog +* Thu Jan 7 2016 David Shea - 0.2.0-1.dev20160104git.1 +- Fix a bug in the discovery of the typeshed files + * Mon Jan 4 2016 David Shea - 0.2.0-1.dev20160104git - Don't check git submodule in subprocesses. - Improve check for "# type: ignore".