README.rst 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. in the particular Monty Python sketch.
  10. Installation
  11. ------------
  12. By default, Dulwich' setup.py will attempt to build and install the optional C
  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 C 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 dulwich --global-option="--pure"
  19. Note that you can also specify --global-option in a
  20. `requirements.txt <https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers>`_
  21. file, e.g. like this::
  22. dulwich --global-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 `Freenode <https://www.freenode.net/>`_, and
  52. `dulwich-announce <https://groups.google.com/forum/#!forum/dulwich-announce>`_
  53. and `dulwich-discuss <https://groups.google.com/forum/#!forum/dulwich-discuss>`_
  54. mailing lists.
  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.5 and later and
  63. Pypy.
  64. The latest release series to support Python 2.x was the 0.19 series. See
  65. the 0.19 branch in the Dulwich git repository.