From 595b4409a7c7fb78cb48a6a9704c84fea70b9cf8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 19 Aug 2021 12:31:04 +0300 Subject: [PATCH 1/3] Remove redundant Python 2.6 code --- gitdb/stream.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gitdb/stream.py b/gitdb/stream.py index b94ef24..d58d1a6 100644 --- a/gitdb/stream.py +++ b/gitdb/stream.py @@ -30,7 +30,6 @@ from gitdb.utils.encoding import force_bytes has_perf_mod = False -PY26 = sys.version_info[:2] < (2, 7) try: from gitdb_speedups._perf import apply_delta as c_apply_delta has_perf_mod = True @@ -295,7 +294,7 @@ def read(self, size=-1): # However, the zlib VERSIONs as well as the platform check is used to further match the entries in the # table in the github issue. This is it ... it was the only way I could make this work everywhere. # IT's CERTAINLY GOING TO BITE US IN THE FUTURE ... . - if PY26 or ((zlib.ZLIB_VERSION == '1.2.7' or zlib.ZLIB_VERSION == '1.2.5') and not sys.platform == 'darwin'): + if zlib.ZLIB_VERSION in ('1.2.7', '1.2.5') and not sys.platform == 'darwin': unused_datalen = len(self._zip.unconsumed_tail) else: unused_datalen = len(self._zip.unconsumed_tail) + len(self._zip.unused_data) From 2088eb146341a9444a591804af7f4e5583c8a221 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 19 Aug 2021 12:32:36 +0300 Subject: [PATCH 2/3] Remove redundant Python 2 code --- gitdb/db/mem.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gitdb/db/mem.py b/gitdb/db/mem.py index 5b242e4..f588662 100644 --- a/gitdb/db/mem.py +++ b/gitdb/db/mem.py @@ -82,10 +82,7 @@ def size(self): return len(self._cache) def sha_iter(self): - try: - return self._cache.iterkeys() - except AttributeError: - return self._cache.keys() + return self._cache.keys() #{ Interface def stream_copy(self, sha_iter, odb): From 55dc81ce6da8ba32f889a2ff0aa0a45a9b104a5c Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 19 Aug 2021 12:42:16 +0300 Subject: [PATCH 3/3] Support Python 3.7-3.9 --- .github/workflows/pythonpackage.yml | 4 ++-- setup.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 4c67fbf..7f35b61 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -15,14 +15,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] steps: - uses: actions/checkout@v2 with: fetch-depth: 1000 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/setup.py b/setup.py index 59817d8..522a88f 100755 --- a/setup.py +++ b/setup.py @@ -38,6 +38,8 @@ "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7" + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] )