From 0e8201ddfb9d1cf3ff96cc36f08b31ed545c873e Mon Sep 17 00:00:00 2001 From: 0x1A6C1A9Y <8345456+0x1A6C1A9Y@users.noreply.github.com> Date: Sun, 22 Nov 2026 14:32:46 +0100 Subject: [PATCH 1/2] docs: align source-checkout test instructions with pytest The source installation guide still recommends `python -m unittest`, although the repository configures its suite with `pytest` and contributor instructions require the test extra and an explicit backend selection. Show how to enter the checkout, install `.[test]`, and run `pytest` with `GIT_PYTHON_BACKEND=cli`. List the test-suite prerequisites and link to `CONTRIBUTING.md` so package installation and contributor testing are not conflated. Validation: `git diff --check` passed. Docutils parsed the updated Source Code section without warnings. The full test suite was not run for this documentation-only change. Agent-Model: unknown --- doc/source/intro.rst | 124 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/doc/source/intro.rst b/doc/source/intro.rst index 1faa3f922..107f05d14 100644 --- a/doc/source/intro.rst +++ b/doc/source/intro.rst @@ -10,9 +10,133 @@ It provides Python objects for repository data and delegates Git operations to t The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming. +Requirements +============.. _intro_toplevel: + +================== +Overview / Install +================== + +GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing. + +It provides Python objects for repository data and delegates Git operations to the Git executable. The default backend supports both SHA-1 and SHA-256 object IDs and both files and reftable reference storage. ``GitDB`` is an alias for ``GitCmdObjectDB``; the pure-Python storage implementation is unavailable. + +The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming. + Requirements ============ +* `Python`_ >= 3.8 +* `Git`_ 2.52 or newer +* `GitDB`_ - shared data types and utilities +* `typing_extensions`_ >= 3.7.3.4 (if python < 3.10) + +.. _Python: https://www.python.org +.. _Git: https://git-scm.com/ +.. _GitDB: https://pypi.python.org/pypi/gitdb +.. _typing_extensions: https://pypi.org/project/typing-extensions/ + +Installing GitPython +==================== + +Installing GitPython is easily done using +`pip`_. Assuming it is +installed, just run the following from the command-line: + +.. sourcecode:: none + + # pip install GitPython + +This command will download the latest version of GitPython from the +`Python Package Index `_ and install it +to your system. More information about ``pip`` and pypi can be found +here: + +* `install pip `_ +* `pypi `_ + +.. _pip: https://pip.pypa.io/en/latest/installing.html + +Alternatively, you can install from the distribution using the ``setup.py`` +script: + +.. sourcecode:: none + + # python setup.py install + +.. note:: In this case, you have to manually install `GitDB`_ as well. It would be recommended to use the :ref:`git source repository ` in that case. + +Limitations +=========== + +Leakage of System Resources +--------------------------- + +GitPython is not suited for long-running processes (like daemons) as it tends to +leak system resources. It was written in a time where destructors (as implemented +in the `__del__` method) still ran deterministically. + +In case you still want to use it in such a context, you will want to search the +codebase for `__del__` implementations and call these yourself when you see fit. + +Another way assure proper cleanup of resources is to factor out GitPython into a +separate process which can be dropped periodically. + +Getting Started +=============== + +* :ref:`tutorial-label` - This tutorial provides a walk-through of some of + the basic functionality and concepts used in GitPython. It, however, is not + exhaustive so you are encouraged to spend some time in the + :ref:`api_reference_toplevel`. + +API Reference +============= + +An organized section of the GitPython API is at :ref:`api_reference_toplevel`. + +.. _source-code-label: + +Source Code +=========== + +GitPython's git repo is available on GitHub, which can be browsed at: + + * https://github.com/gitpython-developers/GitPython + +and cloned using:: + + $ git clone https://github.com/gitpython-developers/GitPython git-python + +To run the test suite, change into the checkout and install the test dependencies. +The tests require Python 3.11 or later, Git 2.52 or later, and Bash. Select a +backend before running pytest:: + + $ cd git-python + $ python -m pip install -e ".[test]" + $ GIT_PYTHON_BACKEND=cli python -m pytest + +See `CONTRIBUTING.md `_ +for more information about running and contributing tests. + +Questions and Answers +===================== +Please use stackoverflow for questions, and don't forget to tag it with `gitpython` to assure the right people see the question in a timely manner. + +http://stackoverflow.com/questions/tagged/gitpython + +Issue Tracker +============= +The issue tracker is hosted by GitHub: + +https://github.com/gitpython-developers/GitPython/issues + +License Information +=================== +GitPython is licensed under the New BSD License. See the LICENSE file for +more information. + + * `Python`_ >= 3.8 * `Git`_ 2.52 or newer * `GitDB`_ - shared data types and utilities From 2d835456b5e639ad90351c5d41dac0bd4073a5a7 Mon Sep 17 00:00:00 2001 From: 0x1A6C1A9Y <8345456+0x1A6C1A9Y@users.noreply.github.com> Date: Sun, 22 Nov 2026 14:35:16 +0100 Subject: [PATCH 2/2] docs: correct the editor transfer of test instructions The first web-editor commit inserted the complete document into the existing text instead of replacing it. Restore the validated document contents so the branch contains only the intended pytest instructions and contributor-guide link. The rendered preview now contains one copy of each section. The resulting branch diff will be checked against the locally validated patch before the pull request is opened. Agent-Model: unknown --- doc/source/intro.rst | 117 ------------------------------------------- 1 file changed, 117 deletions(-) diff --git a/doc/source/intro.rst b/doc/source/intro.rst index 107f05d14..9261c157d 100644 --- a/doc/source/intro.rst +++ b/doc/source/intro.rst @@ -10,19 +10,6 @@ It provides Python objects for repository data and delegates Git operations to t The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming. -Requirements -============.. _intro_toplevel: - -================== -Overview / Install -================== - -GitPython is a python library used to interact with git repositories, high-level like git-porcelain, or low-level like git-plumbing. - -It provides Python objects for repository data and delegates Git operations to the Git executable. The default backend supports both SHA-1 and SHA-256 object IDs and both files and reftable reference storage. ``GitDB`` is an alias for ``GitCmdObjectDB``; the pure-Python storage implementation is unavailable. - -The object database implementation is optimized for handling large quantities of objects and large datasets, which is achieved by using low-level structures and data streaming. - Requirements ============ @@ -135,107 +122,3 @@ License Information =================== GitPython is licensed under the New BSD License. See the LICENSE file for more information. - - -* `Python`_ >= 3.8 -* `Git`_ 2.52 or newer -* `GitDB`_ - shared data types and utilities -* `typing_extensions`_ >= 3.7.3.4 (if python < 3.10) - -.. _Python: https://www.python.org -.. _Git: https://git-scm.com/ -.. _GitDB: https://pypi.python.org/pypi/gitdb -.. _typing_extensions: https://pypi.org/project/typing-extensions/ - -Installing GitPython -==================== - -Installing GitPython is easily done using -`pip`_. Assuming it is -installed, just run the following from the command-line: - -.. sourcecode:: none - - # pip install GitPython - -This command will download the latest version of GitPython from the -`Python Package Index `_ and install it -to your system. More information about ``pip`` and pypi can be found -here: - -* `install pip `_ -* `pypi `_ - -.. _pip: https://pip.pypa.io/en/latest/installing.html - -Alternatively, you can install from the distribution using the ``setup.py`` -script: - -.. sourcecode:: none - - # python setup.py install - -.. note:: In this case, you have to manually install `GitDB`_ as well. It would be recommended to use the :ref:`git source repository ` in that case. - -Limitations -=========== - -Leakage of System Resources ---------------------------- - -GitPython is not suited for long-running processes (like daemons) as it tends to -leak system resources. It was written in a time where destructors (as implemented -in the `__del__` method) still ran deterministically. - -In case you still want to use it in such a context, you will want to search the -codebase for `__del__` implementations and call these yourself when you see fit. - -Another way assure proper cleanup of resources is to factor out GitPython into a -separate process which can be dropped periodically. - -Getting Started -=============== - -* :ref:`tutorial-label` - This tutorial provides a walk-through of some of - the basic functionality and concepts used in GitPython. It, however, is not - exhaustive so you are encouraged to spend some time in the - :ref:`api_reference_toplevel`. - -API Reference -============= - -An organized section of the GitPython API is at :ref:`api_reference_toplevel`. - -.. _source-code-label: - -Source Code -=========== - -GitPython's git repo is available on GitHub, which can be browsed at: - - * https://github.com/gitpython-developers/GitPython - -and cloned using:: - - $ git clone https://github.com/gitpython-developers/GitPython git-python - -Finally verify the installation by running unit tests:: - - $ python -m unittest - -Questions and Answers -===================== -Please use stackoverflow for questions, and don't forget to tag it with `gitpython` to assure the right people see the question in a timely manner. - -http://stackoverflow.com/questions/tagged/gitpython - -Issue Tracker -============= -The issue tracker is hosted by GitHub: - -https://github.com/gitpython-developers/GitPython/issues - -License Information -=================== -GitPython is licensed under the New BSD License. See the LICENSE file for -more information.