pygit2 1.19.2__tar.gz → 1.19.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pygit2-1.19.3/AGENTS.md +279 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/AUTHORS.md +2 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/CHANGELOG.md +25 -0
- pygit2-1.19.3/CONTRIBUTING.md +91 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/COPYING +2 -3
- {pygit2-1.19.2 → pygit2-1.19.3}/Makefile +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/PKG-INFO +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/build.ps1 +2 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/build.sh +5 -5
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/_build.py +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/_pygit2.pyi +147 -134
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/callbacks.py +4 -5
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/enums.py +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/index.py +3 -3
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/repository.py +7 -7
- {pygit2-1.19.2 → pygit2-1.19.3}/pyproject.toml +7 -7
- {pygit2-1.19.2 → pygit2-1.19.3}/src/odb.c +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/src/odb_backend.c +10 -2
- {pygit2-1.19.2 → pygit2-1.19.3}/src/refdb_backend.c +13 -6
- {pygit2-1.19.2 → pygit2-1.19.3}/src/repository.c +1 -1
- {pygit2-1.19.2 → pygit2-1.19.3}/src/utils.h +0 -17
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_refdb_backend.py +1 -4
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_repository.py +13 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/README.md +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/SPONSORS.md +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/build_tag.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/mypy-stubtest.ini +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/mypy.ini +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/__init__.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/_libgit2/ffi.pyi +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/_run.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/blame.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/blob.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/branches.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/config.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/credentials.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/attr.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/blame.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/buffer.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/callbacks.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/checkout.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/clone.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/commit.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/common.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/config.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/describe.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/diff.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/errors.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/filter.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/graph.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/index.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/indexer.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/merge.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/net.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/oid.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/options.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/pack.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/proxy.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/refspec.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/remote.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/repository.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/revert.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/stash.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/strarray.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/submodule.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/transaction.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/transport.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/decl/types.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/errors.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/ffi.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/filter.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/legacyenums.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/options.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/packbuilder.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/py.typed +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/references.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/refspec.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/remotes.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/settings.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/submodules.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/transaction.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pygit2/utils.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/pytest.ini +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/requirements-test.txt +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/requirements-typing.txt +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/requirements-wheel.txt +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/requirements.txt +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/setup.cfg +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/setup.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/blob.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/branch.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/branch.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/commit.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/diff.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/diff.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/error.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/error.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/filter.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/filter.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/mailmap.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/mailmap.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/note.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/note.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/object.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/object.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/odb.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/odb_backend.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/oid.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/oid.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/patch.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/patch.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/pygit2.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/refdb.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/refdb.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/refdb_backend.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/reference.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/reference.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/repository.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/revspec.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/revspec.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/signature.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/signature.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/stash.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/tag.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/tree.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/tree.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/treebuilder.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/treebuilder.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/types.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/utils.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/walker.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/walker.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/wildmatch.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/wildmatch.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/worktree.c +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/src/worktree.h +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/__init__.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/conftest.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/barerepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/binaryfilerepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/blameflagsrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/dirtyrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/emptyrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/encoding.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/gpgsigned.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/submodulerepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/testrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/testrepoformerging.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/testrepopacked.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/trailerrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/data/utf8branchrepo.zip +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/keys/pygit2_empty +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/keys/pygit2_empty.pub +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_apply_diff.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_archive.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_attributes.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_blame.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_blob.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_branch.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_branch_empty.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_cherrypick.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_commit.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_commit_gpg.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_commit_trailer.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_config.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_credentials.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_describe.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_diff.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_diff_binary.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_filter.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_index.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_mailmap.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_merge.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_nonunicode.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_note.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_object.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_odb.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_odb_backend.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_oid.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_options.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_packbuilder.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_patch.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_patch_encoding.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_refs.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_remote.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_remote_prune.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_remote_utf8.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_repository_bare.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_repository_custom.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_repository_empty.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_revparse.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_revwalk.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_settings.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_signature.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_status.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_submodule.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_tag.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_transaction.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_tree.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/test_treebuilder.py +0 -0
- {pygit2-1.19.2 → pygit2-1.19.3}/test/utils.py +0 -0
pygit2-1.19.3/AGENTS.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# pygit2 Agent Guide
|
|
2
|
+
|
|
3
|
+
## Project Overview
|
|
4
|
+
|
|
5
|
+
**pygit2** is a Python library that provides bindings to
|
|
6
|
+
[libgit2](https://libgit2.org/), the shared C library that implements Git
|
|
7
|
+
plumbing operations. It exposes both a low-level API (direct libgit2 wrappers)
|
|
8
|
+
and a high-level, Pythonic API for repository manipulation.
|
|
9
|
+
|
|
10
|
+
- **Version**: 1.19.3 (canonical version is defined in `pygit2/_build.py`)
|
|
11
|
+
- **License**: GPLv2 with linking exception (see `COPYING`)
|
|
12
|
+
- **Maintainer**: J. David Ibáñez
|
|
13
|
+
- **Python Support**: 3.11 – 3.14 and PyPy3 7.3+
|
|
14
|
+
- **libgit2 Version**: 1.9.4
|
|
15
|
+
- **Homepage**: <https://www.pygit2.org/>
|
|
16
|
+
- **Repository**: <https://github.com/libgit2/pygit2>
|
|
17
|
+
|
|
18
|
+
## Architecture
|
|
19
|
+
|
|
20
|
+
The project uses a **hybrid C/Python** architecture with two compiled extension
|
|
21
|
+
modules:
|
|
22
|
+
|
|
23
|
+
- **`src/`** — C11 source and header files that compile into the `_pygit2` C
|
|
24
|
+
extension module. Each file generally maps to a libgit2 concept:
|
|
25
|
+
- Core objects: `blob.c`, `commit.c`, `object.c`, `tag.c`, `tree.c`
|
|
26
|
+
- Repository, refs and branches: `repository.c`, `branch.c`, `reference.c`,
|
|
27
|
+
`refdb.c`, `refdb_backend.c`, `revspec.c`, `worktree.c`
|
|
28
|
+
- Diff and patch: `diff.c`, `patch.c`
|
|
29
|
+
- ODB and backends: `odb.c`, `odb_backend.c`
|
|
30
|
+
- Index, walking and helpers: `treebuilder.c`, `walker.c`, `oid.c`,
|
|
31
|
+
`note.c`, `signature.c`, `mailmap.c`, `stash.c`
|
|
32
|
+
- Filters: `filter.c`
|
|
33
|
+
- Module infrastructure: `pygit2.c`, `error.c`, `utils.c`, `wildmatch.c`
|
|
34
|
+
- Headers: `*.h` files mirroring the C sources (e.g. `repository.h`,
|
|
35
|
+
`diff.h`, `types.h`, `error.h`)
|
|
36
|
+
|
|
37
|
+
- **`pygit2/`** — The main Python package.
|
|
38
|
+
- **`_pygit2*.so`** — Compiled C extension built from `src/`.
|
|
39
|
+
- **`_libgit2.abi3.so`** — CFFI-generated ABI module built from
|
|
40
|
+
`pygit2/_run.py`.
|
|
41
|
+
- **`decl/`** — C header stub files used by CFFI to define the libgit2 API
|
|
42
|
+
surface (e.g. `types.h`, `repository.h`, `callbacks.h`, `diff.h`,
|
|
43
|
+
`remote.h`). `pygit2/_run.py` concatenates these stubs in a specific order
|
|
44
|
+
before passing them to CFFI.
|
|
45
|
+
- **`_build.py`** — Build-time helpers and the canonical `__version__`
|
|
46
|
+
string. Also used at runtime to locate libgit2. It must remain importable
|
|
47
|
+
without the rest of the package being built because `setup.py` imports it.
|
|
48
|
+
- **`_run.py`** — CFFI build script that aggregates `decl/*.h` and compiles
|
|
49
|
+
`pygit2._libgit2`.
|
|
50
|
+
- **`ffi.py`** — Runtime import of the CFFI `ffi` and `lib` (`C`) objects.
|
|
51
|
+
- **`_pygit2.pyi`** — Type stubs for the C extension. Keep it in sync when
|
|
52
|
+
adding or changing low-level APIs.
|
|
53
|
+
- **`py.typed`** — PEP 561 marker indicating the package is typed.
|
|
54
|
+
- **High-level modules** — Pure-Python wrappers that sit on top of the C
|
|
55
|
+
extension:
|
|
56
|
+
`repository.py`, `callbacks.py`, `config.py`, `index.py`, `remotes.py`,
|
|
57
|
+
`settings.py`, `submodules.py`, `transaction.py`, `filter.py`, `blob.py`,
|
|
58
|
+
`blame.py`, `branches.py`, `credentials.py`, `errors.py`, `options.py`,
|
|
59
|
+
`packbuilder.py`, `references.py`, `refspec.py`, `utils.py`, `enums.py`,
|
|
60
|
+
`legacyenums.py`.
|
|
61
|
+
|
|
62
|
+
- **`test/`** — pytest suite with fixture-based repository handling.
|
|
63
|
+
- **`docs/`** — Sphinx documentation (RTD theme).
|
|
64
|
+
|
|
65
|
+
## Key Configuration Files
|
|
66
|
+
|
|
67
|
+
- **`setup.py`** — setuptools entry point. Builds both the C extension
|
|
68
|
+
(`src/*.c`) and the CFFI extension (`pygit2/_run.py:ffi`).
|
|
69
|
+
- **`pyproject.toml`** — Build-system requirements, `cibuildwheel`
|
|
70
|
+
configuration, `ruff` settings, and `codespell` settings.
|
|
71
|
+
- **`setup.cfg`** — Legacy pycodestyle configuration.
|
|
72
|
+
- **`pytest.ini`** — pytest configuration (`--capture=no -ra --verbose`,
|
|
73
|
+
`testpaths = test/`).
|
|
74
|
+
- **`mypy.ini`** — mypy configuration with strict settings.
|
|
75
|
+
- **`mypy-stubtest.ini`** — mypy configuration for `stubtest` against
|
|
76
|
+
`_pygit2.pyi`.
|
|
77
|
+
- **`requirements.txt`** — Runtime/build requirements (`cffi>=2.0`,
|
|
78
|
+
`setuptools` for Python >= 3.12).
|
|
79
|
+
- **`requirements-test.txt`** — Test requirements (`pytest`, `pytest-cov`).
|
|
80
|
+
- **`requirements-typing.txt`** — Typing requirements (`mypy`, `types-cffi`).
|
|
81
|
+
- **`Makefile`** — Convenience targets: `make` builds dependencies + extension
|
|
82
|
+
inplace; `make html` builds docs.
|
|
83
|
+
- **`.vimrc`** — Local editor configuration for C development with ALE
|
|
84
|
+
(`-std=c11 -Wall`, Python include path, `/usr/local/include`).
|
|
85
|
+
|
|
86
|
+
## Build and Test Commands
|
|
87
|
+
|
|
88
|
+
### Quick Development Build (inplace)
|
|
89
|
+
|
|
90
|
+
Requires libgit2 development headers and library to be installed on the system
|
|
91
|
+
or pointed to via the `LIBGIT2` environment variable.
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python setup.py build_ext --inplace
|
|
95
|
+
pytest
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Full Build with Dependencies
|
|
99
|
+
|
|
100
|
+
The `build.sh` script can download, compile, and bundle libgit2 (and optionally
|
|
101
|
+
libssh2, OpenSSL, and zlib) into a local prefix. On Windows, `build.ps1`
|
|
102
|
+
handles libgit2 compilation via CMake.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# Build inplace with bundled libgit2/libssh2/OpenSSL
|
|
106
|
+
make
|
|
107
|
+
|
|
108
|
+
# Or manually:
|
|
109
|
+
LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.4 sh build.sh
|
|
110
|
+
|
|
111
|
+
# Build inplace and run the tests
|
|
112
|
+
sh build.sh test
|
|
113
|
+
|
|
114
|
+
# Build a wheel, install it, and run the tests
|
|
115
|
+
sh build.sh wheel
|
|
116
|
+
|
|
117
|
+
# Run tests with coverage
|
|
118
|
+
sh build.sh test # build.sh adds --cov=pygit2
|
|
119
|
+
|
|
120
|
+
# Run mypy type checking
|
|
121
|
+
sh build.sh mypy
|
|
122
|
+
|
|
123
|
+
# Run stubtest against the .pyi file
|
|
124
|
+
sh build.sh stubtest
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`build.sh` creates a virtual environment under `ci/<python_tag>/` by default,
|
|
128
|
+
where `<python_tag>` is computed by `build_tag.py`. Use the `PYTHON`
|
|
129
|
+
environment variable to select a different interpreter (default: `python3`).
|
|
130
|
+
|
|
131
|
+
### Environment Variables
|
|
132
|
+
|
|
133
|
+
Variables consumed by `setup.py` / `pygit2/_build.py`:
|
|
134
|
+
|
|
135
|
+
- `LIBGIT2` — Base path where libgit2 is installed (default: `/usr/local` or
|
|
136
|
+
`%ProgramFiles%\libgit2` on Windows).
|
|
137
|
+
- `LIBGIT2_LIB` — Override the library directory specifically.
|
|
138
|
+
|
|
139
|
+
Variables consumed by `build.sh`:
|
|
140
|
+
|
|
141
|
+
- `LIBGIT2_VERSION` — If set, download and build this libgit2 version.
|
|
142
|
+
- `LIBSSH2_VERSION` — If set, download and build libssh2 with SSH support.
|
|
143
|
+
- `OPENSSL_VERSION` — If set, download and build OpenSSL (mainly used for
|
|
144
|
+
macOS universal builds on CI).
|
|
145
|
+
- `ZLIB_VERSION` — If set, download and build zlib.
|
|
146
|
+
- `BUILD_TYPE` — CMake build type (default: `Debug`).
|
|
147
|
+
- `PYTHON` — Python interpreter to use (default: `python3`).
|
|
148
|
+
- `PREFIX` — Installation prefix (default: `$(pwd)/ci/$PYTHON_TAG`).
|
|
149
|
+
- `CIBUILDWHEEL` — Set to `1` when invoked by cibuildwheel; changes package
|
|
150
|
+
manager and directory layout.
|
|
151
|
+
- `AUDITWHEEL_PLAT` — Linux platform for auditwheel repair.
|
|
152
|
+
- `LIBSSH2_OPENSSL` — Where to find OpenSSL when building libssh2.
|
|
153
|
+
|
|
154
|
+
### Documentation Build
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Build the extension first, then docs
|
|
158
|
+
make # builds deps + extension
|
|
159
|
+
make -C docs html # requires sphinx-rtd-theme
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Code Style Guidelines
|
|
163
|
+
|
|
164
|
+
### Python
|
|
165
|
+
|
|
166
|
+
- **Formatter / Linter**: [ruff](https://docs.astral.sh/ruff/)
|
|
167
|
+
- Target Python: 3.11+
|
|
168
|
+
- Quote style: single quotes
|
|
169
|
+
- Selected rules: `E4`, `E7`, `E9`, `F`, `I`, `UP035`, `UP007`
|
|
170
|
+
- **Type checker**: mypy (strict settings enabled; see `mypy.ini`)
|
|
171
|
+
- All Python source files must include the standard GPLv2 copyright header.
|
|
172
|
+
- `pygit2/__init__.py` is large because it re-exports a large surface of
|
|
173
|
+
constants and classes; follow existing patterns when adding new public
|
|
174
|
+
symbols.
|
|
175
|
+
|
|
176
|
+
### C
|
|
177
|
+
|
|
178
|
+
- Standard: C11
|
|
179
|
+
- All C source files must include the standard GPLv2 copyright header.
|
|
180
|
+
- The `.vimrc` at repo root configures ALE with `-std=c11 -Wall` and includes
|
|
181
|
+
the Python headers and `/usr/local/include`.
|
|
182
|
+
|
|
183
|
+
### Docstrings
|
|
184
|
+
|
|
185
|
+
Use the following style (from `docs/development.rst`):
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
def f(a, b):
|
|
189
|
+
"""
|
|
190
|
+
The general description goes here.
|
|
191
|
+
|
|
192
|
+
Returns: bla bla.
|
|
193
|
+
|
|
194
|
+
Parameters:
|
|
195
|
+
|
|
196
|
+
a : <type>
|
|
197
|
+
Bla bla.
|
|
198
|
+
|
|
199
|
+
b : <type>
|
|
200
|
+
Bla bla.
|
|
201
|
+
|
|
202
|
+
Examples::
|
|
203
|
+
|
|
204
|
+
>>> f(...)
|
|
205
|
+
"""
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Testing Instructions
|
|
209
|
+
|
|
210
|
+
- **Runner**: pytest
|
|
211
|
+
- **Configuration**: `pytest.ini`
|
|
212
|
+
```ini
|
|
213
|
+
[pytest]
|
|
214
|
+
addopts = --capture=no -ra --verbose
|
|
215
|
+
testpaths = test/
|
|
216
|
+
```
|
|
217
|
+
- **Fixtures**: Defined in `test/conftest.py`. They yield `pygit2.Repository`
|
|
218
|
+
instances extracted from zipped sample repos in `test/data/` (e.g.
|
|
219
|
+
`testrepo.zip`, `barerepo.zip`). Named fixtures include `testrepo`,
|
|
220
|
+
`testrepo_path`, `barerepo`, `barerepo_path`, `emptyrepo`, `dirtyrepo`,
|
|
221
|
+
`mergerepo`, `encodingrepo`, `testrepopacked`, `gpgsigned`, `blameflagsrepo`,
|
|
222
|
+
and `pygit2_empty_key`.
|
|
223
|
+
- **Test utilities**: `test/utils.py` provides helpers such as
|
|
224
|
+
`TemporaryRepository`, `gen_blob_sha1`, `rmtree`, `diff_safeiter`, and
|
|
225
|
+
markers like `requires_network`, `requires_proxy`, `requires_ssh`,
|
|
226
|
+
`requires_refcount`, `fails_in_macos`, and `requires_future_libgit2`.
|
|
227
|
+
- **Isolation**: The session-scoped `global_git_config` fixture clears
|
|
228
|
+
`GLOBAL`, `XDG`, and `SYSTEM` config search paths to ensure reproducibility.
|
|
229
|
+
- **Coverage**: `pytest-cov` is used; run via `sh build.sh test`.
|
|
230
|
+
|
|
231
|
+
## CI / Deployment
|
|
232
|
+
|
|
233
|
+
GitHub Actions workflows live in `.github/workflows/`:
|
|
234
|
+
|
|
235
|
+
- **`tests.yml`** — Runs on s390x via QEMU (`uraimo/run-on-arch-action`).
|
|
236
|
+
Allowed to fail; see issue #812.
|
|
237
|
+
- **`lint.yml`** — Runs `ruff format --diff`, `ruff check`, and
|
|
238
|
+
`sh build.sh mypy`.
|
|
239
|
+
- **`wheels.yml`** — Uses `cibuildwheel` to build wheels for Linux (amd64,
|
|
240
|
+
arm64, ppc64le, musl), macOS (intel, arm64, PyPy), and Windows (x64, x86,
|
|
241
|
+
arm64). It also builds an sdist, runs a `twine check`, publishes to PyPI,
|
|
242
|
+
and creates a GitHub Release on version tags (`v*`).
|
|
243
|
+
- **`codespell.yml`** — Spell checking with the codespell action.
|
|
244
|
+
|
|
245
|
+
The `cibuildwheel` configuration in `pyproject.toml` pins:
|
|
246
|
+
|
|
247
|
+
- `LIBGIT2_VERSION="1.9.4"`
|
|
248
|
+
- `LIBSSH2_VERSION="1.11.1"`
|
|
249
|
+
- `OPENSSL_VERSION="3.5.4"`
|
|
250
|
+
|
|
251
|
+
and skips `*musllinux_ppc64le` plus testing on `*-*linux_ppc64le` and
|
|
252
|
+
`pp*-macosx_arm64`.
|
|
253
|
+
|
|
254
|
+
## Security Considerations
|
|
255
|
+
|
|
256
|
+
- The project links against OpenSSL and libssh2. CI pins specific versions of
|
|
257
|
+
these libraries when building wheels.
|
|
258
|
+
- Wheel repair commands (`auditwheel`, `delocate-wheel`) bundle shared
|
|
259
|
+
libraries so wheels are self-contained.
|
|
260
|
+
- Credentials callbacks (`RemoteCallbacks`, `get_credentials`) are the primary
|
|
261
|
+
interface for supplying secrets; never hardcode credentials in tests.
|
|
262
|
+
- Valgrind support: see `docs/development.rst` and
|
|
263
|
+
`misc/valgrind-python.supp` for memory-leak debugging instructions.
|
|
264
|
+
|
|
265
|
+
## Useful Notes for Agents
|
|
266
|
+
|
|
267
|
+
- **Do not assume libgit2 is installed globally.** Check for `LIBGIT2` or use
|
|
268
|
+
`build.sh` / `make`.
|
|
269
|
+
- **`pygit2/_build.py`** is imported by `setup.py`; it must remain importable
|
|
270
|
+
without the rest of the package being built.
|
|
271
|
+
- **CFFI and setuptools extensions are both built from `setup.py`.**
|
|
272
|
+
`ext_modules` builds the C extension from `src/*.c`; `cffi_modules` triggers
|
|
273
|
+
the CFFI build via `pygit2/_run.py:ffi`.
|
|
274
|
+
- **`.pyi` stub file**: `pygit2/_pygit2.pyi` provides type stubs for the C
|
|
275
|
+
extension. Keep it in sync when adding or changing low-level APIs.
|
|
276
|
+
- **Header stub order matters**: `pygit2/_run.py` concatenates `decl/*.h` in a
|
|
277
|
+
fixed list; add new stubs in the correct position if dependencies require it.
|
|
278
|
+
- Run the full test suite and type checks before considering a change complete:
|
|
279
|
+
`sh build.sh test` and `sh build.sh mypy`.
|
|
@@ -74,6 +74,7 @@ Authors:
|
|
|
74
74
|
Christian Häggström
|
|
75
75
|
Edmundo Carmona Antoranz
|
|
76
76
|
Erik Johnson
|
|
77
|
+
Ethan Meng
|
|
77
78
|
Filip Rindler
|
|
78
79
|
Fraser Tweedale
|
|
79
80
|
Grégoire ROCHER
|
|
@@ -206,6 +207,7 @@ Authors:
|
|
|
206
207
|
Matěj Cepl
|
|
207
208
|
Maxwell G
|
|
208
209
|
Michał Górny
|
|
210
|
+
Mukunda Rao Katta
|
|
209
211
|
Na'aman Hirschfeld
|
|
210
212
|
Nicolas Rybowski
|
|
211
213
|
Nicolás Sanguinetti
|
|
@@ -1,3 +1,28 @@
|
|
|
1
|
+
# 1.19.3 (2026-06-13)
|
|
2
|
+
|
|
3
|
+
- Memory fixes
|
|
4
|
+
[#1368](https://github.com/libgit2/pygit2/issues/1368)
|
|
5
|
+
[#1417](https://github.com/libgit2/pygit2/issues/1417)
|
|
6
|
+
[#1443](https://github.com/libgit2/pygit2/issues/1443)
|
|
7
|
+
|
|
8
|
+
- Fix `Repository.ident`
|
|
9
|
+
[#1461](https://github.com/libgit2/pygit2/pull/1461)
|
|
10
|
+
|
|
11
|
+
- Build/CI fixes and updates
|
|
12
|
+
[#1454](https://github.com/libgit2/pygit2/issues/1454)
|
|
13
|
+
[#1459](https://github.com/libgit2/pygit2/pull/1459)
|
|
14
|
+
|
|
15
|
+
- Documentation and annotation fixes
|
|
16
|
+
[#410](https://github.com/libgit2/pygit2/issues/410)
|
|
17
|
+
[#1289](https://github.com/libgit2/pygit2/issues/1289)
|
|
18
|
+
[#1323](https://github.com/libgit2/pygit2/issues/1323)
|
|
19
|
+
[#1333](https://github.com/libgit2/pygit2/issues/1333)
|
|
20
|
+
[#1458](https://github.com/libgit2/pygit2/issues/1458)
|
|
21
|
+
[#1460](https://github.com/libgit2/pygit2/pull/1460)
|
|
22
|
+
|
|
23
|
+
- Add `AGENTS.md` file generated by Kimi-k2.6
|
|
24
|
+
|
|
25
|
+
|
|
1
26
|
# 1.19.2 (2026-03-29)
|
|
2
27
|
|
|
3
28
|
- Fix refcount and error handling issues in `filter_register(...)`
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Contributing to pygit2
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in improving pygit2! This document covers how to submit pull requests and help others in the community.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Pull Requests
|
|
8
|
+
|
|
9
|
+
We welcome pull requests that fix bugs, add features, improve documentation, or clean up code. To ensure a smooth review process, please follow the steps below.
|
|
10
|
+
|
|
11
|
+
### Development Setup
|
|
12
|
+
|
|
13
|
+
See the [install documentation](https://www.pygit2.org/install.html) for instructions on building pygit2 and its libgit2 dependency.
|
|
14
|
+
|
|
15
|
+
### Making Changes
|
|
16
|
+
|
|
17
|
+
1. **Fork the repository** and create a feature branch.
|
|
18
|
+
2. **Follow the existing code style** (see below).
|
|
19
|
+
3. **Add or update tests** for any new or changed behavior. Tests live in `test/` and are run with `pytest`.
|
|
20
|
+
4. **Update type stubs** (`pygit2/_pygit2.pyi`) if you modify the C extension's public API.
|
|
21
|
+
5. **Update `pygit2/__init__.py`** if you add new public symbols that should be re-exported.
|
|
22
|
+
6. **Ensure the test suite passes**:
|
|
23
|
+
```bash
|
|
24
|
+
pytest
|
|
25
|
+
```
|
|
26
|
+
7. **Run the linters and type checker**:
|
|
27
|
+
```bash
|
|
28
|
+
ruff format --diff
|
|
29
|
+
ruff check
|
|
30
|
+
sh build.sh mypy # or: mypy
|
|
31
|
+
sh build.sh stubtest # validate .pyi stubs
|
|
32
|
+
```
|
|
33
|
+
8. **Build the documentation** if you changed it (requires `sphinx-rtd-theme`):
|
|
34
|
+
```bash
|
|
35
|
+
make -C docs html
|
|
36
|
+
```
|
|
37
|
+
9. **Write a clear commit message** explaining the *what* and *why*.
|
|
38
|
+
|
|
39
|
+
### Code Style
|
|
40
|
+
|
|
41
|
+
- **Python:** We target Python 3.11+. Use single quotes. Run `ruff format` and `ruff check` before submitting.
|
|
42
|
+
- **C:** We use C11. Follow `-std=c11 -Wall`. Match the style of the surrounding code in `src/`.
|
|
43
|
+
- **Copyright headers:** All source files must include the standard GPLv2 copyright header. Copy it from an existing file.
|
|
44
|
+
- **Docstrings:** Use the style shown in `docs/development.rst`:
|
|
45
|
+
```python
|
|
46
|
+
def f(a, b):
|
|
47
|
+
"""
|
|
48
|
+
The general description goes here.
|
|
49
|
+
|
|
50
|
+
Returns: bla bla.
|
|
51
|
+
|
|
52
|
+
Parameters:
|
|
53
|
+
|
|
54
|
+
a : <type>
|
|
55
|
+
Bla bla.
|
|
56
|
+
|
|
57
|
+
b : <type>
|
|
58
|
+
Bla bla.
|
|
59
|
+
"""
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Pull Request Review
|
|
63
|
+
|
|
64
|
+
- All PRs require review from a maintainer.
|
|
65
|
+
- CI will run tests, linting, and type checks automatically.
|
|
66
|
+
- Be responsive to feedback and willing to iterate.
|
|
67
|
+
- Keep PRs focused. A pull request that does one thing well is easier to review than a large, mixed one.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Helping Others
|
|
72
|
+
|
|
73
|
+
You do not need to write code to contribute. Helping others is valuable:
|
|
74
|
+
|
|
75
|
+
- **Answer questions** in open issues and pull requests. If you know the answer, share it.
|
|
76
|
+
- **Review PRs.** Even if you are not a maintainer, constructive reviews from the community are welcome.
|
|
77
|
+
- **Improve documentation.** Doc fixes, clarifications, and typo corrections can be submitted as PRs just like code.
|
|
78
|
+
- **Reproduce reported issues.** Confirming a bug on your system helps maintainers prioritize fixes.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Commit Messages
|
|
83
|
+
|
|
84
|
+
- Use the present tense and imperative mood (e.g., "Add support for…", not "Added support for…").
|
|
85
|
+
- Keep the subject line under 72 characters.
|
|
86
|
+
- Reference related issues with `Fixes #123` or `Closes #456` when applicable.
|
|
87
|
+
- If you used AI assistance while preparing the change, mention it in the commit message with a tag such as `Assisted-by: Kimi-k2.6` (or the appropriate model name).
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
Thank you for contributing!
|
|
@@ -316,9 +316,8 @@ the "copyright" line and a pointer to where the full notice is found.
|
|
|
316
316
|
Copyright (C) <year> <name of author>
|
|
317
317
|
|
|
318
318
|
This program is free software; you can redistribute it and/or modify
|
|
319
|
-
it under the terms of the GNU General Public License
|
|
320
|
-
the Free Software Foundation
|
|
321
|
-
(at your option) any later version.
|
|
319
|
+
it under the terms of the GNU General Public License, version 2,
|
|
320
|
+
as published by the Free Software Foundation.
|
|
322
321
|
|
|
323
322
|
This program is distributed in the hope that it will be useful,
|
|
324
323
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
#
|
|
23
23
|
# sh build.sh
|
|
24
24
|
#
|
|
25
|
-
# Build libgit2 1.9.
|
|
25
|
+
# Build libgit2 1.9.4 (will use libssh2 if available), then build pygit2
|
|
26
26
|
# inplace:
|
|
27
27
|
#
|
|
28
|
-
# LIBGIT2_VERSION=1.9.
|
|
28
|
+
# LIBGIT2_VERSION=1.9.4 sh build.sh
|
|
29
29
|
#
|
|
30
|
-
# Build libssh2 1.11.1 and libgit2 1.9.
|
|
30
|
+
# Build libssh2 1.11.1 and libgit2 1.9.4, then build pygit2 inplace:
|
|
31
31
|
#
|
|
32
|
-
# LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.
|
|
32
|
+
# LIBSSH2_VERSION=1.11.1 LIBGIT2_VERSION=1.9.4 sh build.sh
|
|
33
33
|
#
|
|
34
34
|
# Build inplace and run the tests:
|
|
35
35
|
#
|
|
@@ -217,7 +217,7 @@ if [ "$CIBUILDWHEEL" = "1" ]; then
|
|
|
217
217
|
cp $OPENSSL_PREFIX/*.dylib $PREFIX/lib/
|
|
218
218
|
echo "PREFIX " $PREFIX
|
|
219
219
|
echo "OPENSSL_PREFIX" $OPENSSL_PREFIX
|
|
220
|
-
ls -l
|
|
220
|
+
ls -l $PREFIX
|
|
221
221
|
ls -l $PREFIX/lib
|
|
222
222
|
fi
|
|
223
223
|
# we're done building dependencies, cibuildwheel action will take over
|