pygit2 1.13.1__tar.gz → 1.13.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.
Files changed (189) hide show
  1. {pygit2-1.13.1 → pygit2-1.13.3}/AUTHORS.rst +9 -7
  2. {pygit2-1.13.1 → pygit2-1.13.3}/CHANGELOG.rst +31 -0
  3. pygit2-1.13.3/Makefile +7 -0
  4. {pygit2-1.13.1 → pygit2-1.13.3}/PKG-INFO +5 -2
  5. {pygit2-1.13.1 → pygit2-1.13.3}/README.rst +1 -1
  6. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/__init__.py +13 -1
  7. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/_build.py +1 -1
  8. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/_pygit2.pyi +0 -1
  9. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/_run.py +7 -6
  10. pygit2-1.13.3/pygit2/blob.py +154 -0
  11. pygit2-1.13.3/pygit2/decl/attr.h +31 -0
  12. pygit2-1.13.3/pygit2/decl/common.h +10 -0
  13. pygit2-1.13.3/pygit2/decl/errors.h +51 -0
  14. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/repository.h +3 -0
  15. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/submodule.h +5 -3
  16. pygit2-1.13.3/pygit2/enums.py +64 -0
  17. pygit2-1.13.3/pygit2/filter.py +115 -0
  18. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/remote.py +9 -1
  19. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/repository.py +132 -23
  20. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/submodule.py +56 -0
  21. {pygit2-1.13.1 → pygit2-1.13.3}/requirements.txt +1 -1
  22. {pygit2-1.13.1 → pygit2-1.13.3}/setup.py +2 -1
  23. {pygit2-1.13.1 → pygit2-1.13.3}/src/blob.c +226 -0
  24. pygit2-1.13.3/src/filter.c +555 -0
  25. pygit2-1.13.3/src/filter.h +49 -0
  26. {pygit2-1.13.1 → pygit2-1.13.3}/src/mailmap.c +1 -1
  27. {pygit2-1.13.1 → pygit2-1.13.3}/src/pygit2.c +140 -0
  28. {pygit2-1.13.1 → pygit2-1.13.3}/src/refdb_backend.c +2 -4
  29. {pygit2-1.13.1 → pygit2-1.13.3}/src/reference.c +1 -5
  30. {pygit2-1.13.1 → pygit2-1.13.3}/src/repository.c +0 -76
  31. {pygit2-1.13.1 → pygit2-1.13.3}/src/types.h +6 -0
  32. {pygit2-1.13.1 → pygit2-1.13.3}/src/utils.h +1 -1
  33. {pygit2-1.13.1 → pygit2-1.13.3}/src/walker.c +3 -0
  34. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_blob.py +43 -0
  35. pygit2-1.13.3/test/test_filter.py +130 -0
  36. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_remote.py +17 -0
  37. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_repository.py +9 -0
  38. pygit2-1.13.3/test/test_submodule.py +225 -0
  39. pygit2-1.13.1/Makefile +0 -15
  40. pygit2-1.13.1/pygit2/decl/attr.h +0 -20
  41. pygit2-1.13.1/pygit2/decl/common.h +0 -11
  42. pygit2-1.13.1/pygit2/decl/errors.h +0 -45
  43. pygit2-1.13.1/test/test_submodule.py +0 -117
  44. {pygit2-1.13.1 → pygit2-1.13.3}/COPYING +0 -0
  45. {pygit2-1.13.1 → pygit2-1.13.3}/SPONSORS.rst +0 -0
  46. {pygit2-1.13.1 → pygit2-1.13.3}/build.sh +0 -0
  47. {pygit2-1.13.1 → pygit2-1.13.3}/build_tag.py +0 -0
  48. {pygit2-1.13.1 → pygit2-1.13.3}/mypy-stubtest.ini +0 -0
  49. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/blame.py +0 -0
  50. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/callbacks.py +0 -0
  51. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/config.py +0 -0
  52. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/credentials.py +0 -0
  53. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/blame.h +0 -0
  54. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/buffer.h +0 -0
  55. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/callbacks.h +0 -0
  56. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/checkout.h +0 -0
  57. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/clone.h +0 -0
  58. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/commit.h +0 -0
  59. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/config.h +0 -0
  60. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/describe.h +0 -0
  61. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/diff.h +0 -0
  62. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/graph.h +0 -0
  63. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/index.h +0 -0
  64. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/indexer.h +0 -0
  65. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/merge.h +0 -0
  66. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/net.h +0 -0
  67. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/oid.h +0 -0
  68. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/pack.h +0 -0
  69. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/proxy.h +0 -0
  70. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/refspec.h +0 -0
  71. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/remote.h +0 -0
  72. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/revert.h +0 -0
  73. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/stash.h +0 -0
  74. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/strarray.h +0 -0
  75. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/transport.h +0 -0
  76. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/decl/types.h +0 -0
  77. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/errors.py +0 -0
  78. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/ffi.py +0 -0
  79. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/index.py +0 -0
  80. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/packbuilder.py +0 -0
  81. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/refspec.py +0 -0
  82. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/settings.py +0 -0
  83. {pygit2-1.13.1 → pygit2-1.13.3}/pygit2/utils.py +0 -0
  84. {pygit2-1.13.1 → pygit2-1.13.3}/pyproject.toml +0 -0
  85. {pygit2-1.13.1 → pygit2-1.13.3}/pytest.ini +0 -0
  86. {pygit2-1.13.1 → pygit2-1.13.3}/requirements-test.txt +0 -0
  87. {pygit2-1.13.1 → pygit2-1.13.3}/setup.cfg +0 -0
  88. {pygit2-1.13.1 → pygit2-1.13.3}/src/branch.c +0 -0
  89. {pygit2-1.13.1 → pygit2-1.13.3}/src/branch.h +0 -0
  90. {pygit2-1.13.1 → pygit2-1.13.3}/src/commit.c +0 -0
  91. {pygit2-1.13.1 → pygit2-1.13.3}/src/diff.c +0 -0
  92. {pygit2-1.13.1 → pygit2-1.13.3}/src/diff.h +0 -0
  93. {pygit2-1.13.1 → pygit2-1.13.3}/src/error.c +0 -0
  94. {pygit2-1.13.1 → pygit2-1.13.3}/src/error.h +0 -0
  95. {pygit2-1.13.1 → pygit2-1.13.3}/src/mailmap.h +0 -0
  96. {pygit2-1.13.1 → pygit2-1.13.3}/src/note.c +0 -0
  97. {pygit2-1.13.1 → pygit2-1.13.3}/src/note.h +0 -0
  98. {pygit2-1.13.1 → pygit2-1.13.3}/src/object.c +0 -0
  99. {pygit2-1.13.1 → pygit2-1.13.3}/src/object.h +0 -0
  100. {pygit2-1.13.1 → pygit2-1.13.3}/src/odb.c +0 -0
  101. {pygit2-1.13.1 → pygit2-1.13.3}/src/odb.h +0 -0
  102. {pygit2-1.13.1 → pygit2-1.13.3}/src/odb_backend.c +0 -0
  103. {pygit2-1.13.1 → pygit2-1.13.3}/src/odb_backend.h +0 -0
  104. {pygit2-1.13.1 → pygit2-1.13.3}/src/oid.c +0 -0
  105. {pygit2-1.13.1 → pygit2-1.13.3}/src/oid.h +0 -0
  106. {pygit2-1.13.1 → pygit2-1.13.3}/src/options.c +0 -0
  107. {pygit2-1.13.1 → pygit2-1.13.3}/src/options.h +0 -0
  108. {pygit2-1.13.1 → pygit2-1.13.3}/src/patch.c +0 -0
  109. {pygit2-1.13.1 → pygit2-1.13.3}/src/patch.h +0 -0
  110. {pygit2-1.13.1 → pygit2-1.13.3}/src/refdb.c +0 -0
  111. {pygit2-1.13.1 → pygit2-1.13.3}/src/refdb.h +0 -0
  112. {pygit2-1.13.1 → pygit2-1.13.3}/src/refdb_backend.h +0 -0
  113. {pygit2-1.13.1 → pygit2-1.13.3}/src/reference.h +0 -0
  114. {pygit2-1.13.1 → pygit2-1.13.3}/src/repository.h +0 -0
  115. {pygit2-1.13.1 → pygit2-1.13.3}/src/revspec.c +0 -0
  116. {pygit2-1.13.1 → pygit2-1.13.3}/src/revspec.h +0 -0
  117. {pygit2-1.13.1 → pygit2-1.13.3}/src/signature.c +0 -0
  118. {pygit2-1.13.1 → pygit2-1.13.3}/src/signature.h +0 -0
  119. {pygit2-1.13.1 → pygit2-1.13.3}/src/stash.c +0 -0
  120. {pygit2-1.13.1 → pygit2-1.13.3}/src/tag.c +0 -0
  121. {pygit2-1.13.1 → pygit2-1.13.3}/src/tree.c +0 -0
  122. {pygit2-1.13.1 → pygit2-1.13.3}/src/tree.h +0 -0
  123. {pygit2-1.13.1 → pygit2-1.13.3}/src/treebuilder.c +0 -0
  124. {pygit2-1.13.1 → pygit2-1.13.3}/src/treebuilder.h +0 -0
  125. {pygit2-1.13.1 → pygit2-1.13.3}/src/utils.c +0 -0
  126. {pygit2-1.13.1 → pygit2-1.13.3}/src/walker.h +0 -0
  127. {pygit2-1.13.1 → pygit2-1.13.3}/src/wildmatch.c +0 -0
  128. {pygit2-1.13.1 → pygit2-1.13.3}/src/wildmatch.h +0 -0
  129. {pygit2-1.13.1 → pygit2-1.13.3}/src/worktree.c +0 -0
  130. {pygit2-1.13.1 → pygit2-1.13.3}/src/worktree.h +0 -0
  131. {pygit2-1.13.1 → pygit2-1.13.3}/test/__init__.py +0 -0
  132. {pygit2-1.13.1 → pygit2-1.13.3}/test/conftest.py +0 -0
  133. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/barerepo.zip +0 -0
  134. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/binaryfilerepo.zip +0 -0
  135. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/blameflagsrepo.zip +0 -0
  136. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/dirtyrepo.zip +0 -0
  137. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/emptyrepo.zip +0 -0
  138. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/encoding.zip +0 -0
  139. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/gpgsigned.zip +0 -0
  140. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/submodulerepo.zip +0 -0
  141. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/testrepo.zip +0 -0
  142. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/testrepoformerging.zip +0 -0
  143. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/testrepopacked.zip +0 -0
  144. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/trailerrepo.zip +0 -0
  145. {pygit2-1.13.1 → pygit2-1.13.3}/test/data/utf8branchrepo.zip +0 -0
  146. {pygit2-1.13.1 → pygit2-1.13.3}/test/keys/pygit2_empty +0 -0
  147. {pygit2-1.13.1 → pygit2-1.13.3}/test/keys/pygit2_empty.pub +0 -0
  148. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_apply_diff.py +0 -0
  149. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_archive.py +0 -0
  150. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_attributes.py +0 -0
  151. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_blame.py +0 -0
  152. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_branch.py +0 -0
  153. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_branch_empty.py +0 -0
  154. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_cherrypick.py +0 -0
  155. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_commit.py +0 -0
  156. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_commit_gpg.py +0 -0
  157. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_commit_trailer.py +0 -0
  158. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_config.py +0 -0
  159. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_credentials.py +0 -0
  160. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_describe.py +0 -0
  161. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_diff.py +0 -0
  162. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_diff_binary.py +0 -0
  163. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_index.py +0 -0
  164. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_mailmap.py +0 -0
  165. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_merge.py +0 -0
  166. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_note.py +0 -0
  167. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_object.py +0 -0
  168. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_odb.py +0 -0
  169. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_odb_backend.py +0 -0
  170. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_oid.py +0 -0
  171. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_options.py +0 -0
  172. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_packbuilder.py +0 -0
  173. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_patch.py +0 -0
  174. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_patch_encoding.py +0 -0
  175. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_refdb_backend.py +0 -0
  176. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_refs.py +0 -0
  177. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_remote_prune.py +0 -0
  178. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_remote_utf8.py +0 -0
  179. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_repository_bare.py +0 -0
  180. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_repository_custom.py +0 -0
  181. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_repository_empty.py +0 -0
  182. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_revparse.py +0 -0
  183. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_revwalk.py +0 -0
  184. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_signature.py +0 -0
  185. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_status.py +0 -0
  186. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_tag.py +0 -0
  187. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_tree.py +0 -0
  188. {pygit2-1.13.1 → pygit2-1.13.3}/test/test_treebuilder.py +0 -0
  189. {pygit2-1.13.1 → pygit2-1.13.3}/test/utils.py +0 -0
@@ -4,41 +4,42 @@ Authors::
4
4
  Carlos Martín Nieto
5
5
  Nico von Geyso
6
6
  Sviatoslav Sydorenko
7
- Robert Coup
7
+ Iliyas Jorio
8
8
  Matthias Bartelmeß
9
+ Robert Coup
9
10
  W. Trevor King
10
- Iliyas Jorio
11
11
  Drew DeVault
12
12
  Dave Borowitz
13
13
  Brandon Milton
14
14
  Daniel Rodríguez Troitiño
15
+ Peter Rowlands
15
16
  Richo Healey
16
17
  Christian Boos
17
18
  Julien Miotte
18
19
  Nick Hynes
19
20
  Richard Möhn
20
21
  Xu Tao
21
- Jose Plana
22
22
  Matthew Duggan
23
23
  Matthew Gamble
24
24
  Jeremy Westwood
25
+ Jose Plana
25
26
  Martin Lenders
26
- Petr Hosek
27
27
  Sriram Raghu
28
28
  Victor Garcia
29
- Xavier Delannoy
30
29
  Yonggang Luo
31
30
  Patrick Steinhardt
31
+ Petr Hosek
32
32
  Tamir Bahar
33
33
  Valentin Haenel
34
+ Xavier Delannoy
34
35
  Michael Jones
35
36
  Saugat Pachhai
36
37
  Bernardo Heynemann
37
- Brodie Rao
38
38
  John Szakmeister
39
39
  Nabijacz Leweli
40
40
  Simon Cozens
41
41
  Vlad Temian
42
+ Brodie Rao
42
43
  Chad Dombrova
43
44
  Lukas Fleischer
44
45
  Mathias Leppich
@@ -49,7 +50,6 @@ Authors::
49
50
  Dan Sully
50
51
  David Versmisse
51
52
  Mikhail Yushkovskiy
52
- Peter Rowlands
53
53
  Robin Stocker
54
54
  Rohit Sanjay
55
55
  Rémi Duraffort
@@ -119,6 +119,7 @@ Authors::
119
119
  Vicent Marti
120
120
  Zbigniew Jędrzejewski-Szmek
121
121
  Zoran Zaric
122
+ nikitalita
122
123
  Adam Gausmann
123
124
  Adam Spiers
124
125
  Albin Söderström
@@ -169,6 +170,7 @@ Authors::
169
170
  Jiri Benc
170
171
  Jonathan Robson
171
172
  Josh Bleecher Snyder
173
+ Julia Evans
172
174
  Justin Clift
173
175
  Konstantinos Smanis
174
176
  Kyriakos Oikonomakos
@@ -1,3 +1,34 @@
1
+ 1.13.3 (2023-11-21)
2
+ -------------------------
3
+
4
+ - New API for filters in Python
5
+ `#1237 <https://github.com/libgit2/pygit2/pull/1237>`_
6
+ `#1244 <https://github.com/libgit2/pygit2/pull/1244>`_
7
+
8
+ - Shallow repositories: New ``depth`` optional argument for
9
+ ``clone_repository(...)`` and ``Remote.fetch(...)``
10
+ `#1245 <https://github.com/libgit2/pygit2/pull/1245>`_
11
+ `#1246 <https://github.com/libgit2/pygit2/pull/1246>`_
12
+
13
+ - New submodule ``init(...)``, ``update(...)`` and ``reload(...)`` functions
14
+ `#1248 <https://github.com/libgit2/pygit2/pull/1248>`_
15
+
16
+ - Release GIL in ``Walker.__next__``
17
+ `#1249 <https://github.com/libgit2/pygit2/pull/1249>`_
18
+
19
+ - Type hints for submodule functions in ``Repository``
20
+ `#1247 <https://github.com/libgit2/pygit2/pull/1247>`_
21
+
22
+
23
+ 1.13.2 (2023-10-30)
24
+ -------------------------
25
+
26
+ - Support Python 3.12
27
+
28
+ - Documentation updates
29
+ `#1242 <https://github.com/libgit2/pygit2/pull/1242>`_
30
+
31
+
1
32
  1.13.1 (2023-09-24)
2
33
  -------------------------
3
34
 
pygit2-1.13.3/Makefile ADDED
@@ -0,0 +1,7 @@
1
+ .PHONY: build html
2
+
3
+ build:
4
+ OPENSSL_VERSION=3.1.3 LIBSSH2_VERSION=1.11.0 LIBGIT2_VERSION=1.7.1 sh build.sh
5
+
6
+ html: build
7
+ make -C docs html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pygit2
3
- Version: 1.13.1
3
+ Version: 1.13.3
4
4
  Summary: Python bindings for libgit2.
5
5
  Home-page: https://github.com/libgit2/pygit2
6
6
  Maintainer: J. David Ibáñez
@@ -18,19 +18,22 @@ Classifier: Programming Language :: Python :: 3.8
18
18
  Classifier: Programming Language :: Python :: 3.9
19
19
  Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
21
22
  Classifier: Programming Language :: Python :: Implementation :: PyPy
22
23
  Classifier: Programming Language :: Python :: Implementation :: CPython
23
24
  Classifier: Topic :: Software Development :: Version Control
24
25
  Requires-Python: >=3.8
25
26
  License-File: COPYING
26
27
  License-File: AUTHORS.rst
28
+ Requires-Dist: cffi>=1.16.0
29
+ Requires-Dist: setuptools; python_version >= "3.12"
27
30
 
28
31
  ######################################################################
29
32
  pygit2 - libgit2 bindings in Python
30
33
  ######################################################################
31
34
 
32
35
  Bindings to the libgit2 shared library, implements Git plumbing.
33
- Supports Python 3.8 to 3.11 and PyPy3 7.3+
36
+ Supports Python 3.8 to 3.12 and PyPy3 7.3+
34
37
 
35
38
  .. image:: https://github.com/libgit2/pygit2/actions/workflows/tests.yml/badge.svg
36
39
  :target: https://github.com/libgit2/pygit2/actions/workflows/tests.yml
@@ -3,7 +3,7 @@ pygit2 - libgit2 bindings in Python
3
3
  ######################################################################
4
4
 
5
5
  Bindings to the libgit2 shared library, implements Git plumbing.
6
- Supports Python 3.8 to 3.11 and PyPy3 7.3+
6
+ Supports Python 3.8 to 3.12 and PyPy3 7.3+
7
7
 
8
8
  .. image:: https://github.com/libgit2/pygit2/actions/workflows/tests.yml/badge.svg
9
9
  :target: https://github.com/libgit2/pygit2/actions/workflows/tests.yml
@@ -31,12 +31,15 @@ from ._pygit2 import *
31
31
 
32
32
  # High level API
33
33
  from .blame import Blame, BlameHunk
34
+ from .blob import BlobIO
34
35
  from .callbacks import git_clone_options, git_fetch_options, get_credentials
35
36
  from .callbacks import Payload, RemoteCallbacks, CheckoutCallbacks, StashApplyCallbacks
36
37
  from .config import Config
37
38
  from .credentials import *
38
39
  from .errors import check_error, Passthrough
40
+ from .enums import SubmoduleIgnore, SubmoduleStatus
39
41
  from .ffi import ffi, C
42
+ from .filter import Filter
40
43
  from .index import Index, IndexEntry
41
44
  from .remote import Remote
42
45
  from .repository import Repository
@@ -92,6 +95,8 @@ GIT_ATTR_CHECK_FILE_THEN_INDEX = C.GIT_ATTR_CHECK_FILE_THEN_INDEX
92
95
  GIT_ATTR_CHECK_INDEX_THEN_FILE = C.GIT_ATTR_CHECK_INDEX_THEN_FILE
93
96
  GIT_ATTR_CHECK_INDEX_ONLY = C.GIT_ATTR_CHECK_INDEX_ONLY
94
97
  GIT_ATTR_CHECK_NO_SYSTEM = C.GIT_ATTR_CHECK_NO_SYSTEM
98
+ GIT_ATTR_CHECK_INCLUDE_HEAD = C.GIT_ATTR_CHECK_INCLUDE_HEAD
99
+ GIT_ATTR_CHECK_INCLUDE_COMMIT = C.GIT_ATTR_CHECK_INCLUDE_COMMIT
95
100
 
96
101
  # GIT_FETCH_PRUNE
97
102
  GIT_FETCH_PRUNE_UNSPECIFIED = C.GIT_FETCH_PRUNE_UNSPECIFIED
@@ -197,7 +202,7 @@ def init_repository(path, bare=False,
197
202
 
198
203
  def clone_repository(
199
204
  url, path, bare=False, repository=None, remote=None,
200
- checkout_branch=None, callbacks=None):
205
+ checkout_branch=None, callbacks=None, depth=0):
201
206
  """
202
207
  Clones a new Git repository from *url* in the given *path*.
203
208
 
@@ -231,6 +236,12 @@ def clone_repository(
231
236
 
232
237
  The callbacks should be an object which inherits from
233
238
  `pyclass:RemoteCallbacks`.
239
+ depth : int
240
+ Number of commits to clone.
241
+
242
+ If greater than 0, creates a shallow clone with a history truncated to
243
+ the specified number of commits.
244
+ The default is 0 (full commit history).
234
245
  """
235
246
 
236
247
  if callbacks is None:
@@ -244,6 +255,7 @@ def clone_repository(
244
255
  with git_clone_options(payload):
245
256
  opts = payload.clone_options
246
257
  opts.bare = bare
258
+ opts.fetch_opts.depth = depth
247
259
 
248
260
  if checkout_branch:
249
261
  checkout_branch_ref = ffi.new('char []', to_bytes(checkout_branch))
@@ -34,7 +34,7 @@ from pathlib import Path
34
34
  #
35
35
  # The version number of pygit2
36
36
  #
37
- __version__ = '1.13.1'
37
+ __version__ = '1.13.3'
38
38
 
39
39
 
40
40
  #
@@ -495,7 +495,6 @@ class Repository:
495
495
  def expand_id(self, hex: str) -> Oid: ...
496
496
  def free(self) -> None: ...
497
497
  def git_object_lookup_prefix(self, oid: _OidArg) -> Object: ...
498
- def init_submodules(self, submodules: Optional[list[Submodule]] = None, overwrite = False) -> None: ...
499
498
  def list_worktrees(self) -> list[str]: ...
500
499
  def listall_branches(self, flag: int = GIT_BRANCH_LOCAL) -> list[str]: ...
501
500
  def listall_stashes(self) -> list[Stash]: ...
@@ -54,8 +54,8 @@ else:
54
54
  # Order matters
55
55
  h_files = [
56
56
  'types.h',
57
- 'attr.h',
58
57
  'oid.h',
58
+ 'attr.h',
59
59
  'blame.h',
60
60
  'buffer.h',
61
61
  'strarray.h',
@@ -91,14 +91,15 @@ for h_file in h_files:
91
91
 
92
92
  C_HEADER_SRC = '\n'.join(h_source)
93
93
 
94
+ C_PREAMBLE = """\
95
+ #include <git2.h>
96
+ #include <git2/sys/repository.h>
97
+ """
98
+
94
99
  # ffi
95
100
  _, libgit2_kw = get_libgit2_paths()
96
101
  ffi = FFI()
97
- ffi.set_source(
98
- "pygit2._libgit2",
99
- "#include <git2.h>", # preamble
100
- **libgit2_kw
101
- )
102
+ ffi.set_source("pygit2._libgit2", C_PREAMBLE, **libgit2_kw)
102
103
  ffi.cdef(C_HEADER_SRC)
103
104
 
104
105
 
@@ -0,0 +1,154 @@
1
+ import io
2
+ import threading
3
+ import time
4
+ from contextlib import AbstractContextManager
5
+ from typing import Optional
6
+ from queue import Queue
7
+
8
+ from ._pygit2 import GIT_BLOB_FILTER_CHECK_FOR_BINARY, Blob, Oid
9
+
10
+
11
+ class _BlobIO(io.RawIOBase):
12
+ """Low-level wrapper for streaming blob content.
13
+
14
+ The underlying libgit2 git_writestream filter chain will be run
15
+ in a separate thread. The GIL will be released while running
16
+ libgit2 filtering.
17
+ """
18
+
19
+ def __init__(
20
+ self,
21
+ blob: Blob,
22
+ as_path: Optional[str] = None,
23
+ flags: int = GIT_BLOB_FILTER_CHECK_FOR_BINARY,
24
+ commit_id: Optional[Oid] = None,
25
+ ):
26
+ super().__init__()
27
+ self._blob = blob
28
+ self._queue = Queue(maxsize=1)
29
+ self._ready = threading.Event()
30
+ self._writer_closed = threading.Event()
31
+ self._chunk: Optional[bytes] = None
32
+ self._thread = threading.Thread(
33
+ target=self._blob._write_to_queue,
34
+ args=(self._queue, self._ready, self._writer_closed),
35
+ kwargs={
36
+ "as_path": as_path,
37
+ "flags": flags,
38
+ "commit_id": commit_id,
39
+ },
40
+ daemon=True,
41
+ )
42
+ self._thread.start()
43
+
44
+ def __exit__(self, exc_type, exc_value, traceback):
45
+ self.close()
46
+
47
+ def isatty():
48
+ return False
49
+
50
+ def readable(self):
51
+ return True
52
+
53
+ def writable(self):
54
+ return False
55
+
56
+ def seekable(self):
57
+ return False
58
+
59
+ def readinto(self, b, /):
60
+ try:
61
+ while self._chunk is None:
62
+ self._ready.wait()
63
+ if self._queue.empty():
64
+ if self._writer_closed.is_set():
65
+ # EOF
66
+ return 0
67
+ self._ready.clear()
68
+ time.sleep(0)
69
+ continue
70
+ chunk = self._queue.get()
71
+ if chunk:
72
+ self._chunk = chunk
73
+
74
+ if len(self._chunk) <= len(b):
75
+ bytes_written = len(self._chunk)
76
+ b[:bytes_written] = self._chunk
77
+ self._chunk = None
78
+ return bytes_written
79
+ bytes_written = len(b)
80
+ b[:] = self._chunk[:bytes_written]
81
+ self._chunk = self._chunk[bytes_written:]
82
+ return bytes_written
83
+ except KeyboardInterrupt:
84
+ return 0
85
+
86
+ def close(self):
87
+ try:
88
+ self._ready.wait()
89
+ self._writer_closed.wait()
90
+ while self._queue is not None and not self._queue.empty():
91
+ self._queue.get()
92
+ self._thread.join()
93
+ except KeyboardInterrupt:
94
+ pass
95
+ self._queue = None
96
+
97
+
98
+ class BlobIO(io.BufferedReader, AbstractContextManager):
99
+ """Read-only wrapper for streaming blob content.
100
+
101
+ Supports reading both raw and filtered blob content.
102
+ Implements io.BufferedReader.
103
+
104
+ Example:
105
+
106
+ >>> with BlobIO(blob) as f:
107
+ ... while True:
108
+ ... # Read blob data in 1KB chunks until EOF is reached
109
+ ... chunk = f.read(1024)
110
+ ... if not chunk:
111
+ ... break
112
+
113
+ By default, `BlobIO` will stream the raw contents of the blob, but it
114
+ can also be used to stream filtered content (i.e. to read the content
115
+ after applying filters which would be used when checking out the blob
116
+ to the working directory).
117
+
118
+ Example:
119
+
120
+ >>> with BlobIO(blob, as_path='my_file.ext') as f:
121
+ ... # Read the filtered content which would be returned upon
122
+ ... # running 'git checkout -- my_file.txt'
123
+ ... filtered_data = f.read()
124
+ """
125
+
126
+ def __init__(
127
+ self,
128
+ blob: Blob,
129
+ as_path: Optional[str] = None,
130
+ flags: int = GIT_BLOB_FILTER_CHECK_FOR_BINARY,
131
+ commit_id: Optional[Oid] = None,
132
+ ):
133
+ """Wrap the specified blob.
134
+
135
+ Parameters:
136
+ blob: The blob to wrap.
137
+ as_path: Filter the contents of the blob as if it had the specified
138
+ path. If `as_path` is None, the raw contents of the blob will
139
+ be read.
140
+ flags: GIT_BLOB_FILTER_* bitflags (only applicable when `as_path`
141
+ is set).
142
+ commit_oid: Commit to load attributes from when
143
+ GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT is specified in `flags`
144
+ (only applicable when `as_path` is set).
145
+ """
146
+ raw = _BlobIO(blob, as_path=as_path, flags=flags, commit_id=commit_id)
147
+ super().__init__(raw)
148
+
149
+ def __exit__(self, exc_type, exc_value, traceback):
150
+ self.close()
151
+
152
+
153
+ io.RawIOBase.register(_BlobIO)
154
+ io.BufferedIOBase.register(BlobIO)
@@ -0,0 +1,31 @@
1
+ #define GIT_ATTR_CHECK_FILE_THEN_INDEX 0
2
+ #define GIT_ATTR_CHECK_INDEX_THEN_FILE 1
3
+ #define GIT_ATTR_CHECK_INDEX_ONLY 2
4
+ #define GIT_ATTR_CHECK_NO_SYSTEM 4
5
+ #define GIT_ATTR_CHECK_INCLUDE_HEAD 8
6
+ #define GIT_ATTR_CHECK_INCLUDE_COMMIT 16
7
+
8
+ #define GIT_ATTR_OPTIONS_VERSION ...
9
+
10
+ typedef enum {
11
+ GIT_ATTR_VALUE_UNSPECIFIED = 0, /**< The attribute has been left unspecified */
12
+ GIT_ATTR_VALUE_TRUE, /**< The attribute has been set */
13
+ GIT_ATTR_VALUE_FALSE, /**< The attribute has been unset */
14
+ GIT_ATTR_VALUE_STRING /**< This attribute has a value */
15
+ } git_attr_value_t;
16
+
17
+ typedef struct {
18
+ unsigned int version;
19
+ unsigned int flags;
20
+ git_oid *commit_id;
21
+ git_oid attr_commit_id;
22
+ } git_attr_options;
23
+
24
+ int git_attr_get_ext(
25
+ const char **value_out,
26
+ git_repository *repo,
27
+ git_attr_options *opts,
28
+ const char *path,
29
+ const char *name);
30
+
31
+ git_attr_value_t git_attr_value(const char *attr);
@@ -0,0 +1,10 @@
1
+ #define GIT_PATH_MAX ...
2
+
3
+ typedef enum {
4
+ GIT_FEATURE_THREADS = (1 << 0),
5
+ GIT_FEATURE_HTTPS = (1 << 1),
6
+ GIT_FEATURE_SSH = (1 << 2),
7
+ GIT_FEATURE_NSEC = (1 << 3)
8
+ } git_feature_t;
9
+
10
+ int git_libgit2_features(void);
@@ -0,0 +1,51 @@
1
+ typedef enum {
2
+ GIT_OK = 0, /**< No error */
3
+
4
+ GIT_ERROR = -1, /**< Generic error */
5
+ GIT_ENOTFOUND = -3, /**< Requested object could not be found */
6
+ GIT_EEXISTS = -4, /**< Object exists preventing operation */
7
+ GIT_EAMBIGUOUS = -5, /**< More than one object matches */
8
+ GIT_EBUFS = -6, /**< Output buffer too short to hold data */
9
+
10
+ /**
11
+ * GIT_EUSER is a special error that is never generated by libgit2
12
+ * code. You can return it from a callback (e.g to stop an iteration)
13
+ * to know that it was generated by the callback and not by libgit2.
14
+ */
15
+ GIT_EUSER = -7,
16
+
17
+ GIT_EBAREREPO = -8, /**< Operation not allowed on bare repository */
18
+ GIT_EUNBORNBRANCH = -9, /**< HEAD refers to branch with no commits */
19
+ GIT_EUNMERGED = -10, /**< Merge in progress prevented operation */
20
+ GIT_ENONFASTFORWARD = -11, /**< Reference was not fast-forwardable */
21
+ GIT_EINVALIDSPEC = -12, /**< Name/ref spec was not in a valid format */
22
+ GIT_ECONFLICT = -13, /**< Checkout conflicts prevented operation */
23
+ GIT_ELOCKED = -14, /**< Lock file prevented operation */
24
+ GIT_EMODIFIED = -15, /**< Reference value does not match expected */
25
+ GIT_EAUTH = -16, /**< Authentication error */
26
+ GIT_ECERTIFICATE = -17, /**< Server certificate is invalid */
27
+ GIT_EAPPLIED = -18, /**< Patch/merge has already been applied */
28
+ GIT_EPEEL = -19, /**< The requested peel operation is not possible */
29
+ GIT_EEOF = -20, /**< Unexpected EOF */
30
+ GIT_EINVALID = -21, /**< Invalid operation or input */
31
+ GIT_EUNCOMMITTED = -22, /**< Uncommitted changes in index prevented operation */
32
+ GIT_EDIRECTORY = -23, /**< The operation is not valid for a directory */
33
+ GIT_EMERGECONFLICT = -24, /**< A merge conflict exists and cannot continue */
34
+
35
+ GIT_PASSTHROUGH = -30, /**< A user-configured callback refused to act */
36
+ GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
37
+ GIT_RETRY = -32, /**< Internal only */
38
+ GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
39
+ GIT_EINDEXDIRTY = -34, /**< Unsaved changes in the index would be overwritten */
40
+ GIT_EAPPLYFAIL = -35, /**< Patch application failed */
41
+ GIT_EOWNER = -36, /**< The object is not owned by the current user */
42
+ GIT_TIMEOUT = -37 /**< The operation timed out */
43
+ } git_error_code;
44
+
45
+ typedef struct {
46
+ char *message;
47
+ int klass;
48
+ } git_error;
49
+
50
+
51
+ const git_error * git_error_last(void);
@@ -87,3 +87,6 @@ int git_repository_ident(const char **name, const char **email, const git_reposi
87
87
  int git_repository_set_ident(git_repository *repo, const char *name, const char *email);
88
88
  int git_repository_index(git_index **out, git_repository *repo);
89
89
  git_repository_state_t git_repository_state(git_repository *repo);
90
+
91
+ int git_repository_submodule_cache_all(git_repository *repo);
92
+ int git_repository_submodule_cache_clear(git_repository *repo);
@@ -30,12 +30,14 @@ int git_submodule_lookup(
30
30
  const char *name);
31
31
 
32
32
  void git_submodule_free(git_submodule *submodule);
33
- int git_submodule_open(
34
- git_repository **repo,
35
- git_submodule *submodule);
33
+ int git_submodule_open(git_repository **repo, git_submodule *submodule);
34
+ int git_submodule_init(git_submodule *submodule, int overwrite);
35
+ int git_submodule_reload(git_submodule *submodule, int force);
36
36
 
37
37
  const char * git_submodule_name(git_submodule *submodule);
38
38
  const char * git_submodule_path(git_submodule *submodule);
39
39
  const char * git_submodule_url(git_submodule *submodule);
40
40
  const char * git_submodule_branch(git_submodule *submodule);
41
41
  const git_oid * git_submodule_head_id(git_submodule *submodule);
42
+
43
+ int git_submodule_status(unsigned int *status, git_repository *repo, const char *name, git_submodule_ignore_t ignore);
@@ -0,0 +1,64 @@
1
+ from enum import IntEnum, IntFlag
2
+
3
+ from . import _pygit2
4
+
5
+
6
+ class SubmoduleIgnore(IntEnum):
7
+ UNSPECIFIED = _pygit2.GIT_SUBMODULE_IGNORE_UNSPECIFIED
8
+ "use the submodule's configuration"
9
+
10
+ NONE = _pygit2.GIT_SUBMODULE_IGNORE_NONE
11
+ "any change or untracked == dirty"
12
+
13
+ UNTRACKED = _pygit2.GIT_SUBMODULE_IGNORE_UNTRACKED
14
+ "dirty if tracked files change"
15
+
16
+ DIRTY = _pygit2.GIT_SUBMODULE_IGNORE_DIRTY
17
+ "only dirty if HEAD moved"
18
+
19
+ ALL = _pygit2.GIT_SUBMODULE_IGNORE_ALL
20
+ "never dirty"
21
+
22
+
23
+ class SubmoduleStatus(IntFlag):
24
+ IN_HEAD = _pygit2.GIT_SUBMODULE_STATUS_IN_HEAD
25
+ "superproject head contains submodule"
26
+
27
+ IN_INDEX = _pygit2.GIT_SUBMODULE_STATUS_IN_INDEX
28
+ "superproject index contains submodule"
29
+
30
+ IN_CONFIG = _pygit2.GIT_SUBMODULE_STATUS_IN_CONFIG
31
+ "superproject gitmodules has submodule"
32
+
33
+ IN_WD = _pygit2.GIT_SUBMODULE_STATUS_IN_WD
34
+ "superproject workdir has submodule"
35
+
36
+ INDEX_ADDED = _pygit2.GIT_SUBMODULE_STATUS_INDEX_ADDED
37
+ "in index, not in head (flag available if ignore is not ALL)"
38
+
39
+ INDEX_DELETED = _pygit2.GIT_SUBMODULE_STATUS_INDEX_DELETED
40
+ "in head, not in index (flag available if ignore is not ALL)"
41
+
42
+ INDEX_MODIFIED = _pygit2.GIT_SUBMODULE_STATUS_INDEX_MODIFIED
43
+ "index and head don't match (flag available if ignore is not ALL)"
44
+
45
+ WD_UNINITIALIZED = _pygit2.GIT_SUBMODULE_STATUS_WD_UNINITIALIZED
46
+ "workdir contains empty repository (flag available if ignore is not ALL)"
47
+
48
+ WD_ADDED = _pygit2.GIT_SUBMODULE_STATUS_WD_ADDED
49
+ "in workdir, not index (flag available if ignore is not ALL)"
50
+
51
+ WD_DELETED = _pygit2.GIT_SUBMODULE_STATUS_WD_DELETED
52
+ "in index, not workdir (flag available if ignore is not ALL)"
53
+
54
+ WD_MODIFIED = _pygit2.GIT_SUBMODULE_STATUS_WD_MODIFIED
55
+ "index and workdir head don't match (flag available if ignore is not ALL)"
56
+
57
+ WD_INDEX_MODIFIED = _pygit2.GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED
58
+ "submodule workdir index is dirty (flag available if ignore is NONE or UNTRACKED)"
59
+
60
+ WD_WD_MODIFIED = _pygit2.GIT_SUBMODULE_STATUS_WD_WD_MODIFIED
61
+ "submodule workdir has modified files (flag available if ignore is NONE or UNTRACKED)"
62
+
63
+ WD_UNTRACKED = _pygit2.GIT_SUBMODULE_STATUS_WD_UNTRACKED
64
+ "submodule workdir contains untracked files (flag available if ignore is NONE)"