Skip to content

Add support for Python 3.7 #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 21, 2018
Merged
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
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ python:
- "3.4"
- "3.5"
- "3.6"
- "3.6-dev"
- "3.7-dev"
- "nightly"
# - "pypy" - won't work as smmap doesn't work (see gitdb/.travis.yml for details)
matrix:
include:
- python: 3.7
dist: xenial
sudo: required
- python: "nightly"
dist: xenial
sudo: required
allow_failures:
- python: "3.6-dev"
- python: "3.7-dev"
- python: "nightly"
git:
# a higher depth is needed for most of the tests - must be high enough to not actually be shallow
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ 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)
* Python 2.7 to 3.6.
* Python 2.7 to 3.7.

The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
The installer takes care of installing them for you.
Expand Down
2 changes: 1 addition & 1 deletion git/objects/submodule/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1160,7 +1160,7 @@ def iter_items(cls, repo, parent_commit='HEAD'):
try:
parser = cls._config_parser(repo, pc, read_only=True)
except IOError:
raise StopIteration
return
# END handle empty iterator

rt = pc.tree # root tree
Expand Down
15 changes: 12 additions & 3 deletions git/repo/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,10 @@ def blame_incremental(self, rev, file, **kwargs):

stream = (line for line in data.split(b'\n') if line)
while True:
line = next(stream) # when exhausted, causes a StopIteration, terminating this function
try:
line = next(stream) # when exhausted, causes a StopIteration, terminating this function
except StopIteration:
return
hexsha, orig_lineno, lineno, num_lines = line.split()
lineno = int(lineno)
num_lines = int(num_lines)
Expand All @@ -724,7 +727,10 @@ def blame_incremental(self, rev, file, **kwargs):
# for this commit
props = {}
while True:
line = next(stream)
try:
line = next(stream)
except StopIteration:
return
if line == b'boundary':
# "boundary" indicates a root commit and occurs
# instead of the "previous" tag
Expand All @@ -749,7 +755,10 @@ def blame_incremental(self, rev, file, **kwargs):
# Discard all lines until we find "filename" which is
# guaranteed to be the last line
while True:
line = next(stream) # will fail if we reach the EOF unexpectedly
try:
line = next(stream) # will fail if we reach the EOF unexpectedly
except StopIteration:
return
tag, value = line.split(b' ', 1)
if tag == b'filename':
orig_filename = value
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ def _stamp_version(filename):
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
]
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36,flake8
envlist = py27,py34,py35,py36,py37,flake8

[testenv]
commands = nosetests {posargs}
Expand Down