Commit Graph
75 Commits
Author SHA1 Message Date
Nikita SobolevandGitHub de8beb1399 Run shellcheck on generate_proto_stubs.sh (#6709) 2021-12-26 23:41:05 +01:00
Sebastian RittauandGitHub 34721fcadc Make create_baseline_stubs script executable (#6511) 2021-12-06 13:49:32 +02:00
Sebastian RittauandGitHub 206e1ae91b Remove 'py3' from requirements filename (#6509) 2021-12-06 12:59:04 +02:00
Nipunn KoorapatiandGitHub 39867f1096 Bump protobuf stub to 3.18.1 and mypy-protobuf 3.0.0 (#6157)
* Bump protobuf stub to 3.18.1 and mypy-protobuf 3.0.0

* Fix ConsumeInteger in google/protobuf/text_format.pyi

The arg was removed in protobuf 3.18
2021-10-12 14:33:22 -07:00
Sebastian RittauandGitHub 9f86972350 Add star to all non-0.1 versions (#6146) 2021-10-11 13:41:19 -07:00
AkuliandGitHub afad78343a change prints in scripts/create_baseline_stubs.py (#6051) 2021-09-19 12:38:23 -07:00
Nipunn KoorapatiandGitHub 581b2d5180 Update protobuf generated stubs from mypy-protobuf 2.8 (#5804) 2021-07-23 16:21:26 -07:00
Jukka LehtosaloandGitHub b3b8daed2e Fix import sorting in create_baseline_stubs script (#5781)
Run isort before black since changes made by isort don't follow stub
conventions.
2021-07-15 13:24:46 +02:00
Jukka LehtosaloandGitHub d85c54dc47 Add simple tool for creating baseline stubs (#5777)
This tool is a simple wrapper around stubgen and other tools that simplifies the
creation of "baseline" stubs with minimal annotation coverage. These stubs allow
basic type checking (e.g. number of arguments, whether X is valid as a base class),
and once we have baseline stubs, it's easy to contribute incremental changes that
add type annotations.

Here's a summary of what the tool does:
1. Check that the package is installed
2. Run stubgen
3. Copy generated stubs to the correct directory under `stubs/`
4. Run black
5. Run isort
6. Generate basic metadata with correct package version
7. Update pyright exclusions (needed since there are missing types)
8. Print suggestions about next steps needed to contribute stubs to typeshed

For example, to generate stubs for `iso8601`, you can run it like this:
```
python scripts/create_baseline_stubs.py iso8601
```

Sometimes the project name is different from the runtime package name. In
this case run the tool with `--package <runtime-package>`.
2021-07-15 11:22:28 +01:00
Nipunn KoorapatiandGitHub 42eec29eed Update proto stubs with latest mypy-protobuf 2.6 (#5753) 2021-07-10 17:10:39 -07:00
ShantanuGitHubhauntsaninja <>
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
Sebastian RittauandGitHub d7d3926b2c Fix generate protobuf script and run formatters (#5605)
* Fix generate protobuf script

* Install and run black and isort
2021-06-09 19:13:31 +03:00
Sebastian RittauandGitHub 8971c242cb Remove migration script; migration has happened (#5446)
* Remove migration script; migration has happened
2021-05-14 19:33:57 +03:00
ShantanuGitHubhauntsaninja <>
3fa5988a2a Fix allowlist updater script (#5375)
Co-authored-by: hauntsaninja <>
2021-05-07 23:13:36 -07:00
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
a1a51f5aac Add another (newly added) package name to ditribution map (#4970)
Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-25 12:25:50 +00:00
83c18117d5 Update known package to distribution map for migration script (#4963)
Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
2021-01-22 16:12:04 +00:00
ShantanuGitHubhauntsaninja <>
c3854d26f6 migrate_script: prefix @ to python2 (#4931)
As suggested by Jukka in https://github.com/python/typeshed/issues/2491

Co-authored-by: hauntsaninja <>
2021-01-15 09:27:30 -08:00
Nipunn KoorapatiandGitHub 4f81ac10ae Update mypy protobuf pin to include well_known_types (#4850) 2020-12-23 09:47:33 +01:00
Nipunn KoorapatiandGitHub 9af49c0b69 Protobuf stubs update using mypy-protobuf (#4785)
* Add script to generate protoc stubs using mypy-protobuf generated stubs

* Use generate_proto_stubs to generate stubs for protobuf 3.14.0

* Skip _pb2.pyi from flake8,black,isort,pytype
2020-11-25 10:48:26 -08:00
Sebastian RittauandGitHub d2a7889fe0 Drop support for Python 3.5 (#4675)
Python 3.5 EOL was on 2020-09-30.
2020-11-02 16:18:20 +01:00
ShantanuGitHubhauntsaninja <>
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
ShantanuGitHubhauntsaninja <>
734d91f90b update-stubtest-whitelist: fix type errors (#4581)
Co-authored-by: hauntsaninja <>
2020-09-26 07:33:57 +02:00
Sebastian RittauandGitHub 6acf0ef5f2 Create a PR when there are unused stubtest whitelist entries (#4334) 2020-07-18 14:48:55 +02:00
Ivan LevkivskyiandGitHub 5c7cf9f75c Script for modular typeshed migration (#4259)
This reshuffles directory structure according to the specification in https://github.com/python/typeshed/issues/2491#issuecomment-611607557
2020-07-01 12:36:23 +01:00