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 Waygood and Shantanu
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 Waygood and Akuli
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 Waygood and Akuli
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 Waygood and Shantanu
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
Alex Waygood
86a34c5bd6
typecheck_typeshed.py: Make dir command-line argument positional-only (#8646 )
2022-08-31 09:14:53 +01:00
Alex Waygood
8b222200e0
fpdf2: Remove redundant str | Literal['DEPRECATED'] union (#8650 )
2022-08-30 19:54:52 +01:00
Alex Waygood
b417d5796d
Run flake8-noqa in CI ( #8641 )
2022-08-29 21:06:47 +01:00
Alex Waygood
c72c9a6c96
typed_ast.ast3: arguments.kw_defaults should be list[expr | None] (#8645 )
...
```python
>>> from typed_ast import ast3
>>> print(ast3.dump(ast3.parse('def foo(*, arg: int) -> None: ...')))
Module(body=[FunctionDef(name='foo', args=arguments(args=[], vararg=None, kwonlyargs=[arg(arg='arg', annotation=Name(id='int', ctx=Load()), type_comment=None)], kw_defaults=[None], kwarg=None, defaults=[]), body=[Expr(value=Ellipsis())], decorator_list=[], returns=NameConstant(value=None), type_comment=None)], type_ignores=[])
```
This bug was discovered in https://github.com/python/mypy/pull/13547
2022-08-29 14:44:48 +01:00
Alex Waygood
c0f27e39f9
Upgrade pytype to 22.8.23 ( #8644 )
2022-08-29 14:07:11 +01:00
Alex Waygood
bc26a98bd7
create_baseline_stubs.py: Modernize a few type annotations (#8642 )
2022-08-29 13:49:00 +01:00
Alex Waygood
e2211cb420
Delete some unused # noqa comments ( #8639 )
2022-08-29 12:56:06 +01:00
Alex Waygood
c8a679657b
Delete scripts/update-stubtest-allowlist.py ( #8606 )
2022-08-29 13:50:26 +02:00
Alex Waygood
1b6cda86d4
Alphabetise items in requirements-tests.txt ( #8635 )
2022-08-28 07:59:17 -07:00
Alex Waygood
d91e5f0eff
Further enhance check_consistent.py ( #8604 )
2022-08-26 07:50:26 -07:00
Alex Waygood
8cf125d80d
flake8 config: fix typo ( #8626 )
...
Accidentally introduced in #8612
2022-08-26 11:55:47 +01:00
Alex Waygood
1c56148ce9
mypy_test.py: Remove --dry-run option (#8611 )
...
Cf #8139 .
2022-08-25 14:23:00 +02:00
Alex Waygood
0f1d1f16b4
isort: don't skip stdlib/venv ( #8607 )
2022-08-24 15:48:27 -07:00
Alex Waygood
15f74295d2
Add aiohttp and tomlkit to requirements-tests.txt ( #8605 )
2022-08-24 23:08:54 +01:00
Alex Waygood
1e33759f09
cryptography: Add some missing @abstractmethod decorators (#8598 )
2022-08-23 11:38:08 -07:00
Alex Waygood
e160324ba7
six: Fix incorrect type[type[Any]] annotation (#8599 )
...
Mypy will (correctly, I think) start flagging `type[type[Any]]` as an illegal annotation when mypy 0.980 comes out. Let's fix it now, before it comes out.
2022-08-23 11:26:10 -07:00
Alex Waygood
875f0ca7fc
mypy_test.py: Move type-checking of our tests and scripts into a different test (#8587 )
2022-08-22 17:16:03 +01:00
Alex Waygood
976fdae300
xml stubs: Any -> Incomplete (#8576 )
2022-08-22 16:42:37 +01:00
Alex Waygood
c2966bc5ed
multiprocessing.reduction: Any -> Incomplete (#8585 )
2022-08-21 17:43:55 -07:00
Alex Waygood
9f05e9ff58
Improve classes returned from OrderedDict.{keys(), items(), values()} ( #8552 )
2022-08-20 22:21:39 +01:00
Alex Waygood
38bc0ec0e6
mypy_test.py: simplify argument parsing (#8577 )
2022-08-20 21:32:17 +01:00
Alex Waygood
c4ca110c5c
README: Add a link to https://typing.readthedocs.io ( #8575 )
2022-08-20 09:40:57 -07:00
Alex Waygood
8a326dc9ec
Remove NoReturn overloads from pow() ( #8568 )
2022-08-19 11:15:07 -07:00
Alex Waygood
2c052651e9
Normalise use of Never vs NoReturn ( #8549 )
2022-08-17 21:53:40 +01:00
Alex Waygood
5b47f13a99
Add _threading_local.local.__delattr__ back to the stub ( #8526 )
2022-08-15 11:56:31 +02:00
Alex Waygood
cf0b3a2596
Improve .keys(), .values(), .items() methods for TypedDicts ( #8532 )
2022-08-12 20:02:43 -07:00
Alex Waygood
1ec57121e3
Unpin stubtest from 3.10.5 ( #8523 )
2022-08-12 10:01:26 +02:00
Alex Waygood
a92da58328
Add @type_check_only to two fictional classes in builtins.pyi ( #8531 )
2022-08-11 11:55:07 +01:00
Alex Waygood
556f6a10f6
Enable flake8-pyi's Y034 check in stdlib/typing.pyi ( #8530 )
2022-08-11 10:57:31 +02:00
Alex Waygood
5a24bf8e1f
setuptools: delete _distutils.command.check.HAS_DOCUTILS ( #8529 )
...
Fixes #8527
2022-08-11 07:17:00 +01:00
Alex Waygood
a0d1f466fb
decimal.Context: Improve comments (#8525 )
2022-08-10 19:53:47 +01:00
Alex Waygood
f2283d519e
Fix stubtest failures on SQLAlchemy ( #8524 )
2022-08-10 11:48:46 -07:00
Alex Waygood
c87ccce37e
Remove a few unused TypedDicts ( #8522 )
2022-08-10 18:56:14 +01:00
Alex Waygood
7eaedd44dd
Add missing TypedDict methods and ClassVars ( #8512 )
2022-08-10 10:29:40 +01:00
Alex Waygood
c68bcc7e69
Temporarily pin stubtest to 3.10.5 ( #8511 )
2022-08-09 13:55:00 +02:00
Alex Waygood
892796a794
Remove, move or # noqa more TypeAlias declarations ( #8450 )
2022-08-05 13:03:19 +01:00
Alex Waygood
1dc1c91429
io.IOBase: correct metaclass (#8468 )
...
`io.IOBase` has `ABCMeta` as the metaclass at runtime: https://github.com/python/cpython/blob/75a6441718dcbc65d993c9544e67e25bef120e82/Lib/io.py#L71
But not currently in the stub. This is causing an unexpected stubtest failure for a `urllib3` PR here: https://github.com/python/typeshed/runs/7633083101?check_suite_focus=true
2022-08-02 09:20:07 -07:00
Alex Waygood
df4618ef2d
Upgrade pycln and flake8-pyi ( #8464 )
2022-08-02 08:43:02 +01:00
Alex Waygood
59a9621554
test_cases README: fix typos (#8453 )
...
Both introduced in #8445
2022-07-31 23:11:13 +01:00
Alex Waygood
4414246a15
Clean up a few Python 2 remnants ( #8452 )
2022-07-31 19:19:18 +01:00
Alex Waygood
87fc724cef
ctypes: pointer is a function, not a class (#8446 )
2022-07-31 15:29:13 +02:00
Alex Waygood
ea7bbbdad7
Move Match and Pattern to re.pyi; move ContextManager protocols to contextlib.pyi ( #8447 )
2022-07-31 15:27:47 +02:00
Alex Waygood
935ac9ca9e
test_cases: Improve README (#8445 )
2022-07-30 18:40:56 +01:00
Alex Waygood
fdeb216547
Remove or move several TypeAlias declarations ( #8444 )
2022-07-30 15:28:52 +01:00
Alex Waygood
553700e355
Move some protocol definitions closer to their usage sites ( #8436 )
2022-07-29 06:26:27 -07:00
Alex Waygood
a9f6632d1b
multiprocessing.reduction: improve recvfds and recv_handle (#8422 )
2022-07-28 17:05:08 +01:00
Alex Waygood
26d09359cf
multiprocessing.resource_sharer: remove unused TypeAlias (#8424 )
2022-07-28 17:43:36 +02:00
Alex Waygood
78e0b3cfca
Stubtest: allowlist all of distutils on 3.11 ( #8411 )
...
Fixes #8410
2022-07-27 20:27:38 +01:00
Alex Waygood
62cde01365
Upgrade flake8-pyi to 22.7.0 ( #8377 )
2022-07-24 03:20:35 +01:00
Alex Waygood
23c4b124a6
Stubtest allowlists: put all the fake __iter__ methods together ( #8368 )
2022-07-22 18:08:13 +01:00
Alex Waygood
eca5549ee1
CI: Use macos-latest for stubtest ( #8353 )
2022-07-21 16:52:41 +02:00
Alex Waygood
5bc9554573
stdlib/VERSIONS: fix crusty comment ( #8347 )
...
Resolves #8310
2022-07-20 18:59:01 +02:00
Alex Waygood
d1e80a724a
Add some missing Windows constants ( #8346 )
2022-07-20 17:45:36 +01:00
Alex Waygood
a57e182608
enum: Correct IntFlag mro on 3.11+ (#8334 )
2022-07-19 21:47:37 +02:00
Alex Waygood
6903041744
Use CamelCase for type aliases in xml.etree.ElementPath.pyi ( #8335 )
2022-07-19 12:04:43 -07:00
Alex Waygood
fceccd217c
Upgrade mypy to 0.971 ( #8332 )
2022-07-19 16:27:05 +01:00
Alex Waygood
e2ce7c6344
stdlib: audit more callback annotations ( #8209 )
2022-07-19 07:07:25 -07:00
Alex Waygood
540a6b25bf
Improve urllib.parse.urldefrag ( #8204 )
...
Fixes #2477
2022-07-19 07:05:09 -07:00