Commit Graph

24 Commits

Author SHA1 Message Date
Alex Waygood
98af7d667f Improve stubs for sequence types (#6386) 2021-11-26 19:09:38 -08:00
Sebastian Rittau
5b668419ae Fix MutableMapping overrides (#6352) 2021-11-21 07:04:40 -08:00
Nipunn Koorapati
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 Rittau
9f86972350 Add star to all non-0.1 versions (#6146) 2021-10-11 13:41:19 -07:00
Nipunn Koorapati
581b2d5180 Update protobuf generated stubs from mypy-protobuf 2.8 (#5804) 2021-07-23 16:21:26 -07:00
Nipunn Koorapati
6d6250f109 Supported repeated field containers for extensions (#5788)
See https://github.com/dropbox/mypy-protobuf/issues/244 for the
inspiration for this. Repeated extensions are allowed by protobuf,
and they generate to extension values with repeated fields.

Notably map fields (ScalarMap and MessageMap) are NOT allowed to be
extension values - producing errors as such - so those are omitted.

testproto/test_extensions3.proto:19:6: Map fields are not allowed to be extensions.
2021-07-16 10:11:42 -07:00
Nipunn Koorapati
5199ed5bd8 Upper bound protobuf containers based on scalar/composite (#5787) 2021-07-15 22:28:16 -07:00
Nipunn Koorapati
4765978f6c Support arbitrary values for extension values (#5774)
Proto itself supports primitives, not just messages.
See https://github.com/dropbox/mypy-protobuf/issues/244 for an example
motivating this change.

Test Plan: I was able to use MYPYPATH to test an updated version of
mypy-protobuf with this change.
2021-07-13 21:13:45 -07:00
Nipunn Koorapati
42eec29eed Update proto stubs with latest mypy-protobuf 2.6 (#5753) 2021-07-10 17:10:39 -07:00
Nipunn Koorapati
276c225cd9 Remove FieldDescriptor fallback for protobuf extension methods (#5754)
It was there for compatibility to older versions of mypy-protobuf.
With modular typeshed, this sort of straddling code will no longer
be necessary! Thanks @ilevkivskyi
2021-07-11 00:28:46 +02:00
Nipunn Koorapati
c5dd23ac0d Allow unicode and bytes in EnumTypeWrapper.Value (#5743) 2021-07-09 11:22:38 +02:00
Shantanu
7244ea1f71 Test third party stubs with stubtest (#5615) 2021-06-13 00:17:40 +02:00
Sebastian Rittau
711580722b Enable pyright for all Python 3 stubs (#5597)
* pyright: disable reportUnknownParameterType

Unknown parameter types are preferred over Any annotations for
incomplete stubs. Especially larger stubs are expected to be
incomplete for some time and it would be a shame to lose the
other pyright warnings for those stubs.

* Also disable reportUnknownVariableType

Fix problems with tkinter

* Disable reportUnknownMemberType

Fix pyright problems
2021-06-09 07:14:22 -07:00
Jukka Lehtosalo
a5e243fbcd Change some str types to Text in google.protobuf.text_format (#5343)
Python 2 `unicode` values are supported. For example:
https://github.com/protocolbuffers/protobuf/blob/master/python/google/protobuf/text_format.py#L843
2021-05-05 09:33:59 +01:00
Jukka Lehtosalo
fe4acabdd7 Allow bytes in addition to str in google.protobuf.text_format (#5267) 2021-04-30 15:46:29 +02:00
Sebastian Rittau
4ac3ccad45 black: enable skip_magic_trailing_comma (#5252)
* black: enable skip_magic_trailing_comma

* Remove spurious commas
2021-04-27 08:32:32 -07:00
Shantanu
fc660d6d41 Move typing_extensions to stdlib (#5233)
I'm not sure what the best way to do this is. This effectively orphans
types-typing-extensions, but maybe that's not really a problem. (We can
yank the package too)

See https://github.com/python/typeshed/pull/5229#issuecomment-822234125
for some details

Co-authored-by: hauntsaninja <>
2021-04-20 21:55:48 -07:00
heroesm
2aff78dac2 Fix protobuf json_format signatures. (#5226) 2021-04-19 14:59:48 +02:00
Shantanu
fa9d5a5e9f future first: switch the order of some if statements (#5206)
Since we're adding this to our contribution guidelines in
https://github.com/python/typeshed/pull/5205
2021-04-11 06:44:18 -07:00
hatal175
5fef564636 Protobuf text_format stubs (#5167)
Fixes #1781
2021-04-08 18:02:38 -07:00
Dante Camarena
1d1d35c87a Updated descriptor.pyi in protobuf stubs. (#5007) 2021-02-22 15:15:44 +01:00
Alexander Reynolds
0b1cd59896 Updated protobuf descriptor pool (#5018) 2021-02-13 11:23:26 +01:00
Nipunn Koorapati
a3b3f6845b Allow unicode and bytes in the EnumTypeWrapper.Value classmethod (#5004)
Here is a unit test which shows that this behavior is accepted
by protobuf itself at runtime in both py2 and py3
https://github.com/dropbox/mypy-protobuf/pull/205
2021-02-04 15:03:37 +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