mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-07 18:30:57 +08:00
Add stubs for pygit2 (#11374)
The upstream library is very tricky to type (likely requires nontrivial refactoring), and only contains partial type information, but stubs are a lot easier because only the public signatures are involved this way, so I plan to first make the library usable in typed projects by making stubs available here, then gradually work my way upstream. The stubs are auto-generated then completed with fully manual inspection of every Python source file. The `_pygit2.pyi` comes from upstream and is mostly untouched except for required style changes, the signature of `options()`, and `FilterSource` which is missing from upstream.
This commit is contained in:
17
stubs/pygit2/@tests/stubtest_allowlist.txt
Normal file
17
stubs/pygit2/@tests/stubtest_allowlist.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
# stubtest wrongly checks the Python implementation with the cffi type's
|
||||
# stubs, likely due to name shadowing that happens at import-time
|
||||
pygit2.Repository.__init__
|
||||
pygit2.Repository._from_c
|
||||
# @cached_property that fail to get recognized as such by stubtest
|
||||
pygit2.config.ConfigEntry.level
|
||||
pygit2.config.ConfigEntry.raw_name
|
||||
pygit2.config.ConfigEntry.raw_value
|
||||
# Actual signatures enforced by C-level checks not visible to stubtest
|
||||
pygit2.Mailmap.__init__
|
||||
pygit2.OdbBackend.__init__
|
||||
pygit2.RefLogEntry.__init__
|
||||
pygit2.RefdbBackend.__init__
|
||||
pygit2._pygit2.Mailmap.__init__
|
||||
pygit2._pygit2.OdbBackend.__init__
|
||||
pygit2._pygit2.RefLogEntry.__init__
|
||||
pygit2._pygit2.RefdbBackend.__init__
|
||||
Reference in New Issue
Block a user