From 4be7ba44f88ecb46988478abddc654bdc77b5ca7 Mon Sep 17 00:00:00 2001 From: David Shea Date: Dec 18 2015 19:13:14 +0000 Subject: Initial package import --- diff --git a/.gitignore b/.gitignore index e69de29..26b3288 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/mypy-0.2.0-4167eca.tar.gz diff --git a/0001-Do-not-install-typing.py.patch b/0001-Do-not-install-typing.py.patch new file mode 100644 index 0000000..58ec139 --- /dev/null +++ b/0001-Do-not-install-typing.py.patch @@ -0,0 +1,26 @@ +From aeb1cd67b8dc50be56034f1c39a963bda8ce12d9 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 + +This module is not needed with Python 3.5 +--- + setup.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 7ac47a7..8687c58 100644 +--- a/setup.py ++++ b/setup.py +@@ -78,7 +78,7 @@ setup(name='mypy-lang', + url='http://www.mypy-lang.org/', + license='MIT License', + platforms=['POSIX'], +- package_dir={'': 'lib-typing/3.2', 'mypy': 'mypy'}, ++ package_dir={'mypy': 'mypy'}, + py_modules=['typing'], + packages=['mypy'], + scripts=['scripts/mypy', 'scripts/stubgen'], +-- +2.6.4 + diff --git a/0002-Look-for-typeshed-in-usr-share.patch b/0002-Look-for-typeshed-in-usr-share.patch new file mode 100644 index 0000000..7b5e247 --- /dev/null +++ b/0002-Look-for-typeshed-in-usr-share.patch @@ -0,0 +1,25 @@ +From cf1828e1689c4fed1d24922425b80ce49accb062 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 + +--- + mypy/build.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mypy/build.py b/mypy/build.py +index 11705df..2c54225 100644 +--- a/mypy/build.py ++++ b/mypy/build.py +@@ -221,7 +221,7 @@ def default_data_dir(bin_dir: str) -> str: + 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') ++ return os.path.join(dir, 'share') + elif base == 'python3': + # Assume we installed python3 with brew on os x + return os.path.join(os.path.dirname(dir), 'lib', 'mypy') +-- +2.6.4 + diff --git a/python3-mypy.spec b/python3-mypy.spec new file mode 100644 index 0000000..64d81ca --- /dev/null +++ b/python3-mypy.spec @@ -0,0 +1,74 @@ +%global checkout 4167eca + +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.dev20151217git%{?dist} +Summary: A static type checker for Python +%{?python_provide:%python_provide python3-mypy} + +# The files under lib-python and lib-typing/3.2 are Python-licensed, but this +# package does not include those files +License: MIT +URL: https://github.com/JukkaL/mypy +# git archive --prefix=mypy-0.2.0-4167eca/ 4167eca | gzip -c9 > mypy-0.2.0-4167eca.tar.gz +Source0: mypy-%{version}-%{checkout}.tar.gz + +# The bundled typing.py is not needed with python 3.5 +Patch0: 0001-Do-not-install-typing.py.patch + +# Change the search for data_dir to use Fedora's typeshed package instead of a +# bundled version +Patch1: 0002-Look-for-typeshed-in-usr-share.patch + +BuildRequires: python3-devel + +# Needed to generate the man pages +BuildRequires: help2man + +Requires: python-typeshed + +BuildArch: noarch + +%description +Mypy is an optional static type checker for Python. You can add type +hints to your Python programs using the upcoming standard for type +annotations introduced in Python 3.5 beta 1 (PEP 484), and use mypy to +type check them statically. Find bugs in your programs without even +running them! + +%prep +%autosetup -n mypy-%{version}-%{checkout} -p1 + +%build %py3_build + +%install +%py3_install + +# Generate man pages +mkdir -p %{buildroot}%{_mandir}/man1 +PYTHONPATH=%{buildroot}%{python3_sitelib} \ + help2man --no-info --version-string 'mypy %{version}-dev' \ + --no-discard-stderr -o %{buildroot}%{_mandir}/man1/mypy.1 \ + %{buildroot}%{_bindir}/mypy + +PYTHONPATH=%{buildroot}%{python3_sitelib} \ + help2man --no-info --version-string 'mypy stubgen %{version}-dev' \ + --no-discard-stderr -o %{buildroot}%{_mandir}/man1/stubgen.1 \ + %{buildroot}%{_bindir}/stubgen + +%files +%doc README.md CREDITS +%license LICENSE +%{python3_sitelib}/mypy +%{python3_sitelib}/mypy_lang-*.egg-info +%{_bindir}/mypy +%{_bindir}/stubgen +%{_mandir}/man1/mypy.1* +%{_mandir}/man1/stubgen.1* +# distutils insists on putting data_files in /usr/lib, so just go with it +%{_prefix}/lib/mypy + +%changelog +* Thu Dec 17 2015 David Shea - 0.2.0-1.dev20151217git +- Initial package diff --git a/sources b/sources index e69de29..05de58b 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +7f81cca6d0718ec9b97d3a570905e9aa mypy-0.2.0-4167eca.tar.gz