Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87cc325

Browse filesBrowse files
committed
2 parents a4eb2b3 + fbac514 commit 87cc325
Copy full SHA for 87cc325

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

71 files changed

+1141
-754
lines changed

‎.flake8

Copy file name to clipboard
+7-19Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,26 @@
11
[flake8]
2+
23
show-source = True
3-
count= True
4+
count = True
45
statistics = True
5-
# E265 = comment blocks like @{ section, which it can't handle
6+
67
# E266 = too many leading '#' for block comment
78
# E731 = do not assign a lambda expression, use a def
8-
# W293 = Blank line contains whitespace
9-
# W504 = Line break after operator
10-
# E704 = multiple statements in one line - used for @override
119
# TC002 = move third party import to TYPE_CHECKING
12-
# ANN = flake8-annotations
1310
# TC, TC2 = flake8-type-checking
14-
# D = flake8-docstrings
1511

1612
# select = C,E,F,W ANN, TC, TC2 # to enable code. Disabled if not listed, including builtin codes
1713
enable-extensions = TC, TC2 # only needed for extensions not enabled by default
1814

19-
ignore = E265,E266,E731,E704,
20-
W293, W504,
21-
ANN0 ANN1 ANN2,
22-
TC002,
23-
TC0, TC1, TC2
24-
# B,
25-
A,
26-
D,
27-
RST, RST3
15+
ignore = E266, E731
2816

29-
exclude = .tox,.venv,build,dist,doc,git/ext/,test
17+
exclude = .tox, .venv, build, dist, doc, git/ext/
3018

3119
rst-roles = # for flake8-RST-docstrings
32-
attr,class,func,meth,mod,obj,ref,term,var # used by sphinx
20+
attr, class, func, meth, mod, obj, ref, term, var # used by sphinx
3321

3422
min-python-version = 3.7.0
3523

3624
# for `black` compatibility
3725
max-line-length = 120
38-
extend-ignore = E203,W503
26+
extend-ignore = E203, W503

‎.gitattributes

Copy file name to clipboard
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
test/fixtures/* eol=lf
2-
init-tests-after-clone.sh
2+
*.sh eol=lf
3+
/Makefile eol=lf

‎.github/dependabot.yml

Copy file name to clipboardExpand all lines: .github/dependabot.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ updates:
33
- package-ecosystem: "github-actions"
44
directory: "/"
55
schedule:
6-
interval: "weekly"
6+
interval: "weekly"

‎.github/workflows/cygwin-test.yml

Copy file name to clipboardExpand all lines: .github/workflows/cygwin-test.yml
+28-18Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ on: [push, pull_request, workflow_dispatch]
55
jobs:
66
build:
77
runs-on: windows-latest
8+
89
strategy:
910
fail-fast: false
11+
1012
env:
1113
CHERE_INVOKING: 1
12-
SHELLOPTS: igncr
1314
TMP: "/tmp"
1415
TEMP: "/tmp"
16+
1517
defaults:
1618
run:
17-
shell: bash.exe --noprofile --norc -exo pipefail -o igncr "{0}"
19+
shell: C:\cygwin\bin\bash.exe --noprofile --norc -exo pipefail -o igncr "{0}"
1820

1921
steps:
2022
- name: Force LF line endings
21-
run: git config --global core.autocrlf input
23+
run: |
24+
git config --global core.autocrlf false # Affects the non-Cygwin git.
25+
shell: bash
2226

2327
- uses: actions/checkout@v4
2428
with:
@@ -29,36 +33,42 @@ jobs:
2933
with:
3034
packages: python39 python39-pip python39-virtualenv git
3135

32-
- name: Show python and git versions
36+
- name: Special configuration for Cygwin's git
3337
run: |
34-
/usr/bin/python --version
35-
/usr/bin/git version
36-
37-
- name: Tell git to trust this repo
38-
run: |
39-
/usr/bin/git config --global --add safe.directory "$(pwd)"
38+
git config --global --add safe.directory "$(pwd)"
39+
git config --global core.autocrlf false
4040
4141
- name: Prepare this repo for tests
4242
run: |
43-
TRAVIS=yes ./init-tests-after-clone.sh
43+
./init-tests-after-clone.sh
4444
45-
- name: Further prepare git configuration for tests
45+
- name: Set git user identity and command aliases for the tests
4646
run: |
47-
/usr/bin/git config --global user.email "travis@ci.com"
48-
/usr/bin/git config --global user.name "Travis Runner"
47+
git config --global user.email "travis@ci.com"
48+
git config --global user.name "Travis Runner"
4949
# If we rewrite the user's config by accident, we will mess it up
5050
# and cause subsequent tests to fail
5151
cat test/fixtures/.gitconfig >> ~/.gitconfig
5252
5353
- name: Update PyPA packages
5454
run: |
55-
/usr/bin/python -m pip install --upgrade pip setuptools wheel
55+
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
56+
python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel
5657
5758
- name: Install project and test dependencies
5859
run: |
59-
/usr/bin/python -m pip install ".[test]"
60+
python -m pip install ".[test]"
61+
62+
- name: Show version and platform information
63+
run: |
64+
uname -a
65+
command -v git python
66+
git version
67+
python --version
68+
python -c 'import sys; print(sys.platform)'
69+
python -c 'import os; print(os.name)'
70+
python -c 'import git; print(git.compat.is_win)'
6071
6172
- name: Test with pytest
6273
run: |
63-
set +x
64-
/usr/bin/python -m pytest
74+
python -m pytest --color=yes -p no:sugar --instafail -vv

‎.github/workflows/lint.yml

Copy file name to clipboardExpand all lines: .github/workflows/lint.yml
+11-5Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v4
12-
with:
13-
python-version: "3.x"
14-
- uses: pre-commit/action@v3.0.0
10+
- uses: actions/checkout@v4
11+
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: "3.x"
15+
16+
- uses: pre-commit/action@v3.0.0
17+
with:
18+
extra_args: --all-files --hook-stage manual
19+
env:
20+
SKIP: black-format

‎.github/workflows/pythonpackage.yml

Copy file name to clipboardExpand all lines: .github/workflows/pythonpackage.yml
+18-18Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ permissions:
1010

1111
jobs:
1212
build:
13-
1413
runs-on: ubuntu-latest
14+
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1919
include:
20-
- experimental: false
21-
- python-version: "3.12"
22-
experimental: true
20+
- experimental: false
21+
2322
defaults:
2423
run:
2524
shell: /bin/bash --noprofile --norc -exo pipefail {0}
@@ -36,16 +35,11 @@ jobs:
3635
python-version: ${{ matrix.python-version }}
3736
allow-prereleases: ${{ matrix.experimental }}
3837

39-
- name: Show python and git versions
40-
run: |
41-
python --version
42-
git version
43-
4438
- name: Prepare this repo for tests
4539
run: |
46-
TRAVIS=yes ./init-tests-after-clone.sh
40+
./init-tests-after-clone.sh
4741
48-
- name: Prepare git configuration for tests
42+
- name: Set git user identity and command aliases for the tests
4943
run: |
5044
git config --global user.email "travis@ci.com"
5145
git config --global user.name "Travis Runner"
@@ -55,17 +49,23 @@ jobs:
5549
5650
- name: Update PyPA packages
5751
run: |
58-
python -m pip install --upgrade pip
59-
if pip freeze --all | grep --quiet '^setuptools=='; then
60-
# Python prior to 3.12 ships setuptools. Upgrade it if present.
61-
python -m pip install --upgrade setuptools
62-
fi
63-
python -m pip install --upgrade wheel
52+
# Get the latest pip, wheel, and prior to Python 3.12, setuptools.
53+
python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel
6454
6555
- name: Install project and test dependencies
6656
run: |
6757
pip install ".[test]"
6858
59+
- name: Show version and platform information
60+
run: |
61+
uname -a
62+
command -v git python
63+
git version
64+
python --version
65+
python -c 'import sys; print(sys.platform)'
66+
python -c 'import os; print(os.name)'
67+
python -c 'import git; print(git.compat.is_win)'
68+
6969
- name: Check types with mypy
7070
run: |
7171
mypy -p git
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Test with pytest
7777
run: |
78-
pytest
78+
pytest --color=yes -p no:sugar --instafail -vv
7979
continue-on-error: false
8080

8181
- name: Documentation

‎.gitignore

Copy file name to clipboardExpand all lines: .gitignore
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
*.py[co]
22
*.swp
33
*~
4+
.env/
5+
env/
46
.venv/
57
venv/
68
/*.egg-info
79
/lib/GitPython.egg-info
810
cover/
911
.coverage
12+
.coverage.*
1013
/build
1114
/dist
1215
/doc/_build
@@ -22,4 +25,3 @@ nbproject
2225
.pytest_cache/
2326
monkeytype.sqlite3
2427
output.txt
25-
tox.ini

‎.pre-commit-config.yaml

Copy file name to clipboard
+37-17Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
repos:
2-
- repo: https://github.com/PyCQA/flake8
3-
rev: 6.0.0
4-
hooks:
5-
- id: flake8
6-
additional_dependencies:
7-
[
8-
flake8-bugbear==22.12.6,
9-
flake8-comprehensions==3.10.1,
10-
flake8-typing-imports==1.14.0,
11-
]
12-
exclude: ^doc|^git/ext/|^test/
2+
- repo: https://github.com/psf/black-pre-commit-mirror
3+
rev: 23.9.1
4+
hooks:
5+
- id: black
6+
alias: black-check
7+
name: black (check)
8+
args: [--check, --diff]
9+
exclude: ^git/ext/
10+
stages: [manual]
1311

14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v4.4.0
16-
hooks:
17-
- id: check-merge-conflict
18-
- id: check-toml
19-
- id: check-yaml
12+
- id: black
13+
alias: black-format
14+
name: black (format)
15+
exclude: ^git/ext/
16+
17+
- repo: https://github.com/PyCQA/flake8
18+
rev: 6.1.0
19+
hooks:
20+
- id: flake8
21+
additional_dependencies:
22+
- flake8-bugbear==23.9.16
23+
- flake8-comprehensions==3.14.0
24+
- flake8-typing-imports==1.14.0
25+
exclude: ^doc|^git/ext/
26+
27+
- repo: https://github.com/shellcheck-py/shellcheck-py
28+
rev: v0.9.0.5
29+
hooks:
30+
- id: shellcheck
31+
args: [--color]
32+
exclude: ^git/ext/
33+
34+
- repo: https://github.com/pre-commit/pre-commit-hooks
35+
rev: v4.4.0
36+
hooks:
37+
- id: check-toml
38+
- id: check-yaml
39+
- id: check-merge-conflict

‎AUTHORS

Copy file name to clipboardExpand all lines: AUTHORS
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ Contributors are:
5252
-Joseph Hale <me _at_ jhale.dev>
5353
-Santos Gallegos <stsewd _at_ proton.me>
5454
-Wenhan Zhu <wzhu.cosmos _at_ gmail.com>
55+
5556
Portions derived from other open source works and are clearly marked.

‎CONTRIBUTING.md

Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
The following is a short step-by-step rundown of what one typically would do to contribute.
44

5-
- [fork this project](https://github.com/gitpython-developers/GitPython/fork) on GitHub.
5+
- [Fork this project](https://github.com/gitpython-developers/GitPython/fork) on GitHub.
66
- For setting up the environment to run the self tests, please run `init-tests-after-clone.sh`.
77
- Please try to **write a test that fails unless the contribution is present.**
88
- Try to avoid massive commits and prefer to take small steps, with one commit for each.

‎LICENSE

Copy file name to clipboard
+17-18Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
Copyright (C) 2008, 2009 Michael Trier and contributors
22
All rights reserved.
33

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
66
are met:
77

8-
* Redistributions of source code must retain the above copyright
8+
* Redistributions of source code must retain the above copyright
99
notice, this list of conditions and the following disclaimer.
1010

11-
* Redistributions in binary form must reproduce the above copyright
12-
notice, this list of conditions and the following disclaimer in the
11+
* Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
1313
documentation and/or other materials provided with the distribution.
1414

15-
* Neither the name of the GitPython project nor the names of
16-
its contributors may be used to endorse or promote products derived
15+
* Neither the name of the GitPython project nor the names of
16+
its contributors may be used to endorse or promote products derived
1717
from this software without specific prior written permission.
1818

19-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25-
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26-
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27-
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28-
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2929
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30-

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.