Skip to content

Commit

Permalink
Never add a vendored smmap directory to sys.path
Browse files Browse the repository at this point in the history
This removes the logic that appended the git submodule directory
for smmap to sys.path under most circumstances when the version
of gitdb was not from PyPI. Now gitdb does not modify sys.path.

See gitpython-developers/GitPython#1717
and gitpython-developers/GitPython#1720 for
context. This change is roughly equivalent to the change to
GitPython, though as noted the behavior being eliminated is subtly
different here and there.
  • Loading branch information
EliahKagan committed Oct 20, 2023
1 parent 3d3e957 commit 965d2d3
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions gitdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,12 @@
# the New BSD License: https://opensource.org/license/bsd-3-clause/
"""Initialize the object database module"""

import sys
import os

#{ Initialization


def _init_externals():
"""Initialize external projects by putting them into the path"""
if 'PYOXIDIZER' not in os.environ:
where = os.path.join(os.path.dirname(__file__), 'ext', 'smmap')
if os.path.exists(where):
sys.path.append(where)

import smmap
del smmap
# END handle imports

#} END initialization

_init_externals()

__author__ = "Sebastian Thiel"
__contact__ = "byronimo@gmail.com"
__homepage__ = "https://github.com/gitpython-developers/gitdb"
version_info = (4, 0, 11)
__version__ = '.'.join(str(i) for i in version_info)


# default imports
from gitdb.base import *
from gitdb.db import *
Expand Down

0 comments on commit 965d2d3

Please sign in to comment.