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.
I generated these using stubgen and made various manual tweaks to fix issues
reported by stubtest.
Some of the submodules with underscore prefixes are used by open source code,
so I'm including them.
Various definitions are platform-specific. I added some sys.platform checks, but
it's hard to get these right. We may need to iterate on them later.
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>`.
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
Basic stubs made with stubgen & manual fixes. Also, reorder
pyrightconfig.stricter.json, I didn't realise it was mostly ordered
when I added to it previously.
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.
A library that provides convenient access to the Stripe API from applications.
It includes a pre-defined set of classes for API resources that initialize themselves
dynamically from API responses.
I started with stubgen, then cleaned up to address missing functions. Testing plan
is to keep an eye on CI and fix any issues that arise.
* run stubgen
* replace individual lexers with __getattr__ in lexers/__init__.pyi
* replace individual styles with __getattr__ in styles/__init__.pyi
* import-export each formatter into formatters/__init__.pyi
* clean up slightly with quick and dirty script
* manual fixing
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
This change will add stubs for pytest-lazyfixture. It is particual useful for projects which type their tests and use pytest-lazyfixture.
The included functions and classes are the scope which can be considered documented by the module. Any other function is related to pytest hook implementations and are normally not called by an user.
Please note, that if a user uses 'pytest.lazy_fixture' these stubs will not work. As recommneded in https://github.com/TvoroG/pytest-lazy-fixture/issues/51 the package needs to imported directly.
Co-authored-by: Akuli <akuviljanen17@gmail.com>