Commit Graph

36 Commits

Author SHA1 Message Date
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
Avasam
ebc9ff8718 Enable Ruff ARG (flake8-unsued-arguments) and remove unused arguments (#13334) 2024-12-29 17:21:19 -08: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
Max Muoto
37807d753a Use Generator instead of Iterator for 3rd-party context managers (#12481) 2024-08-12 14:26:18 +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
Alex Waygood
347f8a96b5 regr_test.py: improve several concurrency details (#11984) 2024-05-19 14:21:26 -04:00
Sebastian Rittau
e436dfe219 Unify test directory handling (#11864)
Previously, handling of test directories (`@tests` and `test_cases`) was
distributed over multiple files and redundant. This unifies the handling
in the `utils` module. This also fixes some instances where "package"
was used instead of "distribution". And in a few instances paths were
joined by using a `/` in a string, which is incompatible with Windows.

Also move `runtests.py` from `scripts` to `tests`. This is required so that
we can import `utils`, but it's also arguably the better fit. The only
mention of the script is actually in the `tests/README.md` file.

Helps with #11762.
2024-05-05 16:28:37 +02: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
Jelle Zijlstra
e5d25a7605 importlib.metadata: Improve and test SimplePath protocol (#11436)
Co-authored-by: layday <layday@protonmail.com>
2024-02-18 00:36:01 -08:00
Alex Waygood
c50a641fc8 regr_test.py: Run mypy with --no-incremental (#11346) 2024-01-30 08:59:20 -08:00
Sebastian Rittau
4e5f7a7142 Drop support for Python 3.7 (#11234) 2024-01-04 14:48:44 +01:00
Sebastian Rittau
f7aa7b709a Improve regression test documentation (#10935)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-10-29 10:07:17 +00: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
e40b5be2ea Speedup regr_test.py by running test cases concurrently (#10714) 2023-09-23 15:39:24 +01: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
Alex Waygood
1d2ae2598b Fix some typos in comments (#9802) 2023-02-23 22:11:24 +00:00
Alex Waygood
94065d3aa5 Fix typo in tests/regr_test.py (#9628)
It looks like in #9382, I reintroduced the bug that I previously fixed in #9349
2023-01-30 22:56:44 +00:00
Alex Waygood
c216b74e39 Centralize METADATA.toml parsing in the test suite (#9534) 2023-01-28 15:13:46 +00:00
Alex Waygood
a7f1d3c08d Improve mypy flags for regr_test.py and typecheck_typeshed.py (#9441)
- Remove redundant flags that are now enabled by default
- Add `--pretty` to `typecheck_typeshed.py`
2023-01-02 12:01:44 +00:00
Alex Waygood
fd3e64ac3e regr_test.py: Fix out-of-date comment (#9419) 2022-12-27 17:26:48 +00:00
Alex Waygood
8671fc5c0f regr_test.py: Allow non-types dependencies (#9382) 2022-12-23 13:55:54 -08:00
Jelle Zijlstra
388d7839d9 regr_test.py: improve interaction between --all and --quiet flags (#9349)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-12-10 21:39:33 +00:00
Avasam
c6b9b4ce85 Stricter settings in mypy_test (#9294) 2022-12-02 18:55:55 +00:00
Alex Waygood
95c74ba7e1 Minor improvements to tests/regr_test.py (#9274) 2022-11-25 15:03:20 +00:00
Alex Waygood
1f8491d23d Allow adding test cases testing version-dependent Python features (#9238) 2022-11-21 08:03:28 -08:00
Nikita Sobolev
805519717b regr_test.py: fix typo in --help (#9147)
It used to be:

```
  -p [{3.11,3.10,3.9,3.8,3.7} ...], --python-version [{3.11,3.10,3.9,3.8,3.7} ...]
                        Run mypy for certain Python versions (defaults to
                        sys.version_info[:2])Note that this cannot be specified if
                        --all is also specified.
```
2022-11-10 13:32:22 +00: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
48e76e8a56 Bump mypy to 0.981 (#8796) 2022-09-26 17:14:33 -07: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