Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 0 additions & 144 deletions .basedpyright/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,75 +8,9 @@
"endColumn": 45,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 41,
"endColumn": 48,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 32,
"endColumn": 39,
"lineCount": 1
}
},
{
"code": "reportCallIssue",
"range": {
"startColumn": 25,
"endColumn": 46,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 39,
"lineCount": 1
}
}
],
"./git/db.py": [
{
"code": "reportIncompatibleMethodOverride",
"range": {
"startColumn": 8,
"endColumn": 12,
"lineCount": 1
}
},
{
"code": "reportIncompatibleMethodOverride",
"range": {
"startColumn": 8,
"endColumn": 14,
"lineCount": 1
}
}
],
"./git/index/base.py": [
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 36,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 28,
"endColumn": 34,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
Expand Down Expand Up @@ -186,14 +120,6 @@
"endColumn": 25,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 52,
"endColumn": 84,
"lineCount": 1
}
}
],
"./git/objects/tag.py": [
Expand Down Expand Up @@ -274,32 +200,6 @@
}
}
],
"./git/refs/log.py": [
{
"code": "reportArgumentType",
"range": {
"startColumn": 30,
"endColumn": 34,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 17,
"endColumn": 22,
"lineCount": 1
}
},
{
"code": "reportArgumentType",
"range": {
"startColumn": 28,
"endColumn": 30,
"lineCount": 1
}
}
],
"./git/refs/reference.py": [
{
"code": "reportIncompatibleVariableOverride",
Expand All @@ -310,16 +210,6 @@
}
}
],
"./git/refs/symbolic.py": [
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 15,
"endColumn": 20,
"lineCount": 1
}
}
],
"./git/refs/tag.py": [
{
"code": "reportIncompatibleMethodOverride",
Expand All @@ -339,22 +229,6 @@
}
],
"./git/remote.py": [
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 26,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
"startColumn": 26,
"endColumn": 38,
"lineCount": 1
}
},
{
"code": "reportAttributeAccessIssue",
"range": {
Expand All @@ -373,14 +247,6 @@
}
],
"./git/repo/base.py": [
{
"code": "reportReturnType",
"range": {
"startColumn": 15,
"endColumn": 28,
"lineCount": 1
}
},
{
"code": "reportTypedDictNotRequiredAccess",
"range": {
Expand Down Expand Up @@ -446,16 +312,6 @@
}
}
],
"./git/repo/fun.py": [
{
"code": "reportReturnType",
"range": {
"startColumn": 11,
"endColumn": 20,
"lineCount": 1
}
}
],
"./test/deprecation/test_basic.py": [
{
"code": "reportUnusedExpression",
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@ jobs:
- name: Install Cygwin
uses: cygwin/cygwin-install-action@v6
with:
packages: curl git python39 python-setuptools-wheel
packages: >-
curl gcc-core git libcurl-devel libexpat-devel libiconv-devel
libssl-devel make python39 python-setuptools-wheel zlib-devel
add-to-path: false # No need to change $PATH outside the Cygwin environment.

- name: Arrange for verbose output
run: |
# Arrange for verbose output but without shell environment setup details.
echo 'set -x' >~/.bash_profile

- name: Build minimum supported Cygwin Git
run: |
# Cygwin's packaged Git is older than our minimum supported version.
git clone --depth 1 --branch v2.52.0 -- https://github.com/git/git.git /tmp/git-source
# Use Cygwin's normal prefix: GitPython checks for uname next to git.
make -C /tmp/git-source -j2 prefix=/usr NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=YesPlease install
hash -r
test "$(git version)" = 'git version 2.52.0'

- name: Special configuration for Cygwin git
run: |
git config --global --add safe.directory "$(pwd)"
Expand Down Expand Up @@ -87,6 +98,9 @@ jobs:
run: |
pip install ./smmap ./gitdb '.[test]'

- name: Verify Cygwin Git detection
run: python -c 'from git import Git; assert Git.is_cygwin()'

- name: Show POSIX file ownership
# Cygwin's `ls -ld` reports the NTFS Owner SID via Cygwin's SID-to-uid
# mapping (well-known SIDs by their RID, machine-local accounts by
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Downstream compatibility

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
project: [langchain, mlflow, bandit, swebench, datahub]
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Ensure Git 2.52 or newer
run: |
if ! dpkg --compare-versions "$(git version | awk '{print $3}')" ge 2.52; then
sudo add-apt-repository --yes ppa:git-core/ppa
sudo apt-get update
sudo apt-get install --yes git
fi
- name: Install uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: '0.12.13'
enable-cache: false
- name: Test latest release against this checkout
run: uv run test/downstream/run.py "${{ matrix.project }}"
42 changes: 42 additions & 0 deletions .github/workflows/git-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Minimum Git CLI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
git-2-52:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
with:
repository: git/git
ref: v2.52.0
path: .git-source
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Build minimum supported Git
working-directory: .git-source
run: |
make -j2 prefix="$RUNNER_TEMP/git" NO_GETTEXT=YesPlease NO_TCLTK=YesPlease NO_PERL=YesPlease NO_CURL=YesPlease install
echo "$RUNNER_TEMP/git/bin" >> "$GITHUB_PATH"
- name: Install GitPython and test dependencies
run: python -m pip install ./smmap ./gitdb '.[test]'
- name: Verify native format and safety contracts
env:
GIT_CONFIG_NOSYSTEM: '1'
GIT_CONFIG_GLOBAL: /dev/null
GIT_AUTHOR_NAME: GitPython Tests
GIT_AUTHOR_EMAIL: tests@example.invalid
GIT_COMMITTER_NAME: GitPython Tests
GIT_COMMITTER_EMAIL: tests@example.invalid
run: |
git version
python -m pytest --no-cov --tb=short test/test_cli_objects_index.py test/test_cli_safety.py test/test_reflog.py test/test_config.py test/test_remote_cli.py test/test_submodule.py::test_submodule_cli_lifecycle
13 changes: 13 additions & 0 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,19 @@ jobs:
with:
wsl-version: 1

- name: Install current Git (Linux)
if: matrix.os-type == 'ubuntu'
run: |
sudo add-apt-repository --yes ppa:git-core/ppa
sudo apt-get update
sudo apt-get install --yes git

- name: Install current Git (macOS)
if: matrix.os-type == 'macos'
run: |
brew install git
echo "$(brew --prefix git)/bin" >> "$GITHUB_PATH"

- name: Prepare this repo for tests
run: |
./init-tests-after-clone.sh
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ The project is open to contributions of all kinds, as well as new maintainers.
### REQUIREMENTS

GitPython needs the `git` executable to be installed on the system and available in your
`PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it
`PATH` for repository operations. If it is not in your `PATH`, you can help GitPython find it
by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.

- Git (1.7.x or newer)
- Git (2.52 or newer)
- Python >= 3.8

The list of dependencies are listed in [`./requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/requirements.txt) and [`./test-requirements.txt`](https://github.com/gitpython-developers/GitPython/blob/main/test-requirements.txt).
Expand Down
Loading
Loading