103 Commits

Author SHA1 Message Date
Sebastian Rittau
66778639a5 Run CI tests against win32 and darwin platform (#3457)
Also use Python 3.8 as default Python version for tests
2019-11-11 07:52:11 -08:00
Rune Tynan
b112c20dad Copyreg stubs (#3387) 2019-10-29 19:52:05 -07:00
Rune Tynan
6058c23136 Make path separator based on OS separator (#3375) 2019-10-16 10:12:45 -07:00
Sebastian Rittau
6507875f28 Annotate Python 3.8 removals (#3359)
* macpath
* time.clock()
* Some cgi functions
* XMLParser(html) and doctype()
* unicode_internal
* Two sqlite3 classes hidden
* fileinput bufsize arg
* Treeview.selection no longer takes arguments
2019-10-14 09:51:39 +02:00
Vasily Zakharov
57384ce033 Revised stubs for geoip2 third party library (#3317) 2019-10-09 19:28:42 -07:00
Sebastian Rittau
c32e1e2280 Enable --disallow-any-generics for stubs (#3288) 2019-10-01 05:31:34 -07:00
Guido van Rossum
95185fa9cf Improve the explanatory comment at the top of check_consistent.py 2019-09-29 09:23:11 -07:00
Sebastian Rittau
9ccf9356bf Remove Python 3.4 support (#3147)
Closes #3123
2019-07-27 10:58:21 +02:00
Rebecca Chen
c356316c6f Use pytype.config.Options.create() for prettier code. (#3151)
This is a small cosmetic change. I want to encourage use of the
nicer-lookng pytype.config.Options.create() rather than
direct construction of the command-line args, so I'm changing
over all occurrences of the latter that I can find.
2019-07-25 19:43:33 -07:00
Sebastian Rittau
b20e5b6c14 Travis: run mypy with Python 3.8 as well (#3146)
This runs mypy both with Python 3.7 and 3.8. In Python 3.8,
mypy switched from using typed-ast to using Python's built-in ast.
This patch ensures that both are tested.
2019-07-25 07:43:52 -07:00
Sebastian Rittau
09d1055cd3 Remove mypy new analyzer tests (#3128)
Now that the new analyzer is the default, this does exactly the same
as the normal mypy self test.
2019-07-18 17:02:12 +02:00
Eric Arellano
1763f51c0d Refactor tests/pytype_test.py (#3065) 2019-06-19 15:19:10 -07:00
Ivan Levkivskyi
61eb99664b Add new semantic analyzer to mypy tests (#3037)
This also removes two redundant definitions in curses/__init__.pyi star-imported from _curses.
2019-06-07 16:49:57 +01:00
Rebecca Chen
78982de5be Remove all pyi files that use nested classes from the pytype blacklist. (#2993)
We finally support this!
2019-05-15 14:53:13 -07:00
Jelle Zijlstra
cd9b7158ec fix CI (#2992) 2019-05-15 14:20:08 -07:00
Rebecca Chen
5799b8dfcf Unblacklist more third_party stubs from pytype parsing. (#2975) 2019-05-08 20:18:08 -07:00
Rebecca Chen
4990830c8f Make pytype happy with the third_party click stubs. (#2966)
This also makes the flask stubs that depend on click parseable.

* In pytype_test, only parse files with the .pyi extension.
  (There's a README in third_party/2and3/click/.)
* Annotate with ContextManager rather than using the
  contextmanager decorator. This is shorter, removes a
  dependency, and gets rid of the slight weirdness of a
  decorator needing to be evaluated in a stub.
* Fix non-stub things.
2019-05-07 08:50:24 +02:00
Rebecca Chen
a6d92eca10 Adjust indentation of TODOs in third_party/2/gflags.pyi. (#2964)
Having TODOs at a different level of indentation than
the surrounding lines trips up pytype.
2019-05-06 22:05:17 -04:00
Rebecca Chen
7c475a48d7 Fix typo: __builtins__ should be __builtin__. (#2963) 2019-05-06 22:00:02 -04:00
Rebecca Chen
1379fdcdd9 Remove some files from pytype's third_party blacklist. (#2962)
Removes files that are parseable with the most recent release.
2019-05-06 21:59:12 -04:00
Rebecca Chen
5081d1e132 Switch pytype_test from a whitelist to a blacklist for third_party. (#2956)
During the PyCon sprints, I'm planning to bash the pytype pyi
parser into shape so we can handle all of third_party. As a first
step, create an explicit blacklist of everything pytype chokes on.
2019-05-05 22:02:52 -04:00
Rebecca Chen
a651e2f3cd Update pytype_test to remove now-unnecessary parse-only functionality. (#2897)
With today's release, pytype is able to fully load
stdlib/3/collections/__init__.pyi, so the test no longer needs the
ability to partially parse stubs using the pytd tool. Removing this
functionality allows the test code to be simplified considerably.
2019-04-03 12:47:20 -07:00
Rebecca Chen
4743d2521a Remove asyncio.tasks from the pytype blacklist. (#2874)
With version 2019.03.15, pytype is able to parse this file.
2019-03-16 09:35:30 +01:00
Rebecca Chen
45e52de188 Speed up pytype_test by reducing subprocess calls. (#2868)
Speeds up pytype considerably by directly calling pytype.io.parse_pyi
rather than running `pytype --parse-pyi` in a subprocess.
The subprocess logic is still required to handle the one pyi file
marked `# parse only` in the pytype blacklist. Once
https://github.com/google/pytype/issues/242 is fixed, the test code
can be cleaned up considerably.
2019-03-14 19:04:40 -07:00
Rebecca Chen
3f8c08402d Remove an unnecessary entry from the pytype blacklist. (#2799) 2019-02-15 17:33:29 -08:00
Sebastian Rittau
eb1788ac39 Merge Python 2 and 3 builtins.pyi (#2533) 2018-12-21 07:12:41 -08:00
Dave Halter
5c69373890 macpath, os/path, posixpath and ntpath should basically be the same files (#2637) 2018-12-17 15:02:18 +01:00
Sebastian Rittau
ece96777a7 Re-export pyexpat instead of using check_consistency (#2649) 2018-11-29 07:29:59 -08:00
Sebastian Rittau
e3a79d0ce6 Remove third_party/3/enum.py (#2563)
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.

Make the third-party Python 2 version consistent with the Python 3 version.
2018-10-27 08:54:56 -07:00
Sebastian Rittau
f07bdf418b Fix pytype test output (#2534) 2018-10-22 09:14:22 +02:00
Rebecca Chen
eb09e2898b Update pytype_test to be easier to run manually. (#2469)
* Moves the pytype installation to requirements-tests-py3.txt, now
  that pytype can run under Python 3.5+.
* Changes tests/pytype_test.py to not require a --python{version}-exe
  argument when it can automatically find the Python interpreter, and
  cleans up a few typos and out-of-date things.
* Updates the appropriate documentation.
* Updates .travis.yml.
2018-09-21 09:38:33 -07:00
Rebecca Chen
a08c6eae23 Add two more third_party libraries to pytype_test. (#2437) 2018-09-07 23:42:24 -07:00
Jelle Zijlstra
6f62466d6f fix selftest (#2425)
Now that the typeshed submodule has moved.
2018-09-03 10:35:20 -07:00
stevenjackson121
80a0a75f5f Add stubs for contextvars backport (3.5 and 3.6) (#2378)
* Add stubs for contextvars backport (3.5 and 3.6)

* Add contextvars to tests/check_consistent.py
2018-08-14 08:05:02 -07:00
Daniel Li
631d2768d6 Add stub for pathlib2 on Python 2.7 (#2351)
pathlib2 is the Python 2.7 backport of the pathlib module from Python 3.
Hence we use the same stub file for both.

The maintainer of pathlib2 granted permission for stubs to be added in
mcmtroffaes/pathlib2#44.
2018-08-07 10:27:18 -07:00
Gary van der Merwe
c1f89a90b4 Make dataclasses available as a backported third_party library. (#2354) 2018-08-07 10:04:33 -07:00
Jelle Zijlstra
fd6f99ca2c fix mypy-selftest (#2341) 2018-07-18 21:12:37 -07:00
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