development.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .. include:: global.rst.inc
  2. .. _development:
  3. Development
  4. ===========
  5. This chapter will get you started with |project_name|' development.
  6. |project_name| is written in Python (with a little bit of Cython and C for
  7. the performance critical parts).
  8. Building a development environment
  9. ----------------------------------
  10. First, just install borg into a virtual env as described before.
  11. To install some additional packages needed for running the tests, activate your
  12. virtual env and run::
  13. pip install -r requirements.d/development.txt
  14. Running the tests
  15. -----------------
  16. The tests are in the borg/testsuite package.
  17. To run them, you need to have fakeroot, tox and pytest installed.
  18. To run the test suite use the following command::
  19. fakeroot -u tox # run all tests
  20. Some more advanced examples::
  21. # verify a changed tox.ini (run this after any change to tox.ini):
  22. fakeroot -u tox --recreate
  23. fakeroot -u tox -e py32 # run all tests, but only on python 3.2
  24. fakeroot -u tox borg.testsuite.locking # only run 1 test module
  25. fakeroot -u tox borg.testsuite.locking -- -k '"not Timer"' # exclude some tests
  26. fakeroot -u tox borg.testsuite -- -v # verbose py.test
  27. Important notes:
  28. - Without fakeroot -u some tests will fail.
  29. - When using -- to give options to py.test, you MUST also give borg.testsuite[.module].
  30. Building the docs with Sphinx
  31. -----------------------------
  32. The documentation (in reStructuredText format, .rst) is in docs/.
  33. To build the html version of it, you need to have sphinx installed::
  34. pip3 install sphinx
  35. Now run::
  36. cd docs/
  37. make html
  38. Then point a web browser at docs/_build/html/index.html.