Registry / devops / types-pygit2

types-pygit2

JSON →
library1.15.0.20250319pypypiunverified

Typing stubs for pygit2, providing type hints for libgit2 bindings. These stubs are auto-generated by typeshed and should be installed alongside pygit2 for static type checking. Version 1.15.0.20250319 follows pygit2's major version; release cadence is tied to pygit2 updates and typeshed maintenance.

pip install types-pygit2
INSTALL
IMPORT
SIG · TYPES-PYGIT2
T
types-pygit2
devopspythonv1.15.0.20250319
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Repository
from pygit2-stubs import Repository
from pygit2 import Repository

Quick example showing how to use pygit2 with type stubs enabled.

import os from pygit2 import Repository, init_repository # Get a repository path (use env var for auth-free example) repo_path = os.environ.get('REPO_PATH', '/tmp/test_repo') # Initialize a new bare repository repo = init_repository(repo_path, bare=True) # Open an existing repository repo = Repository(repo_path) print(repo.path)
Debug
Known issues
gotchaEnsure pygit2 and types-pygit2 versions are compatible. The stubs major.minor version corresponds to pygit2's (e.g., 1.15.x stubs for pygit2 1.15.x). Mismatched versions may cause type errors or missing hints.
fix
Keep both packages at matching major.minor versions: pip install pygit2==1.15.* types-pygit2==1.15.*
affects: all
deprecatedSome older pygit2 APIs may not be fully covered by stubs. For example, the old branch lookup API using a string for branch type may not have accurate stubs.
fix
Update to pygit2 1.15+ and use the new API when possible. Refer to pygit2 migration guide.
affects: <1.15.0
gotchatypes-pygit2 is a third-party stub package (part of typeshed). It is not officially maintained by libgit2/pygit2 authors, so stubs may lag behind pygit2 releases.
fix
If you encounter missing stubs, consider contributing to typeshed or using inline type comments as a workaround.
affects: all
Upgrade
Version history
1.15.0.20250319latest on PyPI · released Mar 19, 2025
Audit
Dependencies
pygit2requiredProvides actual runtime library; stubs only provide type hints.
Agent activity
10 hits · last 30 days
node
10
Resources
types-pygit2 — pip install types-pygit2 · libregistry