Skip to content

Commit 8ecda9e

Browse files
authored
Merge pull request #2179 from gitpython-developers/subtree-merge-deps
Merge gitdb and smmap into the GitPython repository
2 parents e3221f1 + 8a08afa commit 8ecda9e

118 files changed

Lines changed: 9982 additions & 166 deletions

File tree

Some content is hidden

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

.github/dependabot.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ updates:
66
schedule:
77
interval: weekly
88

9-
- package-ecosystem: gitsubmodule
10-
directory: "/"
11-
schedule:
12-
interval: weekly
13-
149
- package-ecosystem: pre-commit
1510
directory: "/"
1611
schedule:

.github/workflows/alpine-test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,13 @@ jobs:
6363
- name: Install project and test dependencies
6464
run: |
6565
. .venv/bin/activate
66-
pip install '.[test]'
66+
pip install ./smmap ./gitdb '.[test]'
6767
6868
- name: Show POSIX file ownership
6969
run: |
7070
ls -ld -- \
7171
"$(pwd)" \
7272
"$(pwd)/.git" \
73-
"$(pwd)/git/ext/gitdb" \
74-
"$(pwd)/git/ext/gitdb/.git" \
75-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
76-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
7773
"${HOME:?HOME is not set}/.gitconfig" \
7874
2>&1 || true
7975

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ jobs:
6262
with:
6363
languages: ${{ matrix.language }}
6464
build-mode: ${{ matrix.build-mode }}
65+
config: |
66+
paths-ignore:
67+
- gitdb/gitdb/test/**
68+
- smmap/smmap/test/**
6569
# If you wish to specify custom queries, you can do so here or in a config file.
6670
# By default, queries listed here will override any specified in a config file.
6771
# Prefix the list here with "+" to use these queries and those in the config file.

.github/workflows/cygwin-test.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ jobs:
5757
run: |
5858
git config --global --add safe.directory "$(pwd)"
5959
git config --global --add safe.directory "$(pwd)/.git"
60-
git config --global --add safe.directory "$(pwd)/git/ext/gitdb"
61-
git config --global --add safe.directory "$(pwd)/git/ext/gitdb/gitdb/ext/smmap"
6260
git config --global core.autocrlf false
6361
6462
- name: Prepare this repo for tests
@@ -84,7 +82,7 @@ jobs:
8482
8583
- name: Install project and test dependencies
8684
run: |
87-
pip install '.[test]'
85+
pip install ./smmap ./gitdb '.[test]'
8886
8987
- name: Show POSIX file ownership
9088
# Cygwin's `ls -ld` reports the NTFS Owner SID via Cygwin's SID-to-uid
@@ -96,12 +94,6 @@ jobs:
9694
ls -ld -- \
9795
"$(pwd)" \
9896
"$(pwd)/.git" \
99-
"$(pwd)/git/ext/gitdb" \
100-
"$(pwd)/git/ext/gitdb/.git" \
101-
"$(pwd)/.git/modules/gitdb" \
102-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
103-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
104-
"$(pwd)/.git/modules/gitdb/modules/smmap" \
10597
"${HOME:?HOME is not set}/.gitconfig" \
10698
2>&1 || true
10799
@@ -114,12 +106,6 @@ jobs:
114106
$paths = @(
115107
"$pwd",
116108
"$pwd\.git",
117-
"$pwd\git\ext\gitdb",
118-
"$pwd\git\ext\gitdb\.git",
119-
"$pwd\.git\modules\gitdb",
120-
"$pwd\git\ext\gitdb\gitdb\ext\smmap",
121-
"$pwd\git\ext\gitdb\gitdb\ext\smmap\.git",
122-
"$pwd\.git\modules\gitdb\modules\smmap",
123109
"$env:USERPROFILE\.gitconfig"
124110
)
125111
foreach ($p in $paths) {

.github/workflows/dependencies.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Dependency packages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
runs-on: ${{ matrix.python-version == '3.7' && 'ubuntu-22.04' || 'ubuntu-latest' }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
project: [smmap, gitdb]
19+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
20+
21+
steps:
22+
- uses: actions/checkout@v7
23+
with:
24+
fetch-depth: 0
25+
- uses: actions/setup-python@v7
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
allow-prereleases: true
29+
- name: Install test dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install pytest flake8 ./smmap
33+
if test "${{ matrix.project }}" = gitdb; then python -m pip install ./gitdb; fi
34+
- name: Lint
35+
run: flake8 "${{ matrix.project }}/${{ matrix.project }}" --count --select=E9,F63,F7,F82 --show-source --statistics
36+
- name: Test
37+
run: |
38+
if test "${{ matrix.project }}" = gitdb; then
39+
GITDB_TEST_GIT_REPO_BASE="$(git rev-parse --git-common-dir)" pytest -o addopts= -v gitdb/gitdb/test
40+
else
41+
pytest -o addopts= -v smmap/smmap/test
42+
fi

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
9696
- name: Install project and test dependencies
9797
run: |
98-
pip install '.[test]'
98+
pip install ./smmap ./gitdb '.[test]'
9999
100100
- name: Show POSIX file ownership
101101
# Linux and macOS only. On Windows, Git Bash's `ls -ld` reports a
@@ -107,10 +107,6 @@ jobs:
107107
ls -ld -- \
108108
"$(pwd)" \
109109
"$(pwd)/.git" \
110-
"$(pwd)/git/ext/gitdb" \
111-
"$(pwd)/git/ext/gitdb/.git" \
112-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap" \
113-
"$(pwd)/git/ext/gitdb/gitdb/ext/smmap/.git" \
114110
"${HOME:?HOME is not set}/.gitconfig" \
115111
2>&1 || true
116112
@@ -124,10 +120,6 @@ jobs:
124120
$paths = @(
125121
"$pwd",
126122
"$pwd\.git",
127-
"$pwd\git\ext\gitdb",
128-
"$pwd\git\ext\gitdb\.git",
129-
"$pwd\git\ext\gitdb\gitdb\ext\smmap",
130-
"$pwd\git\ext\gitdb\gitdb\ext\smmap\.git",
131123
"$env:USERPROFILE\.gitconfig"
132124
)
133125
foreach ($p in $paths) {

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
exclude: ^(?:gitdb|smmap)/
2+
13
repos:
24
- repo: https://github.com/codespell-project/codespell
35
rev: v2.4.2

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,13 @@ In the less common case that you do not want to install test dependencies, `pip
101101

102102
#### With editable *dependencies* (not preferred, and rarely needed)
103103

104-
In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediately reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython.
105-
106-
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:
104+
GitPython, [gitdb](gitdb), and [smmap](smmap) live in this repository as independently packaged projects. To work on all three at once, install each one editably in the same virtual environment:
107105

108106
```sh
109-
pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap
107+
pip install -e smmap -e gitdb -e ".[test]"
110108
```
111109

112-
The submodules must have been cloned for that to work, but that will already be the case if you have run `./init-tests-after-clone.sh`. You can use `pip list` to check which packages are installed editably and which are installed normally.
110+
You can use `pip list` to check which packages are installed editably and which are installed normally.
113111

114112
To reiterate, this approach should only rarely be used. For most development it is preferable to allow the gitdb and smmap dependencices to be retrieved automatically from PyPI in their latest stable packaged versions.
115113

doc/source/intro.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,6 @@ and cloned using::
9797

9898
$ git clone https://github.com/gitpython-developers/GitPython git-python
9999

100-
Initialize all submodules to obtain the required dependencies with::
101-
102-
$ cd git-python
103-
$ git submodule update --init --recursive
104-
105100
Finally verify the installation by running unit tests::
106101

107102
$ python -m unittest

0 commit comments

Comments
 (0)