GitPython not available for Python 2.7

Created on 21 Jul 2019  路  7Comments  路  Source: gitpython-developers/GitPython

Also posted on Stack Overflow in case this is just me.

When I try to install gitpython via pip normally under python 2.7, it fails telling me python 3.x is required.

This particular script/process has worked until this morning. Potential sources of the change (in my case) are an upgrade to Debian Buster (Raspbian in this case.)

 $ sudo pip install gitpython
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting gitpython
  Using cached https://www.piwheels.org/simple/gitpython/GitPython-2.1.12-py2.py3-none-any.whl
GitPython requires Python '>=3.0, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*' but the running Python is 2.7.16

I am running Python 2.7.16

$ python --version
Python 2.7.16

When I check the current documentation I see that Python 2.7 or newer is listed as a requirement. What am I missing?

acknowledged

Most helpful comment

Just for completeness: Removing python 2 support was a mistake, which was fixed soon after. Thus the GitPython 2.X line will indefinitely support python 2.
However, right now development has moved to dropping python2 support, and GitPython 3.X will commit to that change.

All 7 comments

Python 2.7 support was droppen in https://github.com/gitpython-developers/GitPython/commit/dac619e4917b0ad43d836a534633d68a871aecca, the documentation should be updated

Well, shoot. I guess I had all that free time I was wondering what I could do with ... :)

Thanks for the reply.

Just for completeness: Removing python 2 support was a mistake, which was fixed soon after. Thus the GitPython 2.X line will indefinitely support python 2.
However, right now development has moved to dropping python2 support, and GitPython 3.X will commit to that change.

There is now a dependency that requires python3 even with the 2.X line:
gitdb2 requires Python '>=3.4' but the running Python is 2.7.16

Unfortunately, there was improper formatting for the version specifier for gitdb2 in requirements.txt.
This was fixed with https://github.com/gitpython-developers/GitPython/commit/2573dd5409e3a88d1297c3f9d7a8f6860e093f65 in v3.0.7, but has not been backported to v2.

Even with the version specifier, the version of GitDB was not restricted to < or <= any certain version.
This means that v2 will install the latest version of GitDB, which has recently dropped support for Python 2.7 with https://github.com/gitpython-developers/gitdb/commit/c880f6b0550770eee559091d6276a2e2b097a83a and https://github.com/gitpython-developers/gitdb/commit/df73d7f6874ff11be1b09f65c8dc425671bb924e.

For now, you can revert back to gitdb2 2.0.6.

I've backported https://github.com/gitpython-developers/GitPython/commit/2573dd5409e3a88d1297c3f9d7a8f6860e093f65 to the py2 branch with https://github.com/gitpython-developers/GitPython/commit/7539cd8fbbc8ac2a01d66875cecc4e7ac214f5dc and version locked gitdb2 to <3 with https://github.com/gitpython-developers/GitPython/commit/bcf9f1c5c63a9578b7f8108d6dbc69a80706e807 now. I've also tagged the fix as v2.1.15. You can now also install directly from the branch or tag, until v2.1.15 is released on PyPI.

@Byron https://github.com/gitpython-developers/GitPython/releases/tag/2.1.15 / https://github.com/gitpython-developers/GitPython/commit/09ac0a109fd3a032e19ccc3017a9e1c79cda057a needs to be released as v2.1.15 on PyPI. The Travis CI build failure we discussed in #979 reoccurred, but looking into it now, it seems to be an issue specific to the number of reference types for the tag build. The build for the commit itself passed with no issue.

@Harmon758 Thanks so much for laying it down so nicely! Version 2.1.15 was just released to pypi, which should fix this issue @dbainbridge

Was this page helpful?
0 / 5 - 0 ratings