summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-07-20 17:26:16 +0800
committerSebastian Thiel <sthiel@thoughtworks.com>2019-07-20 17:34:19 +0800
commitdac619e4917b0ad43d836a534633d68a871aecca (patch)
tree7b6608753801c576014a6b5de396230a4ec2bb5b
parent1bb0b1751b38da43dbcd2ec58e71eb7b0138d786 (diff)
downloadgitpython-dac619e4917b0ad43d836a534633d68a871aecca.tar.gz
Drop python 2.7 support and help with encodings
Fixes #312
-rw-r--r--.travis.yml1
-rw-r--r--README.md2
-rw-r--r--doc/source/intro.rst2
-rw-r--r--git/compat.py5
-rw-r--r--git/repo/base.py1
-rw-r--r--requirements.txt2
-rwxr-xr-xsetup.py4
7 files changed, 10 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml
index aed714af..7939e161 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- - "2.7"
- "3.4"
- "3.5"
- "3.6"
diff --git a/README.md b/README.md
index e252c34c..3734019e 100644
--- a/README.md
+++ b/README.md
@@ -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.7.
+* Python 3 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.
diff --git a/doc/source/intro.rst b/doc/source/intro.rst
index d68e5eb2..e2cd196b 100644
--- a/doc/source/intro.rst
+++ b/doc/source/intro.rst
@@ -13,7 +13,7 @@ The object database implementation is optimized for handling large quantities of
Requirements
============
-* `Python`_ 2.7 or newer
+* `Python`_ 3.0 or newer
* `Git`_ 1.7.0 or newer
It should also work with older versions, but it may be that some operations
involving remotes will not work as expected.
diff --git a/git/compat.py b/git/compat.py
index b63768f3..02dc69de 100644
--- a/git/compat.py
+++ b/git/compat.py
@@ -30,7 +30,10 @@ PY3 = sys.version_info[0] >= 3
is_win = (os.name == 'nt')
is_posix = (os.name == 'posix')
is_darwin = (os.name == 'darwin')
-defenc = sys.getdefaultencoding()
+if hasattr(sys, 'getfilesystemencoding'):
+ defenc = sys.getfilesystemencoding()
+if defenc is None:
+ defenc = sys.getdefaultencoding()
if PY3:
import io
diff --git a/git/repo/base.py b/git/repo/base.py
index f3587080..911494ad 100644
--- a/git/repo/base.py
+++ b/git/repo/base.py
@@ -4,6 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
+from builtins import str
from collections import namedtuple
import logging
import os
diff --git a/requirements.txt b/requirements.txt
index 63d5ddfe..c0cca9f4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1,3 @@
gitdb2 (>=2.0.0)
+gitdb>=0.6.4
+ddt>=1.1.1
diff --git a/setup.py b/setup.py
index 49288f69..65656d55 100755
--- a/setup.py
+++ b/setup.py
@@ -79,7 +79,7 @@ setup(
package_data={'git.test': ['fixtures/*']},
package_dir={'git': 'git'},
license="BSD License",
- python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
+ python_requires='>=3.0, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
install_requires=requirements,
tests_require=requirements + test_requirements,
zip_safe=False,
@@ -102,8 +102,6 @@ setup(
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Python",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",