CONTRIBUTING.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. All functionality should be available in pure Python. Optional Rust
  2. implementations may be written for performance reasons, but should never
  3. replace the Python implementation.
  4. Where possible include updates to NEWS along with your improvements.
  5. New functionality and bug fixes should be accompanied by matching unit tests.
  6. Coding style
  7. ------------
  8. Where possible, please follow PEP8 with regard to coding style. Run ruff.
  9. Furthermore, triple-quotes should always be """, single quotes are ' unless
  10. using " would result in less escaping within the string.
  11. Public methods, functions and classes should all have doc strings. Please use
  12. Google style docstrings to document parameters and return values.
  13. You can generate the documentation by running "make doc".
  14. Running the tests
  15. -----------------
  16. To run the testsuite, you should be able to simply run "make check". This
  17. will run the tests using unittest.
  18. ::
  19. $ make check
  20. Tox configuration is also present.
  21. String Types
  22. ------------
  23. Like Linux, Git treats filenames as arbitrary bytestrings. There is no prescribed
  24. encoding for these strings, and although it is fairly common to use UTF-8, any
  25. raw byte strings are supported.
  26. For this reason, the lower levels in Dulwich treat git-based filenames as
  27. bytestrings. It is up to the Dulwich API user to encode and decode them if
  28. necessary. The porcelain may accept unicode strings and convert them to
  29. bytestrings as necessary on the fly (using 'utf-8').
  30. * on-disk filenames: regular strings, or ideally, pathlib.Path instances
  31. * git-repository related filenames: bytes
  32. * object sha1 digests (20 bytes long): bytes
  33. * object sha1 hexdigests (40 bytes long): str (bytestrings on python2, strings
  34. on python3)
  35. Merge requests
  36. --------------
  37. Please either send pull requests to the maintainer (jelmer@jelmer.uk) or create
  38. new pull requests on GitHub.
  39. Licensing
  40. ---------
  41. All contributions should be made under the same license that Dulwich itself
  42. comes under: both Apache License, version 2.0 or later and GNU General Public
  43. License, version 2.0 or later.