-
-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/DeflateAwning/GitPython
- Loading branch information
Showing
71 changed files
with
1,141 additions
and
754 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,26 @@ | ||
[flake8] | ||
|
||
show-source = True | ||
count= True | ||
count = True | ||
statistics = True | ||
# E265 = comment blocks like @{ section, which it can't handle | ||
|
||
# E266 = too many leading '#' for block comment | ||
# E731 = do not assign a lambda expression, use a def | ||
# W293 = Blank line contains whitespace | ||
# W504 = Line break after operator | ||
# E704 = multiple statements in one line - used for @override | ||
# TC002 = move third party import to TYPE_CHECKING | ||
# ANN = flake8-annotations | ||
# TC, TC2 = flake8-type-checking | ||
# D = flake8-docstrings | ||
|
||
# select = C,E,F,W ANN, TC, TC2 # to enable code. Disabled if not listed, including builtin codes | ||
enable-extensions = TC, TC2 # only needed for extensions not enabled by default | ||
|
||
ignore = E265,E266,E731,E704, | ||
W293, W504, | ||
ANN0 ANN1 ANN2, | ||
TC002, | ||
TC0, TC1, TC2 | ||
# B, | ||
A, | ||
D, | ||
RST, RST3 | ||
ignore = E266, E731 | ||
|
||
exclude = .tox,.venv,build,dist,doc,git/ext/,test | ||
exclude = .tox, .venv, build, dist, doc, git/ext/ | ||
|
||
rst-roles = # for flake8-RST-docstrings | ||
attr,class,func,meth,mod,obj,ref,term,var # used by sphinx | ||
attr, class, func, meth, mod, obj, ref, term, var # used by sphinx | ||
|
||
min-python-version = 3.7.0 | ||
|
||
# for `black` compatibility | ||
max-line-length = 120 | ||
extend-ignore = E203,W503 | ||
extend-ignore = E203, W503 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
test/fixtures/* eol=lf | ||
init-tests-after-clone.sh | ||
*.sh eol=lf | ||
/Makefile eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ updates: | |
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,24 @@ on: [push, pull_request, workflow_dispatch] | |
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
env: | ||
CHERE_INVOKING: 1 | ||
SHELLOPTS: igncr | ||
TMP: "/tmp" | ||
TEMP: "/tmp" | ||
|
||
defaults: | ||
run: | ||
shell: bash.exe --noprofile --norc -exo pipefail -o igncr "{0}" | ||
shell: C:\cygwin\bin\bash.exe --noprofile --norc -exo pipefail -o igncr "{0}" | ||
|
||
steps: | ||
- name: Force LF line endings | ||
run: git config --global core.autocrlf input | ||
run: | | ||
git config --global core.autocrlf false # Affects the non-Cygwin git. | ||
shell: bash | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -29,36 +33,42 @@ jobs: | |
with: | ||
packages: python39 python39-pip python39-virtualenv git | ||
|
||
- name: Show python and git versions | ||
- name: Special configuration for Cygwin's git | ||
run: | | ||
/usr/bin/python --version | ||
/usr/bin/git version | ||
- name: Tell git to trust this repo | ||
run: | | ||
/usr/bin/git config --global --add safe.directory "$(pwd)" | ||
git config --global --add safe.directory "$(pwd)" | ||
git config --global core.autocrlf false | ||
- name: Prepare this repo for tests | ||
run: | | ||
TRAVIS=yes ./init-tests-after-clone.sh | ||
./init-tests-after-clone.sh | ||
- name: Further prepare git configuration for tests | ||
- name: Set git user identity and command aliases for the tests | ||
run: | | ||
/usr/bin/git config --global user.email "[email protected]" | ||
/usr/bin/git config --global user.name "Travis Runner" | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis Runner" | ||
# If we rewrite the user's config by accident, we will mess it up | ||
# and cause subsequent tests to fail | ||
cat test/fixtures/.gitconfig >> ~/.gitconfig | ||
- name: Update PyPA packages | ||
run: | | ||
/usr/bin/python -m pip install --upgrade pip setuptools wheel | ||
# Get the latest pip, wheel, and prior to Python 3.12, setuptools. | ||
python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel | ||
- name: Install project and test dependencies | ||
run: | | ||
/usr/bin/python -m pip install ".[test]" | ||
python -m pip install ".[test]" | ||
- name: Show version and platform information | ||
run: | | ||
uname -a | ||
command -v git python | ||
git version | ||
python --version | ||
python -c 'import sys; print(sys.platform)' | ||
python -c 'import os; print(os.name)' | ||
python -c 'import git; print(git.compat.is_win)' | ||
- name: Test with pytest | ||
run: | | ||
set +x | ||
/usr/bin/python -m pytest | ||
python -m pytest --color=yes -p no:sugar --instafail -vv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,14 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- uses: pre-commit/[email protected] | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
|
||
- uses: pre-commit/[email protected] | ||
with: | ||
extra_args: --all-files --hook-stage manual | ||
env: | ||
SKIP: black-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 +10,15 @@ permissions: | |
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
include: | ||
- experimental: false | ||
- python-version: "3.12" | ||
experimental: true | ||
- experimental: false | ||
|
||
defaults: | ||
run: | ||
shell: /bin/bash --noprofile --norc -exo pipefail {0} | ||
|
@@ -36,16 +35,11 @@ jobs: | |
python-version: ${{ matrix.python-version }} | ||
allow-prereleases: ${{ matrix.experimental }} | ||
|
||
- name: Show python and git versions | ||
run: | | ||
python --version | ||
git version | ||
- name: Prepare this repo for tests | ||
run: | | ||
TRAVIS=yes ./init-tests-after-clone.sh | ||
./init-tests-after-clone.sh | ||
- name: Prepare git configuration for tests | ||
- name: Set git user identity and command aliases for the tests | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis Runner" | ||
|
@@ -55,17 +49,23 @@ jobs: | |
- name: Update PyPA packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
if pip freeze --all | grep --quiet '^setuptools=='; then | ||
# Python prior to 3.12 ships setuptools. Upgrade it if present. | ||
python -m pip install --upgrade setuptools | ||
fi | ||
python -m pip install --upgrade wheel | ||
# Get the latest pip, wheel, and prior to Python 3.12, setuptools. | ||
python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel | ||
- name: Install project and test dependencies | ||
run: | | ||
pip install ".[test]" | ||
- name: Show version and platform information | ||
run: | | ||
uname -a | ||
command -v git python | ||
git version | ||
python --version | ||
python -c 'import sys; print(sys.platform)' | ||
python -c 'import os; print(os.name)' | ||
python -c 'import git; print(git.compat.is_win)' | ||
- name: Check types with mypy | ||
run: | | ||
mypy -p git | ||
|
@@ -75,7 +75,7 @@ jobs: | |
|
||
- name: Test with pytest | ||
run: | | ||
pytest | ||
pytest --color=yes -p no:sugar --instafail -vv | ||
continue-on-error: false | ||
|
||
- name: Documentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,39 @@ | ||
repos: | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
[ | ||
flake8-bugbear==22.12.6, | ||
flake8-comprehensions==3.10.1, | ||
flake8-typing-imports==1.14.0, | ||
] | ||
exclude: ^doc|^git/ext/|^test/ | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
alias: black-check | ||
name: black (check) | ||
args: [--check, --diff] | ||
exclude: ^git/ext/ | ||
stages: [manual] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: black | ||
alias: black-format | ||
name: black (format) | ||
exclude: ^git/ext/ | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: | ||
- flake8-bugbear==23.9.16 | ||
- flake8-comprehensions==3.14.0 | ||
- flake8-typing-imports==1.14.0 | ||
exclude: ^doc|^git/ext/ | ||
|
||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: v0.9.0.5 | ||
hooks: | ||
- id: shellcheck | ||
args: [--color] | ||
exclude: ^git/ext/ | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-toml | ||
- id: check-yaml | ||
- id: check-merge-conflict |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,29 @@ | ||
Copyright (C) 2008, 2009 Michael Trier and contributors | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
|
||
* Neither the name of the GitPython project nor the names of | ||
its contributors may be used to endorse or promote products derived | ||
* Neither the name of the GitPython project nor the names of | ||
its contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
Oops, something went wrong.