Commit Graph

40 Commits

Author SHA1 Message Date
Avasam
d34ef50754 Optional pytype install on Windows (no CI) (#12669) 2024-09-17 10:58:31 +02:00
Jan Kühle
99f6238b91 Update pytype to 2024.09.13 and Python 3.12 (#12653) 2024-09-13 14:01:46 +02:00
Sebastian Rittau
d479e0f24a Unify stubtest allowlist handling more (#11986)
This makes it trivial to consistently extend supported allowlists in the future.
2024-05-21 08:25:32 +02:00
Sebastian Rittau
e2e3750ee9 Move stdlib allowlists to stdlib/@tests (#11982)
Rename py3_common.txt to common.txt
2024-05-20 13:23:02 +02:00
Sebastian Rittau
392ae934fc Move test_cases to stdlib/@tests/test_cases (#11865) 2024-05-09 19:27:09 -07: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
57f3dcac8d Bump flake8-pyi to 24.4.1 (#11791) 2024-04-19 10:07:56 -07:00
Sebastian Rittau
f4b89f5f86 Rename check_consistent.py to check_typeshed_structure.py (#11761) 2024-04-14 13:34:10 -07:00
Sebastian Rittau
65c154f5ff Document ignore_missing_stub in CONTRIBUTING.md (#11426)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-17 12:48:28 +00:00
Stephen Morton
33df486ba2 Allow the use of local-only stubtest allowlists (#11173)
This makes it nicer to work on a local system with known
divergences from the CI environment
2023-12-16 18:43:33 -08: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
Alex Waygood
7e34ca5b71 runtests.py: note that stdlib stubtest might fail (#10628) 2023-08-30 08:48:44 +02:00
Alex Waygood
39fd112f3e Further improve non-types dependency handling in pytype_test.py (#10393) 2023-07-01 00:24:38 +01:00
Alex Waygood
7fdd05003a pytype_test.py: Use importlib.metadata instead of pkg_resources (#10391) 2023-06-30 21:37:06 +01:00
Sebastian Rittau
1e25866b23 Improve pytype compatibility handling (#10377) 2023-06-28 12:29:13 +02:00
Sebastian Rittau
5092f52c45 Update description of test scripts (#10310) 2023-06-12 18:42:33 +01:00
Avasam
5ac80781ec Integrate requirements-stubtest.txt into METADATA.toml (#9778) 2023-02-21 11:19:50 +01:00
Avasam
ed6748fb32 Stubtest settings: change ignore_missing_stub default to false (#9779)
If you're reading about this commit from an autogenerated changelog entry, this should have no user-visible impact on how the stubs are interpreted by a type checker; it's just an internal change to how typeshed's tests work.
2023-02-20 22:37:45 +00:00
Avasam
74112dc189 Add a run_stubtest flag to scripts/runtests.py (#9717)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-02-19 22:10:32 +00:00
Avasam
70025c3723 Support third-party stub external dependencies in pytype (#9449)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-01-04 19:32:23 +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
0edcfa13ad Add syntax highlight to all shell code blocks (#9445) 2023-01-02 23:55:25 +00:00
Hassan Abouelela
70e48ff799 Mention how to run stubtest directly on third party stubs (#8868)
Signed-off-by: Hassan Abouelela <hassan@hassanamr.com>
2022-10-08 17:15:35 -07:00
Alex Waygood
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
Samuel T
e5d52a39d4 Script to run all checks locally (#8798)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-10-04 07:21:10 -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
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
Shantanu
5ef20e8021 Use packaging to parse versions (#8314)
packaging is the standard tool for dealing with versions and
requirements. This allows us to easily support all PEP 508 specs.
packaging also has good error messages, so I don't create our own here.
This lets us get rid of our handrolled half parser and sanity checks.
I kept the whitespace consistency check, since that's just a formatting
lint and isn't testing the correctness of parsing (which we now
definitely do correctly).
2022-07-17 12:35:32 -07:00
Alex Waygood
09141ec3dc mypy_test.py: Fix argument-parsing for --python-version (#8134)
* mypy_test.py: Fix argument-parsing for `--python-version`

* Bump min version required in the README
2022-06-22 15:08:56 +01:00
Alex Waygood
c6b3211afa Improve test-suite documentation (#7756)
- mypy_test and pyright no longer just test the stubs, they now also test other parts of typeshed as well.
- pytype_test.py can now be run on 3.10, meaning the whole test suite can now also be run on 3.10.
- Various test scripts now have from `__future__ import annotations`, meaning they can now only be run on 3.7+.
- Clean up the description of pyright_test.py, which had a slightly confusing wording.
- Also fix the `--dry-run` config option in mypy_test.py, which I accidentally broke in #7746
2022-04-30 12:43:48 -06:00
Sebastian Rittau
5bd747570d Update Python version for pytype (#6288) 2021-11-12 22:26:22 +01:00
Alex Waygood
4b3a8a8790 Improve support for running tests on Windows (#6284) 2021-11-12 17:09:20 +01:00
Shantanu
bf92378722 Bump typed-ast version, recommend Python 3.8 for tests (#6278) 2021-11-12 02:53:42 -08:00
Sebastian Rittau
2b64f54008 Support @tests/requirements-stubtest.txt files (#5704) 2021-06-28 19:42:27 +02:00
Sebastian Rittau
3368258e4a Add distributions arg to third-party stubtest (#5628)
* Add distributions arg to third-party stubtest

Make stubtest_third_party.py executable

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-06-13 14:53:29 +03:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Shantanu
e66ceceed0 Rename whitelist to allowlist (#5614)
Resolves #4436

I want to add stubtest for third party stubs, and figured it'd be easier
to make this change now.

Co-authored-by: hauntsaninja <>
2021-06-10 14:33:44 -07:00
Jake Bailey
c4dc935b3f Add a stricter config pass for pyright (#5612) 2021-06-10 20:10:12 +02:00
Sebastian Rittau
9795bae6f7 Remove mypy_test_suite (#5543)
Closes: #5540
2021-05-28 05:00:48 -07:00
Sebastian Rittau
3ba35f3552 Split the tests section, extend ToC (#5433)
Move and consolidate venv setup and running isort/black/flake8 into
separate sections and link those sections from the ToC. Also extend
those sections slightly.

Move the tests section into a separate file.

Make venv name in pre-commit match name in CONTRIBUTING.
2021-05-13 15:41:04 +02:00