Commit Graph

131 Commits

Author SHA1 Message Date
Alex Waygood eca15d9654 Put all mypy_test.py version parsing in mypy_test.py (#14974) 2025-11-03 15:30:38 -05:00
Sebastian Rittau 2d50d6b316 Support Python 3.14 (#13957) 2025-05-10 06:27:40 -07:00
Avasam 4265ee7c72 Enable Ruff flake8-use-pathlib (PTH) (#13795)
Port existing code to pathlib
2025-05-05 18:59:43 +02:00
Avasam 5faa04038b Apply mypy-tests custom config to other mypy-based tests (#13825) 2025-04-28 12:24:26 +02:00
Alex Waygood d92a6449c2 Remove more Python 3.8 cruft (#13787) 2025-04-03 11:56:38 +01:00
Brian Schubert c7ab79ed1b Drop Python 3.8 support in typeshed utilities (#13774) 2025-04-02 15:09:17 +01:00
Avasam eafa274f1b Enable Ruff PLW (Pylint Warning) (#13749) 2025-04-01 15:12:15 +02:00
Avasam 83ee2a2dc6 Enable Ruff flake8-builtins (A) (#13729) 2025-03-28 14:11:50 -04:00
Avasam 11929debd4 Update pip install calls in scripts to use uv. And messages to reference current executable (#13597) 2025-03-27 09:55:38 +01:00
Avasam 0b8dcfc00b Fix mypy test temporary config file creation (#13620) 2025-03-14 11:55:01 +01:00
Sebastian Rittau 822fae31e5 Remove Python 3.8 from CI (#13387) 2025-01-10 14:15:39 +01:00
Avasam 9c959a7dd3 Enable Ruff D (pydocstyle) with pep257 convention (#13326)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-02 22:05:35 +00:00
Sebastian Rittau 2d0f6d8277 Bundle path handling in ts_utils.paths (#12805) 2024-10-17 08:16:10 +02:00
Sebastian Rittau 1fa4986f71 Move common utility functions to a common library (#12773) 2024-10-14 08:00:02 +02:00
Sebastian Rittau 3b385903a1 Pass Requirement objects around (#12709)
This allows us to keep metadata like python_version and platform_system
and use it to conditionally install packages.
2024-09-30 17:45:58 +02:00
Jan Kühle d326c9bd42 Filter pytype tests by stdlib/VERSIONS file (#12649)
Filter the files to run pytype tests on by stdlib/VERSIONS file. This
becomes important for Python 3.12, where e.g. checking asynchat.pyi
requires asyncore.pyi, both of which have been removed in 3.12.
2024-09-12 18:40:19 +02:00
Sebastian Rittau cc40120ee5 mypy_test: Exclude sub-modules not in current Py version (#12352) 2024-07-16 16:04:54 +02:00
Sebastian Rittau f0afb04395 Extract VERSIONS parsing to _utils.py (#12351) 2024-07-16 12:51:15 +02:00
Ali Hamdan e285e52e13 mypy_test.py: warn about incompatible python version only on tested files (#12079) 2024-06-01 17:51:57 +01:00
Sebastian Rittau 425c69a6b9 Prefix utility modules with underscore (#11999) 2024-05-22 09:35:11 -04:00
Alex Waygood b8d144d491 Add 3.13 to our CI (#11926) 2024-05-19 16:18:49 -04:00
Sebastian Rittau 392ae934fc Move test_cases to stdlib/@tests/test_cases (#11865) 2024-05-09 19:27:09 -07:00
Alex Waygood 2c5712b7f4 Use uv for installing dynamic dependencies in mypy_test.py and regr_test.py (#11517) 2024-03-02 08:38:34 +00:00
Avasam da69247514 Code improvements from new Ruff checks (#11498) 2024-02-28 22:30:18 -08:00
Nikita Sobolev 06d0151b25 Enable redundant-self mypy error code (#11056) 2023-11-22 10:13:17 +00:00
Nikita Sobolev d232def6b2 Use consistent mypy output spacing (#11055) 2023-11-22 09:58:13 +00:00
Sebastian Rittau 7e2a3413fa Fix mypy_test if mypy returns negative exit code (#10866) 2023-10-11 14:53:16 +02:00
Ali Hamdan c5dde1e720 Add optional requires_python field to third-party stubs metadata (#10724)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-09-24 18:39:12 +01:00
Alex Waygood ef758b66c0 Bump mypy to 1.5.1 (#10559) 2023-08-16 12:18:31 -07:00
Sebastian Rittau 70d8d059a0 Make all tests executable (#10267) 2023-06-06 15:42:07 +02:00
Alex Waygood 2c3449694b Run mypy and pyright on our py312 stubs in CI (#10119) 2023-04-30 15:31:08 +01: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 140bba3425 Add comments when subclassing Any (#9732) 2023-02-14 14:11:56 +01:00
Alex Waygood c216b74e39 Centralize METADATA.toml parsing in the test suite (#9534) 2023-01-28 15:13:46 +00:00
Alex Waygood 3d6b8dccfe mypy_test.py: Try using a process pool instead of a thread pool (#9556) 2023-01-17 14:17:45 +00:00
Avasam 1a9aa3f3fe Update various comments now non-types dependencies are allowed (#9527) 2023-01-14 13:20:04 +00:00
Alex Waygood 0b903441e8 Allow stubs to depend on numpy (#9499) 2023-01-12 09:01:23 +00:00
Alex Waygood ab1921a737 Teach isort that imports from utils are first-party imports (#9500) 2023-01-11 17:25:32 +01:00
Alex Waygood 9aa3d99ac2 mypy_test.py: Add more comments (#9477)
Some fairly subtle logic was added in #9408, and I'm immediately regretting not having documented it slightly better. This PR adds some more comments to make maintaining this code easier in the future.
2023-01-08 12:26:11 -08:00
Alex Waygood 910397c714 mypy_test.py: Simplify add_third_party_files() (#9476) 2023-01-08 12:25:06 -08: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
Alex Waygood 8671fc5c0f regr_test.py: Allow non-types dependencies (#9382) 2022-12-23 13:55:54 -08:00
Avasam c6b9b4ce85 Stricter settings in mypy_test (#9294) 2022-12-02 18:55:55 +00:00
github-actions[bot] 5453c97753 Bump protobuf to 4.21.*; delete google/__init__.pyi (#8360)
This major version bump of the stubs package deletes google/__init__.py, which does not exist at runtime, and caused problems for several users. Mypy now has --namespace-packages enabled by default, which should hopefully mean that this causes minimal pain.

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-11-25 11:28:56 +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 e73fcf220e mypy_test.py: Remove unused seen variable/parameters (#8846) 2022-10-04 14:38:31 -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 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