GitPython 3.1.41__tar.gz → 3.1.43__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.
- {GitPython-3.1.41 → GitPython-3.1.43}/AUTHORS +1 -0
- {GitPython-3.1.41 → GitPython-3.1.43/GitPython.egg-info}/PKG-INFO +37 -80
- GitPython-3.1.43/GitPython.egg-info/requires.txt +31 -0
- {GitPython-3.1.41/GitPython.egg-info → GitPython-3.1.43}/PKG-INFO +37 -80
- {GitPython-3.1.41 → GitPython-3.1.43}/README.md +26 -77
- GitPython-3.1.43/VERSION +1 -0
- GitPython-3.1.43/doc/requirements.txt +8 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/changes.rst +16 -1
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/conf.py +44 -45
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/reference.rst +45 -18
- GitPython-3.1.43/git/__init__.py +300 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/cmd.py +566 -341
- {GitPython-3.1.41 → GitPython-3.1.43}/git/compat.py +65 -30
- {GitPython-3.1.41 → GitPython-3.1.43}/git/config.py +121 -83
- {GitPython-3.1.41 → GitPython-3.1.43}/git/db.py +16 -16
- {GitPython-3.1.41 → GitPython-3.1.43}/git/diff.py +176 -76
- {GitPython-3.1.41 → GitPython-3.1.43}/git/exc.py +14 -8
- GitPython-3.1.43/git/index/__init__.py +16 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/index/base.py +374 -308
- {GitPython-3.1.41 → GitPython-3.1.43}/git/index/fun.py +87 -67
- {GitPython-3.1.41 → GitPython-3.1.43}/git/index/typ.py +33 -25
- {GitPython-3.1.41 → GitPython-3.1.43}/git/index/util.py +7 -13
- GitPython-3.1.43/git/objects/__init__.py +25 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/base.py +115 -48
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/blob.py +17 -6
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/commit.py +210 -141
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/fun.py +56 -44
- GitPython-3.1.43/git/objects/submodule/__init__.py +7 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/submodule/base.py +418 -235
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/submodule/root.py +102 -78
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/submodule/util.py +25 -24
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/tag.py +47 -16
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/tree.py +84 -111
- {GitPython-3.1.41 → GitPython-3.1.43}/git/objects/util.py +149 -110
- GitPython-3.1.43/git/refs/__init__.py +21 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/head.py +61 -51
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/log.py +83 -52
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/reference.py +40 -30
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/remote.py +15 -16
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/symbolic.py +183 -126
- {GitPython-3.1.41 → GitPython-3.1.43}/git/refs/tag.py +34 -20
- {GitPython-3.1.41 → GitPython-3.1.43}/git/remote.py +254 -188
- {GitPython-3.1.41 → GitPython-3.1.43}/git/repo/__init__.py +4 -2
- {GitPython-3.1.41 → GitPython-3.1.43}/git/repo/base.py +374 -242
- {GitPython-3.1.41 → GitPython-3.1.43}/git/repo/fun.py +122 -96
- GitPython-3.1.43/git/types.py +284 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/util.py +254 -209
- {GitPython-3.1.41 → GitPython-3.1.43}/pyproject.toml +39 -7
- {GitPython-3.1.41 → GitPython-3.1.43}/setup.py +17 -13
- {GitPython-3.1.41 → GitPython-3.1.43}/test-requirements.txt +1 -2
- GitPython-3.1.41/GitPython.egg-info/requires.txt +0 -20
- GitPython-3.1.41/VERSION +0 -1
- GitPython-3.1.41/doc/requirements.txt +0 -3
- GitPython-3.1.41/git/__init__.py +0 -143
- GitPython-3.1.41/git/index/__init__.py +0 -7
- GitPython-3.1.41/git/objects/__init__.py +0 -24
- GitPython-3.1.41/git/objects/submodule/__init__.py +0 -5
- GitPython-3.1.41/git/refs/__init__.py +0 -12
- GitPython-3.1.41/git/types.py +0 -117
- {GitPython-3.1.41 → GitPython-3.1.43}/CHANGES +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/CONTRIBUTING.md +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/GitPython.egg-info/SOURCES.txt +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/GitPython.egg-info/dependency_links.txt +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/GitPython.egg-info/not-zip-safe +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/GitPython.egg-info/top_level.txt +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/LICENSE +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/MANIFEST.in +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/.gitignore +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/Makefile +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/index.rst +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/intro.rst +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/quickstart.rst +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/roadmap.rst +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/doc/source/tutorial.rst +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/git/py.typed +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/requirements.txt +0 -0
- {GitPython-3.1.41 → GitPython-3.1.43}/setup.cfg +0 -0
|
@@ -53,5 +53,6 @@ Contributors are:
|
|
|
53
53
|
-Santos Gallegos <stsewd _at_ proton.me>
|
|
54
54
|
-Wenhan Zhu <wzhu.cosmos _at_ gmail.com>
|
|
55
55
|
-Eliah Kagan <eliah.kagan _at_ gmail.com>
|
|
56
|
+
-Ethan Lin <et.repositories _at_ gmail.com>
|
|
56
57
|
|
|
57
58
|
Portions derived from other open source works and are clearly marked.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: GitPython
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.43
|
|
4
4
|
Summary: GitPython is a Python library used to interact with Git repositories
|
|
5
5
|
Home-page: https://github.com/gitpython-developers/GitPython
|
|
6
6
|
Author: Sebastian Thiel, Michael Trier
|
|
@@ -30,7 +30,6 @@ License-File: AUTHORS
|
|
|
30
30
|
Requires-Dist: gitdb<5,>=4.0.1
|
|
31
31
|
Requires-Dist: typing-extensions>=3.7.4.3; python_version < "3.8"
|
|
32
32
|
Provides-Extra: test
|
|
33
|
-
Requires-Dist: black; extra == "test"
|
|
34
33
|
Requires-Dist: coverage[toml]; extra == "test"
|
|
35
34
|
Requires-Dist: ddt!=1.4.3,>=1.1.1; extra == "test"
|
|
36
35
|
Requires-Dist: mock; python_version < "3.8" and extra == "test"
|
|
@@ -41,7 +40,16 @@ Requires-Dist: pytest-cov; extra == "test"
|
|
|
41
40
|
Requires-Dist: pytest-instafail; extra == "test"
|
|
42
41
|
Requires-Dist: pytest-mock; extra == "test"
|
|
43
42
|
Requires-Dist: pytest-sugar; extra == "test"
|
|
44
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: typing-extensions; python_version < "3.11" and extra == "test"
|
|
44
|
+
Provides-Extra: doc
|
|
45
|
+
Requires-Dist: sphinx==4.3.2; extra == "doc"
|
|
46
|
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
|
47
|
+
Requires-Dist: sphinxcontrib-applehelp<=1.0.4,>=1.0.2; extra == "doc"
|
|
48
|
+
Requires-Dist: sphinxcontrib-devhelp==1.0.2; extra == "doc"
|
|
49
|
+
Requires-Dist: sphinxcontrib-htmlhelp<=2.0.1,>=2.0.0; extra == "doc"
|
|
50
|
+
Requires-Dist: sphinxcontrib-qthelp==1.0.3; extra == "doc"
|
|
51
|
+
Requires-Dist: sphinxcontrib-serializinghtml==1.1.5; extra == "doc"
|
|
52
|
+
Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
|
|
45
53
|
|
|
46
54
|

|
|
47
55
|
[](https://readthedocs.org/projects/gitpython/?badge=stable)
|
|
@@ -62,6 +70,8 @@ probably the skills to scratch that itch of mine: implement `git` in a way that
|
|
|
62
70
|
If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an
|
|
63
71
|
implementation of 'git' in [Rust](https://www.rust-lang.org).
|
|
64
72
|
|
|
73
|
+
*(Please note that `gitoxide` is not currently available for use in Python, and that Rust is required.)*
|
|
74
|
+
|
|
65
75
|
## GitPython
|
|
66
76
|
|
|
67
77
|
GitPython is a python library used to interact with git repositories, high-level like git-porcelain,
|
|
@@ -82,9 +92,9 @@ The project is open to contributions of all kinds, as well as new maintainers.
|
|
|
82
92
|
|
|
83
93
|
### REQUIREMENTS
|
|
84
94
|
|
|
85
|
-
GitPython needs the `git` executable to be installed on the system and available in your
|
|
86
|
-
If it is not in your `PATH`, you can help GitPython find it
|
|
87
|
-
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
|
|
95
|
+
GitPython needs the `git` executable to be installed on the system and available in your
|
|
96
|
+
`PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it
|
|
97
|
+
by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
|
|
88
98
|
|
|
89
99
|
- Git (1.7.x or newer)
|
|
90
100
|
- Python >= 3.7
|
|
@@ -100,7 +110,7 @@ GitPython and its required package dependencies can be installed in any of the f
|
|
|
100
110
|
|
|
101
111
|
To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:
|
|
102
112
|
|
|
103
|
-
```
|
|
113
|
+
```sh
|
|
104
114
|
pip install GitPython
|
|
105
115
|
```
|
|
106
116
|
|
|
@@ -110,7 +120,7 @@ pip install GitPython
|
|
|
110
120
|
|
|
111
121
|
If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:
|
|
112
122
|
|
|
113
|
-
```
|
|
123
|
+
```sh
|
|
114
124
|
pip install .
|
|
115
125
|
```
|
|
116
126
|
|
|
@@ -118,7 +128,7 @@ pip install .
|
|
|
118
128
|
|
|
119
129
|
To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython) from source to work on the code, you can do it like so:
|
|
120
130
|
|
|
121
|
-
```
|
|
131
|
+
```sh
|
|
122
132
|
git clone https://github.com/gitpython-developers/GitPython
|
|
123
133
|
cd GitPython
|
|
124
134
|
./init-tests-after-clone.sh
|
|
@@ -128,7 +138,7 @@ On Windows, `./init-tests-after-clone.sh` can be run in a Git Bash shell.
|
|
|
128
138
|
|
|
129
139
|
If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`):
|
|
130
140
|
|
|
131
|
-
```
|
|
141
|
+
```sh
|
|
132
142
|
gh repo clone GitPython
|
|
133
143
|
```
|
|
134
144
|
|
|
@@ -136,7 +146,7 @@ Having cloned the repo, create and activate your [virtual environment](https://d
|
|
|
136
146
|
|
|
137
147
|
Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
|
|
138
148
|
|
|
139
|
-
```
|
|
149
|
+
```sh
|
|
140
150
|
pip install -e ".[test]"
|
|
141
151
|
```
|
|
142
152
|
|
|
@@ -148,7 +158,7 @@ In rare cases, you may want to work on GitPython and one or both of its [gitdb](
|
|
|
148
158
|
|
|
149
159
|
If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way:
|
|
150
160
|
|
|
151
|
-
```
|
|
161
|
+
```sh
|
|
152
162
|
pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap
|
|
153
163
|
```
|
|
154
164
|
|
|
@@ -184,42 +194,38 @@ you will encounter test failures.
|
|
|
184
194
|
|
|
185
195
|
Ensure testing libraries are installed. This is taken care of already if you installed with:
|
|
186
196
|
|
|
187
|
-
```
|
|
197
|
+
```sh
|
|
188
198
|
pip install -e ".[test]"
|
|
189
199
|
```
|
|
190
200
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
pip install -r test-requirements.txt
|
|
195
|
-
```
|
|
201
|
+
If you had installed with a command like `pip install -e .` instead, you can still run
|
|
202
|
+
the above command to add the testing dependencies.
|
|
196
203
|
|
|
197
204
|
#### Test commands
|
|
198
205
|
|
|
199
206
|
To test, run:
|
|
200
207
|
|
|
201
|
-
```
|
|
208
|
+
```sh
|
|
202
209
|
pytest
|
|
203
210
|
```
|
|
204
211
|
|
|
205
|
-
To lint, and apply automatic code formatting, run:
|
|
212
|
+
To lint, and apply some linting fixes as well as automatic code formatting, run:
|
|
206
213
|
|
|
207
|
-
```
|
|
214
|
+
```sh
|
|
208
215
|
pre-commit run --all-files
|
|
209
216
|
```
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
- Auto-formatting without other lint checks can be done with: `black .`
|
|
218
|
+
This includes the linting and autoformatting done by Ruff, as well as some other checks.
|
|
213
219
|
|
|
214
220
|
To typecheck, run:
|
|
215
221
|
|
|
216
|
-
```
|
|
217
|
-
mypy
|
|
222
|
+
```sh
|
|
223
|
+
mypy
|
|
218
224
|
```
|
|
219
225
|
|
|
220
226
|
#### CI (and tox)
|
|
221
227
|
|
|
222
|
-
|
|
228
|
+
Style and formatting checks, and running tests on all the different supported Python versions, will be performed:
|
|
223
229
|
|
|
224
230
|
- Upon submitting a pull request.
|
|
225
231
|
- On each push, *if* you have a fork with GitHub Actions enabled.
|
|
@@ -227,10 +233,12 @@ The same linting, and running tests on all the different supported Python versio
|
|
|
227
233
|
|
|
228
234
|
#### Configuration files
|
|
229
235
|
|
|
230
|
-
Specific tools:
|
|
236
|
+
Specific tools are all configured in the `./pyproject.toml` file:
|
|
231
237
|
|
|
232
|
-
-
|
|
233
|
-
-
|
|
238
|
+
- `pytest` (test runner)
|
|
239
|
+
- `coverage.py` (code coverage)
|
|
240
|
+
- `ruff` (linter and formatter)
|
|
241
|
+
- `mypy` (type checker)
|
|
234
242
|
|
|
235
243
|
Orchestration tools:
|
|
236
244
|
|
|
@@ -265,57 +273,6 @@ Please have a look at the [contributions file][contributing].
|
|
|
265
273
|
6. Run `make release`.
|
|
266
274
|
7. Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
|
|
267
275
|
|
|
268
|
-
### How to verify a release (DEPRECATED)
|
|
269
|
-
|
|
270
|
-
Note that what follows is deprecated and future releases won't be signed anymore.
|
|
271
|
-
More details about how it came to that can be found [in this issue](https://github.com/gitpython-developers/gitdb/issues/77).
|
|
272
|
-
|
|
273
|
-
----
|
|
274
|
-
|
|
275
|
-
Please only use releases from `pypi` as you can verify the respective source
|
|
276
|
-
tarballs.
|
|
277
|
-
|
|
278
|
-
This script shows how to verify the tarball was indeed created by the authors of
|
|
279
|
-
this project:
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl > gitpython.whl
|
|
283
|
-
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl.asc > gitpython-signature.asc
|
|
284
|
-
gpg --verify gitpython-signature.asc gitpython.whl
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
which outputs
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
gpg: Signature made Fr 4 Sep 10:04:50 2020 CST
|
|
291
|
-
gpg: using RSA key 27C50E7F590947D7273A741E85194C08421980C9
|
|
292
|
-
gpg: Good signature from "Sebastian Thiel (YubiKey USB-C) <byronimo@gmail.com>" [ultimate]
|
|
293
|
-
gpg: aka "Sebastian Thiel (In Rust I trust) <sebastian.thiel@icloud.com>" [ultimate]
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
You can verify that the keyid indeed matches the release-signature key provided in this
|
|
297
|
-
repository by looking at the keys details:
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
gpg --list-packets ./release-verification-key.asc
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
You can verify that the commit adding it was also signed by it using:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
git show --show-signature ./release-verification-key.asc
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
If you would like to trust it permanently, you can import and sign it:
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
gpg --import ./release-verification-key.asc
|
|
313
|
-
gpg --edit-key 4C08421980C9
|
|
314
|
-
|
|
315
|
-
> sign
|
|
316
|
-
> save
|
|
317
|
-
```
|
|
318
|
-
|
|
319
276
|
### Projects using GitPython
|
|
320
277
|
|
|
321
278
|
- [PyDriller](https://github.com/ishepard/pydriller)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
gitdb<5,>=4.0.1
|
|
2
|
+
|
|
3
|
+
[:python_version < "3.8"]
|
|
4
|
+
typing-extensions>=3.7.4.3
|
|
5
|
+
|
|
6
|
+
[doc]
|
|
7
|
+
sphinx==4.3.2
|
|
8
|
+
sphinx_rtd_theme
|
|
9
|
+
sphinxcontrib-applehelp<=1.0.4,>=1.0.2
|
|
10
|
+
sphinxcontrib-devhelp==1.0.2
|
|
11
|
+
sphinxcontrib-htmlhelp<=2.0.1,>=2.0.0
|
|
12
|
+
sphinxcontrib-qthelp==1.0.3
|
|
13
|
+
sphinxcontrib-serializinghtml==1.1.5
|
|
14
|
+
sphinx-autodoc-typehints
|
|
15
|
+
|
|
16
|
+
[test]
|
|
17
|
+
coverage[toml]
|
|
18
|
+
ddt!=1.4.3,>=1.1.1
|
|
19
|
+
mypy
|
|
20
|
+
pre-commit
|
|
21
|
+
pytest>=7.3.1
|
|
22
|
+
pytest-cov
|
|
23
|
+
pytest-instafail
|
|
24
|
+
pytest-mock
|
|
25
|
+
pytest-sugar
|
|
26
|
+
|
|
27
|
+
[test:python_version < "3.11"]
|
|
28
|
+
typing-extensions
|
|
29
|
+
|
|
30
|
+
[test:python_version < "3.8"]
|
|
31
|
+
mock
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: GitPython
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.43
|
|
4
4
|
Summary: GitPython is a Python library used to interact with Git repositories
|
|
5
5
|
Home-page: https://github.com/gitpython-developers/GitPython
|
|
6
6
|
Author: Sebastian Thiel, Michael Trier
|
|
@@ -30,7 +30,6 @@ License-File: AUTHORS
|
|
|
30
30
|
Requires-Dist: gitdb<5,>=4.0.1
|
|
31
31
|
Requires-Dist: typing-extensions>=3.7.4.3; python_version < "3.8"
|
|
32
32
|
Provides-Extra: test
|
|
33
|
-
Requires-Dist: black; extra == "test"
|
|
34
33
|
Requires-Dist: coverage[toml]; extra == "test"
|
|
35
34
|
Requires-Dist: ddt!=1.4.3,>=1.1.1; extra == "test"
|
|
36
35
|
Requires-Dist: mock; python_version < "3.8" and extra == "test"
|
|
@@ -41,7 +40,16 @@ Requires-Dist: pytest-cov; extra == "test"
|
|
|
41
40
|
Requires-Dist: pytest-instafail; extra == "test"
|
|
42
41
|
Requires-Dist: pytest-mock; extra == "test"
|
|
43
42
|
Requires-Dist: pytest-sugar; extra == "test"
|
|
44
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: typing-extensions; python_version < "3.11" and extra == "test"
|
|
44
|
+
Provides-Extra: doc
|
|
45
|
+
Requires-Dist: sphinx==4.3.2; extra == "doc"
|
|
46
|
+
Requires-Dist: sphinx_rtd_theme; extra == "doc"
|
|
47
|
+
Requires-Dist: sphinxcontrib-applehelp<=1.0.4,>=1.0.2; extra == "doc"
|
|
48
|
+
Requires-Dist: sphinxcontrib-devhelp==1.0.2; extra == "doc"
|
|
49
|
+
Requires-Dist: sphinxcontrib-htmlhelp<=2.0.1,>=2.0.0; extra == "doc"
|
|
50
|
+
Requires-Dist: sphinxcontrib-qthelp==1.0.3; extra == "doc"
|
|
51
|
+
Requires-Dist: sphinxcontrib-serializinghtml==1.1.5; extra == "doc"
|
|
52
|
+
Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
|
|
45
53
|
|
|
46
54
|

|
|
47
55
|
[](https://readthedocs.org/projects/gitpython/?badge=stable)
|
|
@@ -62,6 +70,8 @@ probably the skills to scratch that itch of mine: implement `git` in a way that
|
|
|
62
70
|
If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an
|
|
63
71
|
implementation of 'git' in [Rust](https://www.rust-lang.org).
|
|
64
72
|
|
|
73
|
+
*(Please note that `gitoxide` is not currently available for use in Python, and that Rust is required.)*
|
|
74
|
+
|
|
65
75
|
## GitPython
|
|
66
76
|
|
|
67
77
|
GitPython is a python library used to interact with git repositories, high-level like git-porcelain,
|
|
@@ -82,9 +92,9 @@ The project is open to contributions of all kinds, as well as new maintainers.
|
|
|
82
92
|
|
|
83
93
|
### REQUIREMENTS
|
|
84
94
|
|
|
85
|
-
GitPython needs the `git` executable to be installed on the system and available in your
|
|
86
|
-
If it is not in your `PATH`, you can help GitPython find it
|
|
87
|
-
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
|
|
95
|
+
GitPython needs the `git` executable to be installed on the system and available in your
|
|
96
|
+
`PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it
|
|
97
|
+
by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
|
|
88
98
|
|
|
89
99
|
- Git (1.7.x or newer)
|
|
90
100
|
- Python >= 3.7
|
|
@@ -100,7 +110,7 @@ GitPython and its required package dependencies can be installed in any of the f
|
|
|
100
110
|
|
|
101
111
|
To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:
|
|
102
112
|
|
|
103
|
-
```
|
|
113
|
+
```sh
|
|
104
114
|
pip install GitPython
|
|
105
115
|
```
|
|
106
116
|
|
|
@@ -110,7 +120,7 @@ pip install GitPython
|
|
|
110
120
|
|
|
111
121
|
If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:
|
|
112
122
|
|
|
113
|
-
```
|
|
123
|
+
```sh
|
|
114
124
|
pip install .
|
|
115
125
|
```
|
|
116
126
|
|
|
@@ -118,7 +128,7 @@ pip install .
|
|
|
118
128
|
|
|
119
129
|
To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython) from source to work on the code, you can do it like so:
|
|
120
130
|
|
|
121
|
-
```
|
|
131
|
+
```sh
|
|
122
132
|
git clone https://github.com/gitpython-developers/GitPython
|
|
123
133
|
cd GitPython
|
|
124
134
|
./init-tests-after-clone.sh
|
|
@@ -128,7 +138,7 @@ On Windows, `./init-tests-after-clone.sh` can be run in a Git Bash shell.
|
|
|
128
138
|
|
|
129
139
|
If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`):
|
|
130
140
|
|
|
131
|
-
```
|
|
141
|
+
```sh
|
|
132
142
|
gh repo clone GitPython
|
|
133
143
|
```
|
|
134
144
|
|
|
@@ -136,7 +146,7 @@ Having cloned the repo, create and activate your [virtual environment](https://d
|
|
|
136
146
|
|
|
137
147
|
Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
|
|
138
148
|
|
|
139
|
-
```
|
|
149
|
+
```sh
|
|
140
150
|
pip install -e ".[test]"
|
|
141
151
|
```
|
|
142
152
|
|
|
@@ -148,7 +158,7 @@ In rare cases, you may want to work on GitPython and one or both of its [gitdb](
|
|
|
148
158
|
|
|
149
159
|
If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way:
|
|
150
160
|
|
|
151
|
-
```
|
|
161
|
+
```sh
|
|
152
162
|
pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap
|
|
153
163
|
```
|
|
154
164
|
|
|
@@ -184,42 +194,38 @@ you will encounter test failures.
|
|
|
184
194
|
|
|
185
195
|
Ensure testing libraries are installed. This is taken care of already if you installed with:
|
|
186
196
|
|
|
187
|
-
```
|
|
197
|
+
```sh
|
|
188
198
|
pip install -e ".[test]"
|
|
189
199
|
```
|
|
190
200
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
pip install -r test-requirements.txt
|
|
195
|
-
```
|
|
201
|
+
If you had installed with a command like `pip install -e .` instead, you can still run
|
|
202
|
+
the above command to add the testing dependencies.
|
|
196
203
|
|
|
197
204
|
#### Test commands
|
|
198
205
|
|
|
199
206
|
To test, run:
|
|
200
207
|
|
|
201
|
-
```
|
|
208
|
+
```sh
|
|
202
209
|
pytest
|
|
203
210
|
```
|
|
204
211
|
|
|
205
|
-
To lint, and apply automatic code formatting, run:
|
|
212
|
+
To lint, and apply some linting fixes as well as automatic code formatting, run:
|
|
206
213
|
|
|
207
|
-
```
|
|
214
|
+
```sh
|
|
208
215
|
pre-commit run --all-files
|
|
209
216
|
```
|
|
210
217
|
|
|
211
|
-
|
|
212
|
-
- Auto-formatting without other lint checks can be done with: `black .`
|
|
218
|
+
This includes the linting and autoformatting done by Ruff, as well as some other checks.
|
|
213
219
|
|
|
214
220
|
To typecheck, run:
|
|
215
221
|
|
|
216
|
-
```
|
|
217
|
-
mypy
|
|
222
|
+
```sh
|
|
223
|
+
mypy
|
|
218
224
|
```
|
|
219
225
|
|
|
220
226
|
#### CI (and tox)
|
|
221
227
|
|
|
222
|
-
|
|
228
|
+
Style and formatting checks, and running tests on all the different supported Python versions, will be performed:
|
|
223
229
|
|
|
224
230
|
- Upon submitting a pull request.
|
|
225
231
|
- On each push, *if* you have a fork with GitHub Actions enabled.
|
|
@@ -227,10 +233,12 @@ The same linting, and running tests on all the different supported Python versio
|
|
|
227
233
|
|
|
228
234
|
#### Configuration files
|
|
229
235
|
|
|
230
|
-
Specific tools:
|
|
236
|
+
Specific tools are all configured in the `./pyproject.toml` file:
|
|
231
237
|
|
|
232
|
-
-
|
|
233
|
-
-
|
|
238
|
+
- `pytest` (test runner)
|
|
239
|
+
- `coverage.py` (code coverage)
|
|
240
|
+
- `ruff` (linter and formatter)
|
|
241
|
+
- `mypy` (type checker)
|
|
234
242
|
|
|
235
243
|
Orchestration tools:
|
|
236
244
|
|
|
@@ -265,57 +273,6 @@ Please have a look at the [contributions file][contributing].
|
|
|
265
273
|
6. Run `make release`.
|
|
266
274
|
7. Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
|
|
267
275
|
|
|
268
|
-
### How to verify a release (DEPRECATED)
|
|
269
|
-
|
|
270
|
-
Note that what follows is deprecated and future releases won't be signed anymore.
|
|
271
|
-
More details about how it came to that can be found [in this issue](https://github.com/gitpython-developers/gitdb/issues/77).
|
|
272
|
-
|
|
273
|
-
----
|
|
274
|
-
|
|
275
|
-
Please only use releases from `pypi` as you can verify the respective source
|
|
276
|
-
tarballs.
|
|
277
|
-
|
|
278
|
-
This script shows how to verify the tarball was indeed created by the authors of
|
|
279
|
-
this project:
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl > gitpython.whl
|
|
283
|
-
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl.asc > gitpython-signature.asc
|
|
284
|
-
gpg --verify gitpython-signature.asc gitpython.whl
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
which outputs
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
gpg: Signature made Fr 4 Sep 10:04:50 2020 CST
|
|
291
|
-
gpg: using RSA key 27C50E7F590947D7273A741E85194C08421980C9
|
|
292
|
-
gpg: Good signature from "Sebastian Thiel (YubiKey USB-C) <byronimo@gmail.com>" [ultimate]
|
|
293
|
-
gpg: aka "Sebastian Thiel (In Rust I trust) <sebastian.thiel@icloud.com>" [ultimate]
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
You can verify that the keyid indeed matches the release-signature key provided in this
|
|
297
|
-
repository by looking at the keys details:
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
gpg --list-packets ./release-verification-key.asc
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
You can verify that the commit adding it was also signed by it using:
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
git show --show-signature ./release-verification-key.asc
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
If you would like to trust it permanently, you can import and sign it:
|
|
310
|
-
|
|
311
|
-
```bash
|
|
312
|
-
gpg --import ./release-verification-key.asc
|
|
313
|
-
gpg --edit-key 4C08421980C9
|
|
314
|
-
|
|
315
|
-
> sign
|
|
316
|
-
> save
|
|
317
|
-
```
|
|
318
|
-
|
|
319
276
|
### Projects using GitPython
|
|
320
277
|
|
|
321
278
|
- [PyDriller](https://github.com/ishepard/pydriller)
|