README.rst 2.7 KB

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