Commit Graph

21 Commits

Author SHA1 Message Date
Alex Waygood
ef758b66c0 Bump mypy to 1.5.1 (#10559) 2023-08-16 12:18:31 -07:00
Shantanu
9e86c6026a unittest.mock: use ParamSpec in patch (#10325)
Fixes #10324
2023-06-20 13:48:49 +02:00
Alex Waygood
d8ef303e00 Bump pycln and pathspec test dependencies (#10251) 2023-06-03 14:46:33 +01:00
Nikita Sobolev
2bfb6d8212 Fix CI, use new termcolor version (#10079) 2023-04-24 07:17:23 -07:00
Avasam
75f47d0cb1 Typecheck typeshed's code with pyright (#9793)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-02-22 18:53:07 +00:00
Avasam
a6c6bc1b8e Fix stdlib/disutils testing (#9734) 2023-02-21 08:06:20 +00:00
Alex Waygood
c216b74e39 Centralize METADATA.toml parsing in the test suite (#9534) 2023-01-28 15:13:46 +00:00
Alex Waygood
597e1a0078 Bump various test dependencies (#9549) 2023-01-16 11:04:45 -08:00
Alex Waygood
0b903441e8 Allow stubs to depend on numpy (#9499) 2023-01-12 09:01:23 +00:00
Alex Waygood
4d6fda99f0 mypy_test.py: Allow non-types dependencies (#9408)
The approach is pretty similar to the approach I took in #9382 for regr_test.py: dynamically create virtual environments for testing stubs packages in isolation. However, since mypy_test.py tests all of typeshed's stubs in succession (and since lots of typeshed's stubs packages depend on other typeshed stubs packages), the performance issues with creating a virtual environment for testing each stubs package are even more severe than with regr_test.py.

I mitigate the performance issues associated with dynamically creating virtual environments in two ways:

- Dynamically creating venvs is mostly slow due to I/O bottlenecks. Creating the virtual environments can be sped up dramatically by creating them concurrently in a threadpool. The same goes for pip installing the requirements into the venvs -- though unfortunately, we have to use pip with --no-cache-dir, as the pip cache gets easily corrupted if you try to do concurrent reads and writes to the pip cache.

- If types-pycocotools requires numpy>=1 and types-D3DShot also requires numpy>=1 (for example), there's no need to create 2 virtual environments. The same requirements have been specified, so they can share a virtual environment between them. This means we don't have to create nearly so many virtual environments.
2023-01-07 23:57:49 +00:00
Avasam
3e24c65c3b Rework how pyright is run in CI to allow for non-types dependencies(#9434)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-03 22:43:56 +00:00
Avasam
46f0d918ef A more accurate termcolor.colored fallback (#9435) 2022-12-31 22:52:26 +00:00
Alex Waygood
8671fc5c0f regr_test.py: Allow non-types dependencies (#9382) 2022-12-23 13:55:54 -08:00
Nikita Sobolev
bdf036d516 check_consistent.py: Add check ensuring packages are not installed for unspecified platforms (#9265) 2022-11-25 10:11:59 +00:00
Samuel T
573ee94f35 All scripts/tests: always specify file encoding in calls to open() (#8882) 2022-10-11 22:29:36 +01: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
ab2fba9c83 check_consistent.py: ignore .gitignored files (#8804) 2022-09-28 17:02:27 +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
Shantanu
67c858408d Upgrade to termcolor>=2 (#8766) 2022-09-19 08:17:30 +02:00
Alex Waygood
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