Commit Graph
100 Commits
Author SHA1 Message Date
Alex Waygood 5fb21861f9 Colorize flake8 output in CI (#9422) 2022-12-28 12:49:51 +01:00
Alex Waygood 27983aa929 ast.NodeVisitor: add visit_TryStar on 3.11+ (#9418) 2022-12-27 18:36:53 +01:00
Alex Waygood fd3e64ac3e regr_test.py: Fix out-of-date comment (#9419) 2022-12-27 17:26:48 +00:00
Alex Waygood 2704a8d916 pyaudio: fix stubtest failures (#9416) 2022-12-27 16:11:01 +01:00
Alex Waygood 116229d0ac datetime: various parameters can now safely be passed as keyword arguments on 3.12+ (#9415) 2022-12-27 14:35:29 +00:00
Alex Waygood 154452ffc2 ast.NodeVisitor: Add visit_* methods for ast nodes new in 3.8-3.10 (#9413) 2022-12-26 20:27:44 -08:00
Alex Waygood 59b1a78d5f Bump various test dependencies (#9412) 2022-12-26 18:48:07 +00:00
Alex Waygood 8671fc5c0f regr_test.py: Allow non-types dependencies (#9382) 2022-12-23 13:55:54 -08:00
Alex Waygood 352f496d69 Unpin stubtest from Python 3.10.8 and 3.11.0 (#9368) 2022-12-20 20:31:13 +00:00
Alex Waygood 0e41136f5a python-dateutil: Add zoneinfo submodule (#9381) 2022-12-18 17:14:05 +00:00
Alex Waygood 805452f896 editdistance: delete the bycython submodule (#9380) 2022-12-18 07:25:11 -08:00
Alex Waygood 7a9818e565 Colorize output of stdlib stubtest in CI (#9379) 2022-12-17 13:08:17 -08:00
Alex Waygood 04d4cbd92f pycurl: Add missing constants (#9373) 2022-12-16 17:48:14 -08:00
Alex Waygood c78bc57f78 shutil.rmtree: add avoids_symlink_attacks attribute (#9366) 2022-12-15 09:56:58 +00:00
Alex Waygood 9bddd3a3f1 Bump pyright to 1.1.284 (#9363) 2022-12-14 20:07:27 +00:00
Alex Waygood b356abcbda Stdlib stubtest: Temporarily pin Python to 3.10.8 and 3.11.0 in CI (#9361)
Stubtest: pin Python to 3.10.8 and 3.11.0 in CI
2022-12-14 10:48:22 -08:00
Alex Waygood 40bfc266f7 3rd-party stubtest: run on Python 3.10 (#9342) 2022-12-07 20:25:57 +00:00
Alex Waygood 0220577a31 Remove stubs for certifi (#9341)
Closes #8048
2022-12-07 08:06:35 -08:00
Alex Waygood fc69819a89 Don't run mypy_primer on stubsabot PRs (#9332)
We can be fairly confident that PRs updating only a `METADATA.toml` file will never produce an interesting `mypy_primer` diff.
2022-12-05 23:47:59 -08:00
Alex Waygood 95c74ba7e1 Minor improvements to tests/regr_test.py (#9274) 2022-11-25 15:03:20 +00:00
Alex Waygood e2ad6fbe62 Add color back to CI output (#9276) 2022-11-25 15:01:31 +00:00
Alex Waygood 350b3c57da Bump flake8 and flake8-noqa (#9275) 2022-11-25 11:51:00 +00:00
Alex Waygood b3728f38f5 Add test case for recent types-regex regression (#9269) 2022-11-24 11:37:12 -08:00
Alex Waygood 89f22278ba Bump flake8-pyi and pytype versions used in CI (#9268) 2022-11-24 14:55:26 +00:00
Alex Waygood 67c8b5cb22 pycurl: Add a few missing constants (#9262) 2022-11-23 23:31:16 +00:00
Alex Waygood 01e78c7e81 Use modern syntax in test-case files where possible (#9261) 2022-11-23 11:58:11 -08:00
Alex Waygood a3de404e1d Pin redis to 4.3.4 in CI (#9247)
We're about to get a daily test failure with 63 stubtest errors (see the Ubuntu stubtest failure in #9187) due to the release of redis-py 4.3.5, and I'd rather that didn't happen.
2022-11-22 12:46:42 +01:00
Alex Waygood 0a5202222c dateparser: delete DIGIT_USE_PATTERN (#9243)
Fixes #9242
2022-11-21 19:53:56 -08:00
Alex Waygood 4588dd6c74 check_consistent.py: Allow having weird filenames in the test_cases directory (#9239) 2022-11-21 17:40:11 +00:00
Alex Waygood 1f8491d23d Allow adding test cases testing version-dependent Python features (#9238) 2022-11-21 08:03:28 -08:00
Alex Waygood f62f402127 python-slugify: use explicit re-exports (#9225)
Fixes https://github.com/python/typeshed/pull/9224#discussion_r1027053364
2022-11-19 06:47:34 -08:00
Alex Waygood beb19fea4c runtests.py: point pycln to pyproject.toml for config settings (#9202)
An oversight in #9197 that was noticed by @Avasam post-merge (thanks!)
2022-11-15 09:40:22 -08:00
Alex Waygood 3fec65927c check_consistent.py: Add a check guarding against typos for the new platforms key (#9203) 2022-11-15 16:23:22 +00:00
Alex Waygood 263427f438 Bump test dependencies; improve pycln config (#9197) 2022-11-14 11:58:45 -08:00
Alex Waygood cc7ac01a3e Stubtest: Don't allowlist termios and posix constants on Windows (#9150) 2022-11-10 07:02:53 -08:00
Alex Waygood 068b0b488a Improve builtins.vars() (#9146) 2022-11-10 12:14:05 +01:00
Alex Waygood 739460291b Use recursive type aliases in builtins and _typeshed (#9134) 2022-11-08 17:04:09 +00:00
Alex Waygood efa1048d42 stubsabot: warn if stubtest is skipped in CI (for real this time) (#9133)
Fixes a bug in #8681. The logic currently is broken; there should have been a warning message in the PR body for #9118, but there wasn't.
2022-11-08 08:33:17 -08:00
Alex Waygood 4f381af4c5 Upgrade mypy to 0.990 (#9123) 2022-11-07 11:20:47 -08:00
Alex WaygoodandJelle Zijlstra 658b6e7de0 PyInstaller: Fix DeprecationWarning when parsing the stub using ast.parse() (#9112)
```python
>>> import ast, warnings
>>> warnings.filterwarnings("always")
>>> with open("typeshed/stubs/pyinstaller/pyi_splash/__init__.pyi", encoding="utf-8") as file:
...     source = file.read()
...
>>> ast.parse(source)
<unknown>:11: DeprecationWarning: invalid escape sequence '\u'
<ast.Module object at 0x0000027EAF6D3AF0>
```

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-06 14:50:38 -08:00
Alex Waygood 22c5afa2d2 http.server.SimpleHTTPRequestHandler: Fix version branching (#9075) 2022-11-03 11:17:50 +01:00
Alex Waygood d1d1afbe3a Bump flake8-bugbear; ignore flake8-bugbear in stub files (#9069) 2022-11-02 12:18:00 -07:00
Alex Waygood 401a7b929e Bump various test dependencies; pin Python to <3.10 in CI to workaround pytype incompatibility (#9068) 2022-11-02 18:44:48 +00:00
Alex Waygood 8d941f0e53 Remove unnecessary pyright: ignore (#9000) 2022-10-27 08:27:28 -07:00
Alex Waygood 8b9b96c9f8 datetime.timedelta: Remove explicit inheritance from SupportsAbs (#8972)
Fixes #8971
2022-10-23 15:28:44 -07:00
Alex Waygood dc7fdc6f5d Fix invoke regression (#8950)
* Fix `invoke` regression
2022-10-21 18:04:22 +01:00
Alex Waygood 122bceeade CI: Use macOS-11 for stdlib stubtest (#8949) 2022-10-20 15:45:18 +02:00
Alex Waygood d22ebe7676 Remove stubs for atomicwrites (#8925) 2022-10-18 17:33:28 -07:00
Alex Waygood 03c38d91ae Mark atomicwrites as no longer updated (#8912)
[`atomicwrites`](https://github.com/untitaker/python-atomicwrites) is a package that's only really useful for Python 2/3 compatibility. It's now deprecated, archived, and unmaintained. Prior to #8883 a few days ago, marking the stubs as complete, the typeshed stubs hadn't received any significant updates for several years.

I propose we mark the stubs as no longer updated, and then remove them.
2022-10-17 12:48:21 +02:00
Alex Waygood 9ba68c364a dateutil: Add comment explaining the use of ABCMeta (#8911) 2022-10-17 12:46:48 +02:00
Alex Waygood 928f006318 typing.pyi: Improve comments for IO/TextIO (#8913)
#8726 proposed to make these properties abstract, but it would have broken half the typed-Python ecosystem, and we've since decided that it's not worth taking action on this (https://github.com/python/typeshed/issues/2146#event-7450564547). This PR rephrases the comments to make clear that there isn't really anything actionable that can be done here.
2022-10-17 12:44:40 +02:00
Alex Waygood 2b5afd9cc9 Fix stubtest failures on SQLAlchemy (#8914) 2022-10-17 12:43:52 +02:00
Alex WaygoodandShantanu 6a2232a30b Improve docs on running stubtest locally (#8822)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-10-08 16:29:48 -07:00
Alex Waygood d1375f600c Remove stubs for freezegun (#8867) 2022-10-07 11:48:04 -07:00
Alex Waygood 8b41b1337b Bump flake8-pyi and black to latest versions (#8859) 2022-10-06 16:45:02 -07:00
Alex WaygoodandKevin Kirsche e173cbe7b6 Mark requests stubs as complete (#8858)
Co-authored-by: Kevin Kirsche <kevin.kirsche@one.verizon.com>
2022-10-06 15:31:02 -07:00
Alex Waygood 5d45e3babc fpdf2: complete stubs (#8855) 2022-10-06 11:36:26 +02:00
Alex Waygood aeb16b155b stubsabot: only update existing branches if the diff relative to master would be different (#8854) 2022-10-05 17:35:20 -07:00
Alex Waygood e73fcf220e mypy_test.py: Remove unused seen variable/parameters (#8846) 2022-10-04 14:38:31 -07:00
Alex Waygood 5cb7ef1f73 stubsabot: use an ssh-key when checking out typeshed (#8844)
Fixes #8434.

This uses a new ssh key that @JelleZijlstra just set up for our repo ([this option](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#push-using-ssh-deploy-keys) in Peter Evans's guide to getting checks to run on automated PRs. It seems to be a good option in terms of both security and usability. It's also the option used by `oddbird/MetaDeploy` [here](https://github.com/oddbird/MetaDeploy/blob/main/.github/workflows/upgrade-deps.yml#L20), and they seem pretty happy about it (they wrote a nice blog post about their automated PRs for uprading dependencies [here](https://www.oddbird.net/2022/06/01/dependabot-single-pull-request/).)
2022-10-04 14:13:18 -07:00
Alex Waygood 08a3359e94 Run stubsabot daily, not weekly (#8845)
I think stubsabot has been a really big success. Let's change it to a daily workflow, so that we don't get an avalanche of PRs every Friday, and so that we can see more quickly if a PR changing stubsabot has accidentally broken the script. (If that _does_ happen, it should be pretty easy to just revert the commit that accidentally broke stubsabot, and go back to a version that works pretty well.)
2022-10-04 14:12:50 -07:00
Alex Waygood 55cddc7ac7 mypy_test.py: restore previous behaviour where all third-party stubs are tested by default (#8842) 2022-10-04 11:01:51 -07:00
Alex Waygood 1fc58e5413 Use stubgen's --export-less option in create_baseline_stubs.py (#8843) 2022-10-04 10:58:51 -07:00
Alex Waygood 477bfa2e92 Stubsabot: Add analysis of the diff to the PR body (#8817) 2022-10-04 10:14:39 -07:00
Alex Waygood 5da171ba45 mypy_test.py: Always add dependencies of stubs to the files to test (#8800) 2022-10-04 08:05:13 -07:00
Alex Waygood f801229f37 fpdf2: Add missing files (#8836) 2022-10-03 17:05:37 -07:00
Alex Waygood f9b1289226 requests: Add regression test for #8762 (#8835)
The final mypy_primer report for #8762 was an empty diff. Considering the number of issues we've had with our requests stubs over the last year, it feels like it makes sense to add a test case to make sure that it doesn't regress.
2022-10-03 16:11:44 -07:00
Alex Waygood 78ca9c7390 Bump mypy to 0.982 (#8831) 2022-10-03 10:34:44 -07:00
Alex Waygood deff426b6f Fix multiprocessing.DictProxy.values() (#8815)
Fixes #8814
2022-09-30 13:37:53 +02:00
Alex Waygood ab2fba9c83 check_consistent.py: ignore .gitignored files (#8804) 2022-09-28 17:02:27 +01:00
Alex Waygood d84fda1f12 Upgrade pyright to 1.1.273 (#8802) 2022-09-28 14:01:08 +01:00
Alex Waygood 48e76e8a56 Bump mypy to 0.981 (#8796) 2022-09-26 17:14:33 -07:00
Alex Waygood 008fe2e764 mypy_test.py: rework filter, exclude and --dir arguments (#8711) 2022-09-22 08:31:24 +01:00
Alex WaygoodandShantanu 2e50b58ca9 Link earliest version with py.typed in stubsabot obsoletion PRs (#8775)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-09-20 23:37:21 +01:00
Alex Waygood 876c9bf6af stubsabot: fix two GitHub diff link bugs (#8767) 2022-09-19 11:13:16 -07:00
Alex Waygood 97c935a3fe Fix protobuf stubtest errors (#8758) 2022-09-18 17:47:36 -07:00
Alex Waygood 2eaa63b8fa stubsabot: checkout the branch you were on after script completion (#8742) 2022-09-18 12:52:03 +01:00
Alex Waygood a4e5ad8aab stubsabot: link to diff between releases on GitHub, where possible (#8744) 2022-09-15 17:11:31 -07:00
Alex Waygood 20bc8fa4e3 Fix stubtest errors on macOS / Python 3.11 (#8743) 2022-09-15 15:27:42 -07:00
Alex Waygood 5a3595a5d6 stubsabot: refuse to run if uncommitted changes are present locally (#8741) 2022-09-15 13:45:53 -07:00
Alex Waygood 2fd0180bb1 stubsabot: Add the PR body to the commit message (#8740) 2022-09-15 20:12:35 +01:00
Alex Waygood 8e718d4891 pstats: delete outdated comment (#8738)
The annotation in CPython was fixed thanks to @ruancomelli in https://github.com/python/cpython/pull/96741!
2022-09-15 11:24:30 +01:00
Alex Waygood 3e71efbc73 Improve the daily.yml workflow (#8737) 2022-09-14 21:46:18 -07:00
Alex Waygood 246f7e7720 protobuf: fix stubtest errors (#8735) 2022-09-14 21:45:29 -07:00
Alex WaygoodandAkuli a6c174cc7b Add new sys functions introduced to combat CVE-2020-10735 (#8733)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-09-13 16:01:26 +01:00
Alex Waygood 34383fcab5 [pynput] Fix annotations of Controller.Key(Code) (#8722)
Document stubtest entries
2022-09-12 13:30:57 +02:00
Alex WaygoodandAkuli c4483a7b01 Update fdpf2 stubs for v2.5.7 (#8721)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2022-09-11 15:27:19 +01:00
Alex Waygood ed29fc5557 stubtest_third_party.py: Make it work on Windows (#8720) 2022-09-11 01:06:46 +03:00
b53843ab46 Add infrastructure allowing for test cases for third-party stubs (#8700)
- Move the logic for running mypy on the test cases from `tests/mypy_test.py` to a separate script, `tests/regr_test.py`.
- Add the necessary logic in order to be able to have test cases for third-party stubs.
- Move logic common to `tests/mypy_test.py` and `tests/regr_test.py` into `tests/colors.py`, and rename `tests/colors.py` to `tests/utils.py`.
- Add a new check to `tests/check_consistent.py`, to enforce the use of `# pyright: reportUnnecessaryTypeIgnoreComment=true` comments in third-party test cases. These are essential if we want to have our tests against false-negatives work with pyright.
- Update the relevant documentation to account for the new test file.
- Add a new job to the `tests.yml` GitHub workflow, to run the new test in CI.
- Add a simple proof-of-concept test case for `requests`, as a regression test for #7998.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2022-09-08 16:51:33 +01:00
Alex Waygood e2ef8fe116 test_cases README: Address post-merge review of #8688 (#8694)
Thanks @kkirsche for the review!
2022-09-06 17:00:57 +01:00
Alex Waygood 51e8325c10 Rename the files in the test_cases directory; add further clarifications to the README (#8688) 2022-09-06 07:50:24 +02:00
Alex Waygood b6d28acb23 mypy_test.py: Use pathlib more (#8680) 2022-09-05 14:24:14 +01:00
Alex Waygood fd4feba2c9 Enable pyright's reportUnnecessaryTypeIgnoreComment setting for the whole test_cases directory (#8683) 2022-09-05 15:20:04 +02:00
Alex Waygood 3a397a2252 stubsabot: improve argparse for --action-level (#8682) 2022-09-04 16:16:05 -07:00
Alex WaygoodandShantanu eb6431c4cc stubsabot: warn if stubtest won't test an update (#8681)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-09-04 13:56:58 -07:00
Alex Waygood 483f0ac078 prettytable: Fix stubtest errors (#8676)
Fixes #8674. A partial revert of 9e69627501.
2022-09-03 13:26:23 -07:00
Alex Waygood 8bc2565d11 pyautogui: just skip stubtest (#8678) 2022-09-03 13:25:50 -07:00
Alex Waygood 54c562827b Cancel old test jobs in CI (#8679) 2022-09-03 13:04:54 -07:00
Alex Waygood 3e5808a990 Bump flake8-pyi and pytype test dependencies (#8656) 2022-08-31 12:20:11 +01:00
Alex Waygood 601700d1a5 Improve some tkinter unions (#8655) 2022-08-31 13:05:51 +03:00