Skip to content

Commit

Permalink
Remove the gitdb and smmap Git repo submodules
Browse files Browse the repository at this point in the history
This removes the gitdb Git submodule, and thus also *its* submodule
smmap, from the GitPython repository. It also removes the code that
was in place to put git/ext/ into the PYTHONPATH, substantially
simplifying the git package's top-level __init__.py, and slightly
simplifying a script and the CI workflows.

Instead of using Git submodules, the PyPI packages for the gitdb
and smmap dependencies should be used instead, which now happens
automatically. For the occasional cases where having them as Git
submodules was useful, they can be installed with pip from other
sources: GitHub or other remote repository URLs, or local
directories. Installing them editably (with -e / --editable) from a
local directory should achieve the full effect of being able to
have local changes to them reflected immediately in the operation
of GitPython during local development.

Thus this does not remove or diminish GitPython's dependence on
gitdb and smmap, it just no longer obtains them as Git submodules.
Using them from PyPI allows GitPython to be developed and tested
against the versions of them that it uses in production, obtaining
its dependencies how they are usually obtained in production.

This pertains only to Git submodules for GitPython's dependencies.
It does not change the organization of Python packages/modules: the
top-level git package/module continues to have all the same
subpackages/submodules it did before, and this holds recursively.

(This also does not remove, and should in no way affect,
GitPython's ability to *work with* Git submodules, which is
independent of whether GitPython's own repository has them.)
  • Loading branch information
EliahKagan authored Sep 19, 2023
1 parent d46ba96 commit ee06049
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- uses: cygwin/cygwin-install-action@v4
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

21 changes: 0 additions & 21 deletions git/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,6 @@

__version__ = "git"


# { Initialization
def _init_externals() -> None:
"""Initialize external projects by putting them into the path"""
if __version__ == "git" and "PYOXIDIZER" not in os.environ:
sys.path.insert(1, osp.join(osp.dirname(__file__), "ext", "gitdb"))

try:
import gitdb
except ImportError as e:
raise ImportError("'gitdb' could not be found in your PYTHONPATH") from e
# END verify import


# } END initialization


#################
_init_externals()
#################

# { Imports

try:
Expand Down
1 change: 0 additions & 1 deletion git/ext/gitdb
Submodule gitdb deleted from 49c317
1 change: 0 additions & 1 deletion init-tests-after-clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ git reset --hard HEAD~1
git reset --hard HEAD~1
git reset --hard HEAD~1
git reset --hard __testing_point__
git submodule update --init --recursive

0 comments on commit ee06049

Please sign in to comment.