-
Notifications
You must be signed in to change notification settings - Fork 66
Set python_requires='>=3.4' (gitdb already has this requirement) #60
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
Set python_requires='>=3.4' (gitdb already has this requirement) #60
Conversation
I understand the reasoning for this pull request, but I'm curious as to the motivation behind it.
If possible, I'd like to refrain from adding anything for the sole purpose of maintaining support for versions of Python that are EOL, especially to a minimal mirror package.
If you're using GitDB through GitPython, the latest v2 of it should still fully support Python 2, since it restricts gitdb2 to < 3. Otherwise, is there a reason the dependency can't be restricted to < 3 downstream?
So, we are using Gitpython and when this module is installed there are some issues because the gitdb2 module has as a dependency gitdb
that seems to dropped Python 2 support but you added in setup.cfg :
[bdist_wheel] universal=1
and created a wheel that is compatible with both Python versions.
So, if you did that for the gitdb python module I think you need to do same for the gitdb2 module which is a mirror for gitdb(from my understanding)
Collecting GitPython==2.1.14 Downloading https://files.pythonhosted.org/packages/2e/93/c26103b14766b83d6c2f7d2a29aa8540058c2970f2c80b13c25720764b70/GitPython-2.1.14-py2.py3-none-any.whl (452kB) 100% |################################| 460kB 1.9MB/s Collecting gitdb2>=2.0.0 (from GitPython==2.1.14) Downloading https://files.pythonhosted.org/packages/97/97/6ad081c9f3efa1545fd11149f14602a53e2003c153312c8bfa825ba27b89/gitdb2-4.0.2.tar.gz Collecting gitdb>=4.0.1 (from gitdb2>=2.0.0->GitPython==2.1.14) Could not find a version that satisfies the requirement gitdb>=4.0.1 (from gitdb2>=2.0.0->GitPython==2.1.14) (from versions: 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4) No matching distribution found for gitdb>=4.0.1 (from gitdb2>=2.0.0->GitPython==2.1.14)
there is no possibility to install a version of gitdb>=4.0.1
because you have in setup.py
python_requires='>=3.4'
. You can check the wheel METADATA and there you will have Requires-Python: >=3.4 . So, for gitdb2
, to keep only Python 3 support you need to use the code from this PR and create a new wheel for gitdb2
which should be compatible with both Python versions but the devpi-server and pip will install only the version specific for python distribution
and about the Gitpython, you are right .. the latest v2 version has a down pin to the gitdb2<3,>=2
. We have a down pin for GitPython <2.1.12
because this version doesn't has the Python 2 support
The only GitPython version that is compatible with the gitdb2
on Python 2 is 2.1.15 where they added a down pin for gitdb2
Like I said, I understand the reasoning behind the PR.
However, the latest version of GitPython that supports Python 2, v2.1.15, should work .
Otherwise, if you need to use an older version of GitPython, gitdb2 can simply be pinned to < 3 .
See #61 (comment) for a more detailed explanation of this.
Python 2 support was only dropped in GitPython v2.1.12. This was a mistake and v2.1.13 brought back Python 2 support. See gitpython-developers/GitPython#897 and gitpython-developers/GitPython#898.
As for the setup.cfg universal
setting, this is actually an issue with the main gitdb package on the master branch rather than with the gitdb2 mirror package. The gitdb package has dropped support for Python 2, so it should be a Pure Python Wheel rather than a Universal Wheel. This is an issue similar to gitpython-developers/GitPython#898. However, universal
is a flag, so setting it to 0 in the setup.cfg should be unnecessary. If you'll create another PR against the master branch that simply removes the now unnecessary setup.cfg, I'd be happy to merge it and push another release.
That said, I am still considering this PR in case someone has a situation where they cannot upgrade GitPython to v2.1.15 or pin gitdb2 to < 3 themself. A significant downside to this would be an additional maintenance burden for keeping the gitdb2 python_requires
in sync with gitdb (e.g. changing both to >=3.5
when Python 3.4 support is dropped). If this were to be merged and released, it would likely be a post release if possible. However, the improper addition of the setup.cfg in this PR would need to be reverted first.
On our side, we fixed the issue by using the latest v2 of gitpython . First I was a bit confused because in our code we used gitpython <2.1.12 that dropped Python 2 support but I was wrong. There were added some new releases that are not included in the documentation of gitpython but now we should be ok. This PR could be closed if anyone doesn't have something to say.
Also, I will create a new PR from where I will remove the setup.cfg
from the main repo. Thank you !
Thanks for the new PR! I've merged it now and tagged v4.0.2 and released it on PyPI.
And apologies for the confusion. I agree that those GitPython v2 releases should have had changelogs. I've retroactively added them now.
I'll also close this PR as requested. If #61 ends up warranting it, I'll reevaluate adding python_requires
.
The python_requires='>=3.4' is already set for gitdb and the gitdb2 python module has as a dependency gitdb>=4.0.1 that dropped Python 2 support after python_requires='>=3.4' was added in its
setup.py
.Will prevent users with Python 2.7 from downloading a sdist version they cannot build.
Note: supporting python_requires requires setuptools>=24.2.0 and pip>=9.0.0 to benefit from it.
Details here: https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires