/docs/develop/index.rst

https://bitbucket.org/edhaker13/flexget · ReStructuredText · 128 lines · 86 code · 42 blank · 0 comment · 0 complexity · 10a3e3ab2ec967b82b34188f041d1dd9 MD5 · raw file

  1. Introduction
  2. ============
  3. We welcome all new developers and contributors with very friendly community.
  4. Join #FlexGet @ freenode.
  5. Technologies used
  6. -----------------
  7. List of external libraries and utilities. As for new libraries, we require that all of them are
  8. installable on Windows trough ``pip``. This will exclude things that require compilers like LXML.
  9. Core
  10. ~~~~
  11. * SQLAlchemy
  12. * BeautifulSoup
  13. * Feedparser
  14. * Python-Requests
  15. * PyNBZ
  16. * Jinja2
  17. * PyYaml
  18. * Some smaller misc libraries
  19. WebUI
  20. ~~~~~
  21. * Flask
  22. * Jinja2
  23. * CherryPy
  24. CherryPy is only used for WSGI server.
  25. How do I get started?
  26. ---------------------
  27. Set up development environment, which is basically just two steps.
  28. #. `GIT clone`_ our repository.
  29. #. Run ``bootstrap.py`` with Python 2.6.x - 2.7.x.
  30. For easier collaboration we recommend forking us on github and sending pull
  31. request. Once we see any semi-serious input from a developer we will grant
  32. write permissions to our central repository. You can also request this earlier
  33. if you wish.
  34. .. _GIT clone: https://github.com/Flexget/Flexget
  35. Environment
  36. -----------
  37. Once you have bootstrapped the environment you have fully functional FlexGet in
  38. a `virtual environment`_ in your clone directory. You can easily add or modify
  39. existing plugins in here and it will not mess your other FlexGet instances in
  40. any way. The commands in the documentation expect the virtual environment to be
  41. activated. If you don't activate it you must run commands explicitly from under
  42. environment ``bin`` directory or ``scripts`` in windows. E.g. ``flexget`` would
  43. be ``bin/flexget`` (at project root) in unactivated `virtual environment`_.
  44. FlexGet project uses `paver`_ to provide development related utilities and tasks.
  45. Run ``paver --help`` to see what commands are available. Some of these will
  46. be mentioned later.
  47. .. _virtual environment: https://pypi.python.org/pypi/virtualenv
  48. .. _paver: http://paver.github.io/paver/
  49. Code quality
  50. ------------
  51. Unit tests
  52. ~~~~~~~~~~
  53. There are currently over 250 unit tests ensuring that existing functionality
  54. is not accidentally broken.
  55. Easiest way to run tests is trough paver::
  56. paver test
  57. By default no online tests are executed, these can be enabled with ``--online``
  58. argument. There are other ways to run the tests as well, more specifically
  59. we use `nose`_ framework.
  60. Run single test file via nose::
  61. nosetests test_file
  62. Run single test suite (class)::
  63. nosetests test_file:class
  64. Run single test case from suite::
  65. nosetests test_file:class.case
  66. Live example::
  67. nosetests test_seriesparser:TestSeriesParser.test_basic
  68. .. NOTE::
  69. Don't use .py extension or include path with these. Configuration file ``setup.cfg`` defines
  70. needed parameters for Nose.
  71. Project has `Jenkins CI server`_ which polls master branch and makes runs tests
  72. and makes new build if they pass.
  73. Unit tests are not mandatory for a plugin to be included in the FlexGet
  74. distribution but it makes maintaining our code trough project life and
  75. refactoring so much easier.
  76. .. _Jenkins CI server: http://ci.flexget.com
  77. Code Style
  78. ~~~~~~~~~~
  79. All code should be formatted according to `Python PEP8`_ recommendations. With
  80. the exception of line length limit at 79 characters. FlexGet uses 120 characters
  81. instead.
  82. To run PEP8 checker::
  83. paver pep8
  84. We do have some violations in our codebase, but new code should not add any.
  85. .. _nose: https://nose.readthedocs.org/
  86. .. _Python PEP8: http://www.python.org/dev/peps/pep-0008/