Commit Graph

70 Commits

Author SHA1 Message Date
Avasam
7c15e6998f Autoformat YAML files (#9450) 2023-01-03 08:55:06 +01:00
Nikita Sobolev
7806607df9 Improve error message of Unrecognised platforms specified (#9283) 2022-11-26 14:46:43 +01: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
Avasam
7050c1d907 Add support for Homebrew and Chocolatey (#9187) 2022-11-24 07:17:17 +00:00
Alex Waygood
01e78c7e81 Use modern syntax in test-case files where possible (#9261) 2022-11-23 11:58:11 -08:00
Sebastian Rittau
02942b710c Support "stub_distribution" and "upload" metadata fields (#9256) 2022-11-23 13:05:13 +01:00
Alex Waygood
4588dd6c74 check_consistent.py: Allow having weird filenames in the test_cases directory (#9239) 2022-11-21 17:40:11 +00:00
Alex Waygood
3fec65927c check_consistent.py: Add a check guarding against typos for the new platforms key (#9203) 2022-11-15 16:23:22 +00:00
Nikita Sobolev
9cd9f6f6e0 Add the ability to run third-party stubtest on Windows or MacOS when needed (#8923)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-11-11 13:40:50 +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
ab2fba9c83 check_consistent.py: ignore .gitignored files (#8804) 2022-09-28 17:02:27 +01:00
Alex Waygood
008fe2e764 mypy_test.py: rework filter, exclude and --dir arguments (#8711) 2022-09-22 08:31:24 +01: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
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
d91e5f0eff Further enhance check_consistent.py (#8604) 2022-08-26 07:50:26 -07:00
Shantanu
49062f53c3 Improve check_consistent (#8581)
- Use pathlib for convenience
- Share more logic between check_stubs and check_stdlib
- Better recursive checking, e.g. if a README.md is in the wrong place
- Fixes bug in checking directories in stubs/
- Test distribution names are valid
- Errors now contain full paths
- I believe pathlib normalises separators, but someone with Windows
  might want to double check this continues to work
2022-08-23 23:18:07 -07:00
Shantanu
19beaba9e7 Disallow adding stubs for types- packages (#8579)
This would lead to confusion. The types prefix is special cased in
various ways in stub_uploader
2022-08-20 15:44:17 -07:00
Kevin Kirsche
8c51fab4e2 Support extras in stubtest_third_party.py (#8467) 2022-08-18 14:12:36 -07: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
78d96cd17e Drop support for Python 2 (#8272) 2022-07-12 09:08:56 +02:00
Shantanu
305f10b808 stubtest: per project --ignore-missing-stub (#8122) 2022-06-21 05:52:24 -07:00
Shantanu
64181e8dad stubtest: use separate table in METADATA.toml (#8096) 2022-06-19 00:43:24 -07:00
Sebastian Rittau
d8c0f25f0d Explain the no_longer_updated METADATA field (#8037) 2022-06-08 18:46:41 +02:00
Alex Waygood
9d450cb50c Make test scripts pass mypy --strict (#7745)
- Add several type hints to untyped functions.
- While we're at it, upgrade several annotations to use modern syntax by using `from __future__ import annotations`. This means that the tests can't be run on Python 3.6, but 3.6 is EOL, and it is already the case that some scripts in this directory can only be run on more recent Python versions. E.g. `check_new_syntax.py` uses `ast.unparse`, which is only available in Python 3.9+.
- Fix a few pieces of code that didn't type check.
2022-04-29 21:55:12 -06:00
Sebastian Rittau
f7aa41245e Drop Python 2 support in third-party stubs (#7703) 2022-04-27 15:32:17 +03:00
Sebastian Rittau
c3907ab26b Remove Python 2 support from some third-party distributions (#7466)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-03-09 20:19:22 +02:00
Sebastian Rittau
7a81bd41e9 Re-introduce the 'stubtest' key for third-party packages (#7351)
Some distributions can't be tested with stubtest for a variety of
reasons or because of bugs in stubtest. This key:

* let's us keep metadata about a distribution in one place,
* prevents us from modifying the scripts because of issues with a
  specific distribution, and
* will trigger tests if only the key is changed.
2022-02-22 15:59:27 +01:00
Sebastian Rittau
38811a4495 Fix check consistent (#6860) 2022-01-08 15:35:42 +02:00
Sebastian Rittau
14e5d16c3a Replace METADATA stubtest key with stubtest_apt_packages (#6704) 2021-12-27 17:28:59 +01:00
Sebastian Rittau
bb77f39b7c Add a 'stubtest' flag to METADATA.toml (#6687)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-12-25 17:02:57 +02:00
Shantanu
c47ed98b3e dummy_thread/ing: remove in 3.9 (#6408)
https://bugs.python.org/issue37312
2021-11-27 20:50:14 -08:00
Sebastian Rittau
bb24e77404 Update remaining versions for third-party stubs (#6094)
Also remove the python2 markers of packages that don't list Python 2
as supported in the latest version.

Don't special case version '0.1'

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-10-12 12:30:45 +02:00
Sebastian Rittau
46fc031ee7 Allow third-party versions to end in asterisk (#6129)
This is a first step towards #6095, where x.y and x.y.* are treated as
equivalent. The next step is to update existing versions to use x.y.*
where applicable and then treat x.y differently.

Co-authored-by: Akuli <akuviljanen17@gmail.com>
2021-10-11 00:46:18 +02:00
Sebastian Rittau
0506182348 Allow three-component third-party versions (#5995)
Closes: #5992
2021-09-18 20:08:51 -07:00
Nikita Sobolev
392c81d767 Switch from toml to tomli (#6023) 2021-09-10 15:48:15 +02:00
Sebastian Rittau
ad3f0c8e34 Allow non-types dependencies (#5769)
Remove the check in check_consistency that ensures that only other
type packages from typeshed are being depended on. Instead, add an
explanation to CONTRIBUTING that spells out the requirements. This
adds a higher, but reasonable burden on maintainers to check the
dependencies manually.

Part of #5768
2021-07-14 14:29:53 +02:00
Sebastian Rittau
68dc2d132b Move Python 2-only stubs to @python2 directory (#5660) 2021-06-21 11:28:25 -07:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Sebastian Rittau
21e647a184 Document _typeshed (#5501)
* Document _typeshed

Closes: #5486

* Allow README.md files
2021-05-19 22:15:21 +03:00
Sebastian Rittau
54a0bd80ee Add a comment about _typeshed to VERSIONS (#5447) 2021-05-19 11:01:33 +02:00
Sebastian Rittau
35acd2ad6f check_consistent: allow dots in module names (#5472) 2021-05-16 11:01:00 -07:00
Sebastian Rittau
6a4583d0a8 Deprecate pallets stubs (#5424)
Part of #5423

* Support new metadata fields in check_consistent
2021-05-12 19:17:42 +03:00
Sebastian Rittau
1eb64b4372 Mark stdlib modules with upper version bounds (#5394)
* Mark stdlib modules with upper version bounds

* Add minus to all versions and enforce in check_consistent

* Fix check_consistent and mypy_test to work with new VERSIONS format
2021-05-10 16:29:43 +03:00
Ivan Levkivskyi
55549ea01f More consistency checks for dependencies (#4990)
Closes #4988

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-02-01 15:16:53 +00:00
Ivan Levkivskyi
e2fd852952 Add more consistency tests (#4983)
Follow up fo #4971

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-29 17:23:35 +00:00
Ivan Levkivskyi
16ae4c6120 Re-organize directory structure (#4971)
See discussion in #2491

Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-27 12:00:39 +00:00
Shantanu
48970d31de tests / scripts: blacken and isort (#4704)
I often run black and isort in typeshed root and then have to undo these
changes.

Co-authored-by: hauntsaninja <>
2020-10-25 11:21:03 +01:00
Sebastian Rittau
5927e5ca30 Remove most consistency checks and split builtins.pyi into py2/3 files (#4686)
Split builtins.pyi in Python 2 and 3 versions

Partly addresses #4674
2020-10-22 13:39:06 -07:00
Rune Tynan
e49c156d92 Add winreg stubs (#3794) 2020-05-27 17:15:08 +02:00
Shantanu
baf107a158 check_consistent: print a copy-pasteable cp command (#3992) 2020-05-14 08:57:18 +02:00