From fbd81012d916672369a1bcb3e82469c4fef75283 Mon Sep 17 00:00:00 2001 From: David Shea Date: May 19 2016 15:52:29 +0000 Subject: Update to mypy 0.4.1 --- diff --git a/.gitignore b/.gitignore index e03b83e..0278594 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /mypy-0.2.0-4127a66.tar.gz /mypy-0.2.0-9befcc7.tar.gz /mypy-lang-0.3.1.tar.gz +/mypy-lang-0.4.1.tar.gz diff --git a/0001-Look-for-typeshed-in-usr-share.patch b/0001-Look-for-typeshed-in-usr-share.patch index 439050d..488dc18 100644 --- a/0001-Look-for-typeshed-in-usr-share.patch +++ b/0001-Look-for-typeshed-in-usr-share.patch @@ -1,4 +1,4 @@ -From 7cdf652eaee801639aac39527305e256dcf65515 Mon Sep 17 00:00:00 2001 +From 8a7f0e201878777c9513928f2fc232b245efe681 Mon Sep 17 00:00:00 2001 From: David Shea Date: Tue, 15 Dec 2015 14:01:55 -0500 Subject: [PATCH 1/2] Look for typeshed in /usr/share @@ -10,11 +10,11 @@ Skip installing the bundled typeshed 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mypy/build.py b/mypy/build.py -index 4d01c5d..9f01b23 100644 +index d37dc78..327c441 100644 --- a/mypy/build.py +++ b/mypy/build.py -@@ -233,7 +233,7 @@ def default_data_dir(bin_dir: str) -> str: - return os.path.dirname(bin_dir) +@@ -257,7 +257,7 @@ def default_data_dir(bin_dir: str) -> str: + return dir elif base == 'bin': # Installed to somewhere (can be under /usr/local or anywhere). - return os.path.join(dir, 'lib', 'mypy') @@ -23,7 +23,7 @@ index 4d01c5d..9f01b23 100644 # Assume we installed python3 with brew on os x return os.path.join(os.path.dirname(dir), 'lib', 'mypy') diff --git a/setup.py b/setup.py -index 89554a6..da62c0d 100644 +index 69cbfb2..570830a 100644 --- a/setup.py +++ b/setup.py @@ -53,8 +53,6 @@ def find_data_files(base, globs): @@ -36,5 +36,5 @@ index 89554a6..da62c0d 100644 classifiers = [ -- -2.7.1 +2.8.2 diff --git a/0002-Canonicalize-bin_dir-when-looking-for-data_dir.patch b/0002-Canonicalize-bin_dir-when-looking-for-data_dir.patch index 937b94d..8a898bd 100644 --- a/0002-Canonicalize-bin_dir-when-looking-for-data_dir.patch +++ b/0002-Canonicalize-bin_dir-when-looking-for-data_dir.patch @@ -1,4 +1,4 @@ -From 6701ebf1208d5b129d83999dab4ea792c4f60c35 Mon Sep 17 00:00:00 2001 +From bf379518a15c340a0989f7e00eac99d64e94a428 Mon Sep 17 00:00:00 2001 From: David Shea Date: Thu, 7 Jan 2016 10:02:27 -0500 Subject: [PATCH 2/2] Canonicalize bin_dir when looking for data_dir. @@ -10,11 +10,11 @@ in /usr instead of /. 1 file changed, 4 insertions(+) diff --git a/mypy/build.py b/mypy/build.py -index 9f01b23..d79d0f5 100644 +index 327c441..320a363 100644 --- a/mypy/build.py +++ b/mypy/build.py -@@ -222,6 +222,10 @@ def default_data_dir(bin_dir: str) -> str: - return os.path.join(lib, 'mypy') +@@ -246,6 +246,10 @@ def default_data_dir(bin_dir: str) -> str: + return subdir # Default to directory containing this file's parent. return parent + @@ -25,5 +25,5 @@ index 9f01b23..d79d0f5 100644 dir = os.path.dirname(bin_dir) if (sys.platform == 'win32' and base.lower() == 'scripts' -- -2.7.1 +2.8.2 diff --git a/LICENSE b/LICENSE index bb6620a..131d386 100644 --- a/LICENSE +++ b/LICENSE @@ -27,7 +27,7 @@ DEALINGS IN THE SOFTWARE. = = = = = Portions of mypy are licensed under different licenses. The files -under lib-python and lib-typing/3.2 are licensed under the PSF 2 +under stdlib-samples and lib-typing are licensed under the PSF 2 License, reproduced below. = = = = = @@ -225,4 +225,4 @@ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -= = = = = \ No newline at end of file += = = = = diff --git a/README.md b/README.md index ce317f7..00d548b 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,16 @@ What is mypy? ------------- 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 +hints to your Python programs using the standard for type +annotations introduced in Python 3.5 (PEP 484), and use mypy to type check them statically. Find bugs in your programs without even running them! -The type annotation notation has also been backported to earlier -Python 3.x versions. Mypy programs are valid Python 3.x and you use a -normal Python interpreter to run them. There is essentially no -performance overhead when using mypy, since mypy does not introduce -runtime type checking. +The type annotation standard has also been backported to earlier +Python 3.x versions. Mypy supports Python 3.2 and later. + +For Python 2.7, you can add annotations as comments (this is also +specified in PEP 484). You can mix dynamic and static typing in your programs. You can always fall back to dynamic typing when static typing is not convenient, such @@ -63,8 +63,7 @@ Mypy can be installed using pip: *Note that the package name is `mypy-lang`, not `mypy`.* -Currently, the version of mypy on PYPI is not compatible with Python 3.5. -If you run Python 3.5 install directly form git: +If you want to run the latest version of the code, you can install from git: $ pip3 install git+git://github.com/python/mypy.git @@ -87,6 +86,10 @@ Documentation and additional information is available at the web site: http://www.mypy-lang.org/ +Or you can jump straight to the documentation: + + http://mypy.readthedocs.io/ + Troubleshooting --------------- @@ -134,7 +137,7 @@ see "Troubleshooting" above. The mypy wiki contains some useful information for contributors: - http://www.mypy-lang.org/wiki/DeveloperGuides + https://github.com/python/mypy/wiki/Developer-Guides Working with the git version of mypy ------------------------------------ @@ -177,11 +180,13 @@ filters: If you want to run individual unit tests, you can run `myunit` directly, or pass inferior arguments via `-a`: - $ scripts/myunit -m mypy.test.testlex -v '*backslash*' + $ PYTHONPATH=$PWD scripts/myunit -m mypy.test.testlex -v '*backslash*' $ ./runtests.py mypy.test.testlex -a -v -a '*backslash*' You can also run the type checker for manual testing without -installing anything by setting up the Python module search path suitably: +installing anything by setting up the Python module search path +suitably (the lib-typing/3.2 path entry is not needed for Python 3.5 +or when you have manually installed the `typing` module): $ export PYTHONPATH=$PWD:$PWD/lib-typing/3.2 $ python -m mypy PROGRAM.py @@ -202,6 +207,19 @@ To run the linter: $ ./runtests.py lint +Coverage reports +---------------- + +There is an experimental feature to generate coverage reports. To use +this feature, you need to `pip install lxml`. This is an extension +module and requires various library headers to install; on a +Debian-derived system the command + apt-get install python3-dev libxml2-dev libxslt1-dev +may provide the necessary dependencies. + +To use the feature, pass e.g. `--txt-report "$(mktemp -d)"`. + + Development status ------------------ @@ -241,6 +259,8 @@ highly appreciated and useful to the project. Contact the developers to join the project, or just start coding and send pull requests! There are tasks for contributors of all experience levels. +For more details, see the file [CONTRIBUTING.md](CONTRIBUTING.md). + License ------- diff --git a/python3-mypy.spec b/python3-mypy.spec index f35beb2..f820e1c 100644 --- a/python3-mypy.spec +++ b/python3-mypy.spec @@ -1,6 +1,6 @@ Name: python3-mypy # Last actual version was 0.2.0, which is 7805b2c, continues as 0.2.0_dev -Version: 0.3.1 +Version: 0.4.1 Release: 1 Summary: A static type checker for Python %{?python_provide:%python_provide python3-mypy} @@ -76,6 +76,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} \ %{_prefix}/lib/mypy %changelog +* Tue May 17 2016 David Shea - 0.4.1-1 +- Update to mypy 0.4.1 + * Mon Feb 22 2016 David Shea - 0.3.1-1 - Update to the first post-3.5 actual upstream release diff --git a/sources b/sources index d90011c..14400ba 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ef35f7fb86f4a8fca9b7292d0b03a443 mypy-lang-0.3.1.tar.gz +9e20367f11e3fc0194c03b350ba5e611 mypy-lang-0.4.1.tar.gz