Commit Graph

266 Commits

Author SHA1 Message Date
Sebastian Rittau
2a36b4cf01 Move asyncio from 3.4 to 3 (#2307) 2018-07-03 09:06:04 -07:00
Sebastian Rittau
9229dd8f0c Merge stdlib/3.4 into stdlib/3 (#2303)
* Merge stdlib/3.4 into stdlib/3

* Move asyncio back to 3.4 for now
2018-07-03 08:13:54 -07:00
Sebastian Rittau
7ebd609643 Add pyexpat and xml.parsers (#2276) 2018-06-28 10:26:17 -07:00
Sebastian Rittau
fa74160e1f Drop support for Python 3.3 (#2258)
Closes #2257.
2018-06-19 15:37:13 -07:00
Jelle Zijlstra
c06a718c5b always run mypy with --no-implicit-optional (#2242)
This was already the configuration in Travis and it's been working fine. It's
confusing that Travis was using a different configuration than the default
when you run tests/mypy_test.py yourself.
2018-06-15 21:34:14 -07:00
Jelle Zijlstra
499f852e37 add --show-traceback to mypy_test.py flags (#2236)
This makes debugging easier.
2018-06-15 16:46:59 -07:00
Daniel Li
5054465746 Make concurrent.futures stubs identical (#2237)
Make the Python 2 and 3 concurrent.futures stubs identical so fixes get
applied to both.

For example, #1305 and #2233 fixed the same problem at different times,
as did #1078 and #1911.

By making the stubs identical, we apply the fix from #1711 to Python 2.

Fixes #2234.
2018-06-15 10:03:19 -07:00
Rebecca Chen
ff821f9751 Update pytype_test and pytype_blacklist (#2225)
* Add parts of third_party/ to pytype_test.

Pytype uses six and mypy_extensions, so these pyi files should be
tested with pytype.

* Remove newly loadable pyi files from pytype_blacklist.
2018-06-15 07:53:17 -07:00
Martin DeMello
caff008ff2 test files under stdlib/2and3 with both python versions (#2222)
* test files under stdlib/2and3 with both python versions
2018-06-12 15:48:00 -07:00
Jelle Zijlstra
cd4a5ff65c use pytype-single rather than pytype (#2198)
Looks like this happened in 3de774361b.
2018-06-05 08:34:21 -07:00
Robert Collins
98badb6eff Fix mock patch.dict stub and add mock stub (#2173)
The dict stub was referring to an instance, not the type, leading to
__call__ being considered when using as a decorator, rather than
__init__.

mock is a backport of the stdlib module and should be defined the same.
2018-05-31 21:45:54 -07:00
Jelle Zijlstra
b89f9553e9 keep os.path in 2 and 3 consistent (#2152)
We can't merge these because os/__init__ is still different.

Also slight refactor of tests/check_consistent.py to avoid `from os import path`.
2018-05-22 07:14:13 -07:00
Ethan Smith
e9600db2ec Remove symlinks! (#2132) 2018-05-15 15:18:59 -04:00
Jelle Zijlstra
81a6ea43a5 try using --no-site-packages (#2036)
Fixes #2035.
2018-04-09 12:55:18 -07:00
Martin DeMello
b0d5a2100e add progress monitoring (#1945) 2018-03-08 15:37:45 -08:00
Jelle Zijlstra
ab72267669 also test 3.7 with mypy (#1917) 2018-02-24 09:56:35 -08:00
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