GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Set python_requires='>=3.4' (gitdb already has this requirement) by Nicusor97 · Pull Request #60 · gitpython-developers/gitdb

This repository was archived by the owner on Jul 26, 2026. It is now read-only.

Conversation

@Nicusor97

@Nicusor97 Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Nicusor97
set python_requires='>=3.4'
530cfa5
@Nicusor97 Nicusor97 changed the title Set python_requires='>=3.4' Set python_requires='>=3.4' (gitdb already has this requirement) Feb 24, 2020
@Nicusor97
Nicusor97 requested a review from Harmon758 February 24, 2020 08:51
@Harmon758

Harmon758 commented Feb 24, 2020

Copy link
Copy Markdown
Member

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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

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)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97
added setup.cfg as gitdb already has
e872186
@Nicusor97 Nicusor97 mentioned this pull request Feb 24, 2020
Error installing GitPython==2.1.14 #61
Open
@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Harmon758

Harmon758 commented Feb 24, 2020

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

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 !

Harmon758 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Nicusor97

Nicusor97 commented Feb 24, 2020

Copy link
Copy Markdown
Author

#62

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Harmon758

Harmon758 commented Feb 24, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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.

Byron reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Harmon758 Harmon758 closed this Feb 24, 2020
@Harmon758
Harmon758 removed their request for review February 24, 2020 16:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Nicusor97 @Harmon758
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.