METADATA 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. Metadata-Version: 2.4
  2. Name: GitPython
  3. Version: 3.1.46
  4. Summary: GitPython is a Python library used to interact with Git repositories
  5. Home-page: https://github.com/gitpython-developers/GitPython
  6. Author: Sebastian Thiel, Michael Trier
  7. Author-email: byronimo@gmail.com, mtrier@gmail.com
  8. License: BSD-3-Clause
  9. Classifier: Development Status :: 5 - Production/Stable
  10. Classifier: Environment :: Console
  11. Classifier: Intended Audience :: Developers
  12. Classifier: Operating System :: OS Independent
  13. Classifier: Operating System :: POSIX
  14. Classifier: Operating System :: Microsoft :: Windows
  15. Classifier: Operating System :: MacOS :: MacOS X
  16. Classifier: Typing :: Typed
  17. Classifier: Programming Language :: Python
  18. Classifier: Programming Language :: Python :: 3
  19. Classifier: Programming Language :: Python :: 3.7
  20. Classifier: Programming Language :: Python :: 3.8
  21. Classifier: Programming Language :: Python :: 3.9
  22. Classifier: Programming Language :: Python :: 3.10
  23. Classifier: Programming Language :: Python :: 3.11
  24. Classifier: Programming Language :: Python :: 3.12
  25. Requires-Python: >=3.7
  26. Description-Content-Type: text/markdown
  27. License-File: LICENSE
  28. License-File: AUTHORS
  29. Requires-Dist: gitdb<5,>=4.0.1
  30. Requires-Dist: typing-extensions>=3.10.0.2; python_version < "3.10"
  31. Provides-Extra: test
  32. Requires-Dist: coverage[toml]; extra == "test"
  33. Requires-Dist: ddt!=1.4.3,>=1.1.1; extra == "test"
  34. Requires-Dist: mock; python_version < "3.8" and extra == "test"
  35. Requires-Dist: mypy==1.18.2; python_version >= "3.9" and extra == "test"
  36. Requires-Dist: pre-commit; extra == "test"
  37. Requires-Dist: pytest>=7.3.1; extra == "test"
  38. Requires-Dist: pytest-cov; extra == "test"
  39. Requires-Dist: pytest-instafail; extra == "test"
  40. Requires-Dist: pytest-mock; extra == "test"
  41. Requires-Dist: pytest-sugar; extra == "test"
  42. Requires-Dist: typing-extensions; python_version < "3.11" and extra == "test"
  43. Provides-Extra: doc
  44. Requires-Dist: sphinx<7.2,>=7.1.2; extra == "doc"
  45. Requires-Dist: sphinx_rtd_theme; extra == "doc"
  46. Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
  47. Dynamic: author
  48. Dynamic: author-email
  49. Dynamic: classifier
  50. Dynamic: description
  51. Dynamic: description-content-type
  52. Dynamic: home-page
  53. Dynamic: license
  54. Dynamic: license-file
  55. Dynamic: provides-extra
  56. Dynamic: requires-dist
  57. Dynamic: requires-python
  58. Dynamic: summary
  59. ![Python package](https://github.com/gitpython-developers/GitPython/workflows/Python%20package/badge.svg)
  60. [![Documentation Status](https://readthedocs.org/projects/gitpython/badge/?version=stable)](https://readthedocs.org/projects/gitpython/?badge=stable)
  61. [![Packaging status](https://repology.org/badge/tiny-repos/python:gitpython.svg)](https://repology.org/metapackage/python:gitpython/versions)
  62. ## [Gitoxide](https://github.com/Byron/gitoxide): A peek into the future…
  63. I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it.
  64. Of course, back in the days, I didn't really know what I was doing and this shows in many places. Somewhat similar to
  65. Python this happens to be 'good enough', but at the same time is deeply flawed and broken beyond repair.
  66. By now, GitPython is widely used and I am sure there is a good reason for that, it's something to be proud of and happy about.
  67. The community is maintaining the software and is keeping it relevant for which I am absolutely grateful. For the time to come I am happy to continue maintaining GitPython, remaining hopeful that one day it won't be needed anymore.
  68. More than 15 years after my first meeting with 'git' I am still in excited about it, and am happy to finally have the tools and
  69. probably the skills to scratch that itch of mine: implement `git` in a way that makes tool creation a piece of cake for most.
  70. If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an
  71. implementation of 'git' in [Rust](https://www.rust-lang.org).
  72. *(Please note that `gitoxide` is not currently available for use in Python, and that Rust is required.)*
  73. ## GitPython
  74. GitPython is a python library used to interact with git repositories, high-level like git-porcelain,
  75. or low-level like git-plumbing.
  76. It provides abstractions of git objects for easy access of repository data often backed by calling the `git`
  77. command-line program.
  78. ### DEVELOPMENT STATUS
  79. This project is in **maintenance mode**, which means that
  80. - …there will be no feature development, unless these are contributed
  81. - …there will be no bug fixes, unless they are relevant to the safety of users, or contributed
  82. - …issues will be responded to with waiting times of up to a month
  83. The project is open to contributions of all kinds, as well as new maintainers.
  84. ### REQUIREMENTS
  85. GitPython needs the `git` executable to be installed on the system and available in your
  86. `PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it
  87. by setting the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
  88. - Git (1.7.x or newer)
  89. - Python >= 3.7
  90. The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
  91. The installer takes care of installing them for you.
  92. ### INSTALL
  93. GitPython and its required package dependencies can be installed in any of the following ways, all of which should typically be done in a [virtual environment](https://docs.python.org/3/tutorial/venv.html).
  94. #### From PyPI
  95. To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:
  96. ```sh
  97. pip install GitPython
  98. ```
  99. (A distribution package can also be downloaded for manual installation at [the PyPI page](https://pypi.org/project/GitPython/).)
  100. #### From downloaded source code
  101. If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:
  102. ```sh
  103. pip install .
  104. ```
  105. #### By cloning the source code repository
  106. To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython) from source to work on the code, you can do it like so:
  107. ```sh
  108. git clone https://github.com/gitpython-developers/GitPython
  109. cd GitPython
  110. ./init-tests-after-clone.sh
  111. ```
  112. On Windows, `./init-tests-after-clone.sh` can be run in a Git Bash shell.
  113. If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`):
  114. ```sh
  115. gh repo clone GitPython
  116. ```
  117. Having cloned the repo, create and activate your [virtual environment](https://docs.python.org/3/tutorial/venv.html).
  118. Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
  119. ```sh
  120. pip install -e ".[test]"
  121. ```
  122. In the less common case that you do not want to install test dependencies, `pip install -e .` can be used instead.
  123. #### With editable *dependencies* (not preferred, and rarely needed)
  124. In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediately reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython.
  125. If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way:
  126. ```sh
  127. pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap
  128. ```
  129. The submodules must have been cloned for that to work, but that will already be the case if you have run `./init-tests-after-clone.sh`. You can use `pip list` to check which packages are installed editably and which are installed normally.
  130. To reiterate, this approach should only rarely be used. For most development it is preferable to allow the gitdb and smmap dependencices to be retrieved automatically from PyPI in their latest stable packaged versions.
  131. ### Limitations
  132. #### Leakage of System Resources
  133. GitPython is not suited for long-running processes (like daemons) as it tends to
  134. leak system resources. It was written in a time where destructors (as implemented
  135. in the `__del__` method) still ran deterministically.
  136. In case you still want to use it in such a context, you will want to search the
  137. codebase for `__del__` implementations and call these yourself when you see fit.
  138. Another way assure proper cleanup of resources is to factor out GitPython into a
  139. separate process which can be dropped periodically.
  140. #### Windows support
  141. See [Issue #525](https://github.com/gitpython-developers/GitPython/issues/525).
  142. ### RUNNING TESTS
  143. _Important_: Right after cloning this repository, please be sure to have executed
  144. the `./init-tests-after-clone.sh` script in the repository root. Otherwise
  145. you will encounter test failures.
  146. #### Install test dependencies
  147. Ensure testing libraries are installed. This is taken care of already if you installed with:
  148. ```sh
  149. pip install -e ".[test]"
  150. ```
  151. If you had installed with a command like `pip install -e .` instead, you can still run
  152. the above command to add the testing dependencies.
  153. #### Test commands
  154. To test, run:
  155. ```sh
  156. pytest
  157. ```
  158. To lint, and apply some linting fixes as well as automatic code formatting, run:
  159. ```sh
  160. pre-commit run --all-files
  161. ```
  162. This includes the linting and autoformatting done by Ruff, as well as some other checks.
  163. To typecheck, run:
  164. ```sh
  165. mypy
  166. ```
  167. #### CI (and tox)
  168. Style and formatting checks, and running tests on all the different supported Python versions, will be performed:
  169. - Upon submitting a pull request.
  170. - On each push, *if* you have a fork with GitHub Actions enabled.
  171. - Locally, if you run [`tox`](https://tox.wiki/) (this skips any Python versions you don't have installed).
  172. #### Configuration files
  173. Specific tools are all configured in the `./pyproject.toml` file:
  174. - `pytest` (test runner)
  175. - `coverage.py` (code coverage)
  176. - `ruff` (linter and formatter)
  177. - `mypy` (type checker)
  178. Orchestration tools:
  179. - Configuration for `pre-commit` is in the `./.pre-commit-config.yaml` file.
  180. - Configuration for `tox` is in `./tox.ini`.
  181. - Configuration for GitHub Actions (CI) is in files inside `./.github/workflows/`.
  182. ### Contributions
  183. Please have a look at the [contributions file][contributing].
  184. ### INFRASTRUCTURE
  185. - [User Documentation](http://gitpython.readthedocs.org)
  186. - [Questions and Answers](http://stackexchange.com/filters/167317/gitpython)
  187. - Please post on Stack Overflow and use the `gitpython` tag
  188. - [Issue Tracker](https://github.com/gitpython-developers/GitPython/issues)
  189. - Post reproducible bugs and feature requests as a new issue.
  190. Please be sure to provide the following information if posting bugs:
  191. - GitPython version (e.g. `import git; git.__version__`)
  192. - Python version (e.g. `python --version`)
  193. - The encountered stack-trace, if applicable
  194. - Enough information to allow reproducing the issue
  195. ### How to make a new release
  196. 1. Update/verify the **version** in the `VERSION` file.
  197. 2. Update/verify that the `doc/source/changes.rst` changelog file was updated. It should include a link to the forthcoming release page: `https://github.com/gitpython-developers/GitPython/releases/tag/<version>`
  198. 3. Commit everything.
  199. 4. Run `git tag -s <version>` to tag the version in Git.
  200. 5. _Optionally_ create and activate a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment). (Then the next step can install `build` and `twine`.)
  201. 6. Run `make release`.
  202. 7. Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
  203. ### Projects using GitPython
  204. - [PyDriller](https://github.com/ishepard/pydriller)
  205. - [Kivy Designer](https://github.com/kivy/kivy-designer)
  206. - [Prowl](https://github.com/nettitude/Prowl)
  207. - [Python Taint](https://github.com/python-security/pyt)
  208. - [Buster](https://github.com/axitkhurana/buster)
  209. - [git-ftp](https://github.com/ezyang/git-ftp)
  210. - [Git-Pandas](https://github.com/wdm0006/git-pandas)
  211. - [PyGitUp](https://github.com/msiemens/PyGitUp)
  212. - [PyJFuzz](https://github.com/mseclab/PyJFuzz)
  213. - [Loki](https://github.com/Neo23x0/Loki)
  214. - [Omniwallet](https://github.com/OmniLayer/omniwallet)
  215. - [GitViper](https://github.com/BeayemX/GitViper)
  216. - [Git Gud](https://github.com/bthayer2365/git-gud)
  217. ### LICENSE
  218. [3-Clause BSD License](https://opensource.org/license/bsd-3-clause/), also known as the New BSD License. See the [LICENSE file][license].
  219. One file exclusively used for fuzz testing is subject to [a separate license, detailed here](./fuzzing/README.md#license).
  220. This file is not included in the wheel or sdist packages published by the maintainers of GitPython.
  221. [contributing]: https://github.com/gitpython-developers/GitPython/blob/main/CONTRIBUTING.md
  222. [license]: https://github.com/gitpython-developers/GitPython/blob/main/LICENSE