Skip to content

Instantly share code, notes, and snippets.

@EliahKagan
Last active March 19, 2024 20:49
Show Gist options
  • Save EliahKagan/271598adb9f83683790eb437d03efb66 to your computer and use it in GitHub Desktop.
Save EliahKagan/271598adb9f83683790eb437d03efb66 to your computer and use it in GitHub Desktop.
GitPython-investigate-1349
* text=auto eol=lf
# Cached Python bytecode
__pycache__/
# Python virtual environment
.venv/

GitPython #1349 investigation

This is for investigating gitpython-developers/GitPython#1349, reproducing it and checking to see if particular changes are sufficient to solve it.

To use this without modification, the repostiory directory must be alongside the clone of GitPython in which the changes are being made, so that they are both subdirectories of the same directory (neither being within the other). One of the reasons this is important is that it runs all default checks, even those that GitPython's pyproject.toml turns off.

In addition, to get it to correctly recognize the type annoations, and also so that the results are likely to be reliable, I did this in its own virtual environment in which I installed GitPython non-editably by using pip install -r requirements.txt. See that file's contents for details.

It must be uninstalled, or --upgrade passed to pip, or the virtualenv remade in order to test it after changes, because the installation is non-editable, but this helps better approximate the situation where GitPython is installed from PyPI.

License for this gist: CC0-1.0 (public domain) [SPDX]

mypy
# Install GitPython from the GitPython directory alongside this directory.
../GitPython
from git import Blob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment