Skip to content

Commit ade259c

Browse files
committed
Bump GitPython to 2.1.8
Fixes gitpython-developers/GitPython#687
1 parent 1bf7aeb commit ade259c

File tree

6 files changed

+16
-5
lines changed

6 files changed

+16
-5
lines changed

assigner/__init__.py

+11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#!/usr/bin/env python3
2+
3+
# GitPython throws an ImportError now if git is not installed
4+
# unless the environment variable GIT_PYTHON_REFRESH is set.
5+
# We'll opt to keep going and handle the GitCommandNotFound
6+
# exception if it comes up.
7+
import os
8+
os.environ["GIT_PYTHON_REFRESH"] = "silence"
9+
10+
# We *have* to set GIT_PYTHON_REFRESH before importing
11+
# anything that imports GitPython.
12+
# pylint: disable=wrong-import-position
213
import argparse
314
import importlib
415
import logging

assigner/baserepo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def clone_to(self, dir_name, branch):
206206
else:
207207
self._repo = git.Repo.clone_from(self.ssh_url, dir_name)
208208
logging.debug("Cloned %s.", self.name)
209-
except git.exc.GitCommandError as e:
209+
except git.GitCommandError as e:
210210
# GitPython may delete this directory
211211
# and the caller may have opinions about that,
212212
# so go ahead and re-create it just to be safe.

assigner/commands/get.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
from requests.exceptions import HTTPError
5-
from git.exc import NoSuchPathError, GitCommandError
5+
from git import NoSuchPathError, GitCommandError
66

77
from assigner.roster_util import get_filtered_roster
88
from assigner.baserepo import RepoError, StudentRepo

assigner/tests/assigner_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_main_logs_gitcommandnotfound_with_catch(self, mock_logger):
142142
main should log a GitCommandNotFound with "git is not installed!" when raised.
143143
"""
144144
self.mock_args.tracebacks = False
145-
self.mock_args.run.side_effect = GitCommandNotFound()
145+
self.mock_args.run.side_effect = GitCommandNotFound("git", "not found")
146146
try:
147147
main([])
148148
except SystemExit:

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
GitPython==1.0.1
1+
GitPython==2.1.8
22
PyYAML==3.11
33
colorlog==2.6.0
44
gitdb==0.6.4

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
# Any package you put here will be installed by pip when your project is
7373
# installed, so they must be valid existing projects.
7474
install_requires=[
75-
'GitPython>=1',
75+
'GitPython>=2.1.8',
7676
'PyYAML>=3.11',
7777
'colorlog>=2.6,<3', # TODO can we move to v3?
7878
'jsonschema>=2.5',

0 commit comments

Comments
 (0)