2
0

README.rst 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Dulwich
  2. =======
  3. This is the Dulwich project.
  4. It aims to provide an interface to git repos (both local and remote) that
  5. doesn't call out to git directly but instead uses pure Python.
  6. **Main website**: <https://www.dulwich.io/>
  7. **License**: Apache License, version 2 or GNU General Public License, version 2 or later.
  8. SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
  9. The project is named after the part of London that Mr. and Mrs. Git live in
  10. the particular Monty Python sketch.
  11. Installation
  12. ------------
  13. By default, Dulwich' setup.py will attempt to build and install the optional Rust
  14. extensions. The reason for this is that they significantly improve the performance
  15. since some low-level operations that are executed often are much slower in CPython.
  16. If you don't want to install the Rust bindings, specify the --pure argument to setup.py::
  17. $ python setup.py --pure install
  18. or if you are installing from pip::
  19. $ pip install --no-binary dulwich dulwich --config-settings "--build-option=--pure"
  20. Note that you can also specify --build-option in a
  21. `requirements.txt <https://pip.pypa.io/en/stable/reference/requirement-specifiers/>`_
  22. file, e.g. like this::
  23. dulwich --config-settings "--build-option=--pure"
  24. Getting started
  25. ---------------
  26. Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").
  27. For example, to use the lower level API to access the commit message of the
  28. last commit::
  29. >>> from dulwich.repo import Repo
  30. >>> r = Repo('.')
  31. >>> r.head()
  32. '57fbe010446356833a6ad1600059d80b1e731e15'
  33. >>> c = r[r.head()]
  34. >>> c
  35. <Commit 015fc1267258458901a94d228e39f0a378370466>
  36. >>> c.message
  37. 'Add note about encoding.\n'
  38. And to print it using porcelain::
  39. >>> from dulwich import porcelain
  40. >>> porcelain.log('.', max_entries=1)
  41. --------------------------------------------------
  42. commit: 57fbe010446356833a6ad1600059d80b1e731e15
  43. Author: Jelmer Vernooij <jelmer@jelmer.uk>
  44. Date: Sat Apr 29 2017 23:57:34 +0000
  45. Add note about encoding.
  46. Further documentation
  47. ---------------------
  48. The dulwich documentation can be found in docs/ and built by running ``make
  49. doc``. It can also be found `on the web <https://www.dulwich.io/docs/>`_.
  50. Help
  51. ----
  52. There is a *#dulwich* IRC channel on the `OFTC <https://www.oftc.net/>`_, and
  53. a `dulwich-discuss <https://groups.google.com/forum/#!forum/dulwich-discuss>`_
  54. mailing list.
  55. Contributing
  56. ------------
  57. For a full list of contributors, see the git logs or `AUTHORS <AUTHORS>`_.
  58. If you'd like to contribute to Dulwich, see the `CONTRIBUTING <CONTRIBUTING.rst>`_
  59. file and `list of open issues <https://github.com/dulwich/dulwich/issues>`_.
  60. Supported versions of Python
  61. ----------------------------
  62. At the moment, Dulwich supports (and is tested on) CPython 3.9 and later and
  63. Pypy.