Commit Graph

50 Commits

Author SHA1 Message Date
Martin DeMello 60dc2e2408 Clean up the pytype blacklist. (#1851) 2018-02-06 15:41:47 -08:00
gossrock 79e0b94ef1 adding curses.ascii, curses.panel and curses.textpad modules (#1792)
* adding ascii, panal and textpad modules to the curses module.

* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)
2018-01-26 14:39:55 -08:00
Martin DeMello 754789b031 modify pytype_test to run from within pytype too, and support python3 (#1817) 2018-01-22 12:18:58 -08:00
Matthias Kramm 72052d8338 Fix tests to work with newest version of pytype (#1824) 2018-01-12 12:28:19 -08:00
Jelle Zijlstra 6509eee80e add util.pyi to blacklist (#1800) 2017-12-23 11:23:49 -08:00
Sebastian Steenbuck 8b56c1e59a Add all the files which pytype fails on during import. (#1720)
All of these files can not be used with pytype at HEAD. They fail during import with various error messages. Make the test script actually load the files and all dependencies of it, instead of just verifying that it can be parsed.

This list was generated by running pytype with more options.
1: typeshed-location was pointed to the current typeshed instead of the one shipped with pytype.
2: --module-name=<foo> was provided as a parameter. Without this parameter wildcard imports "from _ast import *" misbehave.

Files with a "# parse only" comment will only be parsed and not loaded.
2017-11-15 06:29:07 -08:00
Martin DeMello 817c270c32 Clean out the pytype blacklist (#1667) 2017-10-24 10:38:34 -07:00
hashstat 29473745a8 Implement array.array as a MutableSequence (#1649)
It also improves the type checking of contained values. Some methods
were removed because they are implemented by a base class (i.e.,
*__iter__()*, *__str__()*, and *__contains__()*).  *__hash__()* was
removed because arrays are unhashable types.
2017-10-09 10:12:01 -07:00
Martin DeMello d389ef3d85 Remove a few files from the pytype blacklist. (#1628)
Fixes the following issues:

* Literals rather than ... for default values
* None rather than ... for default value of typed variable
* Literals rather than ... # type for top level constants
* # Foo rather than # type: Foo
* return value of init not set to None
2017-09-27 07:57:13 -07:00
Ethan Smith 8ab207bcee Decrease Mypy concurrent process count (#1618)
Mypy has issues with running its test suite with many processes
concurrently. This should reduce travis test failures, if not completely
resolve failures. See issue https://github.com/python/mypy/issues/3543
2017-09-20 13:01:56 -07:00
Guido van Rossum 04fe184dcf Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy (#1421)
* Add flags to pass on --warn-unused-ignores and --no-implicit-optional to mypy
* Make implicit Optional explicit in arg types (2and3 part)
* Convert {stdlib,third_party}/2 to explicit Optional
2017-06-20 22:18:49 -07:00
Ethan Smith be80c36816 fix mypy_selftest (#1369)
Related to python/mypy#3337.
2017-05-28 23:30:54 -07:00
Matthias Kramm ac0b809bf5 tweak files to fix pytype parsing errors (#1325)
* Don't use "\" to join lines
2017-05-26 08:45:52 -07:00
Jelle Zijlstra 728b977729 Replace a number of default argument values with "..." (#1280)
pytype apparently doesn't like default values that aren't ints or
None/True/False.
2017-05-21 14:31:22 -07:00
Mahmoud Afaneh 3896298027 Add multiprocessing.context stubs (#1260) 2017-05-20 23:13:18 -07:00
Matthias Kramm d7d27647a9 also run pytype tests for Python 3 modules (#1278) 2017-05-20 09:10:14 -07:00
Jelle Zijlstra 3101768f12 drop 3.2 (#1213)
Closes #1145.
2017-04-25 17:15:49 -07:00
Jelle Zijlstra e50fcaf658 add mypy_selftest.py (#1102)
* add mypy_selftest.py
* add selftest to Travis
2017-04-17 11:17:27 -07:00
rchen152 2c54640dce Remove types.pyi from the pytype blacklist. (#1162)
* Fix a few return types in stdlib/2/inspect.pyi.

* Rename _FrameRecord to _FrameInfo

* Correct some return types in itertools.pyi from Iterable to Iterator.

* Change types.pyi syntax that pytype can't parse.

* Remove types.pyi from the pytype blacklist.
2017-04-14 15:14:20 -07:00
David Fisher 2861674784 Remove unnecessary --fast-parser flag to mypy (#977)
It's now on by default, and the flag will eventually be removed.
2017-03-07 15:01:17 -08:00
Alvaro Caceres f87dde0d1b Remove webbrowser.pyi from pytype blacklist (#963) 2017-03-01 11:45:05 -08:00
Guido van Rossum 231f00d7da Fix boto stubs.
Replace two `FIXME` comments with `type: ignore`.
See https://github.com/python/mypy/issues/1237.
2016-12-24 09:06:38 -08:00
Lukasz Langa 4084296f3f Exclude boto from tests due to broken Liskov Substitution Principle
Starting with python/mypy#2521 mypy is performing stricter function signature
checks.

This makes the stubs diverge from the actual implementation but makes the stubs
internally consistent.  Since this is an actual typing issue in the base
implementation, we need to defer to the original authors to fix it.

Sadly, in this case the breakage is rather fundamental and unlikely to get
fixed by upstream. Consider:

```
  class AWSAuthConnection(object):
    def make_request(self, method, path, headers=None, data='', host=None,
      auth_path=None, sender=None, override_num_retries=None,
      params=None, retry_handler=None): ...

  class AWSQueryConnection(AWSAuthConnection):
    def make_request(self, action, params=None, path='/', verb='GET'): ...
```

Hence, until we have a workaround for the error produced by Mypy, we're
excluding those stubs from being tested against.
2016-12-22 15:54:20 -08:00
Lukasz Langa 8c5c788a4d Enable flake8-pyi plugin to automatically include *.pyi files
This simplifies running flake8 tests and reduces the amount of F821 errors
reported (flake8-pyi enables support for forward references in *.pyi files).
The error code is left disabled until I clean up the remaining issues.
2016-12-21 00:56:01 -08:00
Lukasz Langa 79d8757f1f Enable flake8 tests
Ran both by Travis and locally. There's some setup required, README updated.
A few important Flake8 checks are still disabled, we're going to enable them as
soon as the stubs are fixed and we can reliably run Flake8 locally with Python
3.6.
2016-12-20 04:07:44 -08:00
Matthias Kramm a2559eeaeb make pytype aware that 2.7/ has been renamed to 2/ (#729) 2016-12-02 06:10:14 -08:00
Lukasz Langa ab4ad3fe9d Make tests run with 3.6 --fast-parser, too 2016-11-26 20:17:28 -08:00
Matthias Kramm 94d3ddb60a change the way 'os' imports 'os.path' (#601)
* use 'from . import path' instead, in both PY2 and PY3
* update blacklist to include os/__init__.pyi
2016-10-17 17:49:12 -07:00
Guido van Rossum a353aabbcd Add commented-out flag to use --fast-parser. 2016-09-15 16:49:56 -07:00
Guido van Rossum d131efcaa0 Skip "module" whose name starts with ".". 2016-09-15 16:20:28 -07:00
Matthias Kramm 7a7873aa94 adjust pytype blacklist (#529)
Remove argparse, tarfile and logging/handlers.
2016-09-09 12:28:54 -07:00
Matthias Kramm e70be5fbe2 trim pytype testing blacklist (#527) 2016-09-09 06:30:36 -07:00
Valérian Rousset 1d5b35b2a5 Merge tarfile (#467) 2016-09-03 08:40:45 -07:00
Matthias Kramm 044d11f9ee clean up unittest.py (#509)
* clean up unittest.py

Remove duplicates, adjust wrapping.

* also remove unittest from pytype blacklist
2016-08-31 07:27:53 -07:00
Matthias Kramm c46993aa8e Add mypy blacklist, same syntax as pytype blacklist. (#508) 2016-08-29 14:23:39 -07:00
Valérian Rousset 2c21f27310 Add plistlib (#433)
* py3 done

* py2 done

* fix by matthiaskramm

* remove plistlib from pytype checking

* add unicode for path in py2

* add readPlistFromString (and write) in py2
2016-08-02 14:52:26 -07:00
Alvaro Caceres e60c3de954 Update pytype blacklist. (#430)
Broke travis with recent pytype push
2016-08-02 07:45:46 -07:00
Alvaro Caceres 4c20cd6711 2and3/mmap.pyi : remove "type: ignore" (#425)
First was for mypy compatibility, but is no longer needed.

Second is removed by going inheriting (Iterable[bytes],
Container[bytes], Sized, Reversible[bytes]) instead of
Sequence[bytes]. Should presumably catch more errors when using __getattr__
2016-08-01 14:20:37 -07:00
Alvaro Caceres f72afd0ad1 Update pytype blacklist (#422) 2016-07-29 15:45:09 -07:00
Alvaro Caceres b968bfcb1c Update pytype test blacklist (#411) 2016-07-27 15:43:48 -07:00
Guido van Rossum 39325bf159 Mypy now supports sys.platform and sys.version_info checks (#410) 2016-07-27 13:25:29 -07:00
alvarocaceres f7b35bc8be Remove line continuations to help pytype parse (#390) 2016-07-22 10:55:42 -07:00
alvarocaceres e02332a787 Misc. changes to help pytype parse typeshed (#382) 2016-07-21 13:08:12 -07:00
alvarocaceres c1b12970f6 Change empty string literals to ellipsis (#377)
For pytype compatibility
2016-07-20 10:57:32 -07:00
alvarocaceres ac5916c170 Tweak version tests to help pytype parse them (#374) 2016-07-19 07:43:35 -07:00
Matthias Kramm 395265b9fb trim blacklist (#370)
Remove files that now work with pytype from blacklist.
2016-07-15 10:17:47 -07:00
Valérian Rousset 8ef221c162 add zipfile for py2 (#345) 2016-07-15 05:55:20 -07:00
Guido van Rossum f47ff0b966 Add --strict-optional flag to mypy (#368) 2016-07-13 17:50:36 +01:00
Alvaro Caceres 67ccb1b450 revert unnecessary change to mypy_test from previous commit 2016-07-12 18:46:09 -05:00
alvarocaceres 63cbe2dc3c Refactor how test are run, add tests to exercise pytype (if installed) (#353) 2016-07-12 15:30:54 -07:00