PageRenderTime 26ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/docs/source/developers.rst

https://bitbucket.org/dhellmann/virtualenvwrapper
ReStructuredText | 121 lines | 91 code | 30 blank | 0 comment | 0 complexity | f15a693580618cbbfa4fe39f5c77cff0 MD5 | raw file
  1. ##############
  2. For Developers
  3. ##############
  4. If you would like to contribute to virtualenvwrapper directly, these
  5. instructions should help you get started. Patches, bug reports, and
  6. feature requests are all welcome through the `BitBucket site
  7. <https://bitbucket.org/virtualenvwrapper/virtualenvwrapper/>`_. Contributions
  8. in the form of patches or pull requests are easier to integrate and
  9. will receive priority attention.
  10. .. note::
  11. Before contributing new features to virtualenvwrapper core, please
  12. consider whether they should be implemented as an extension instead.
  13. Building Documentation
  14. ======================
  15. The documentation for virtualenvwrapper is written in reStructuredText
  16. and converted to HTML using Sphinx. The build itself is driven by
  17. make. You will need the following packages in order to build the
  18. docs:
  19. - Sphinx
  20. - docutils
  21. - sphinxcontrib-bitbucket
  22. Once all of the tools are installed into a virtualenv using
  23. pip, run ``make html`` to generate the HTML version of the
  24. documentation::
  25. $ make html
  26. rm -rf virtualenvwrapper/docs
  27. (cd docs && make html SPHINXOPTS="-c sphinx/pkg")
  28. sphinx-build -b html -d build/doctrees -c sphinx/pkg source build/html
  29. Running Sphinx v0.6.4
  30. loading pickled environment... done
  31. building [html]: targets for 2 source files that are out of date
  32. updating environment: 0 added, 2 changed, 0 removed
  33. reading sources... [ 50%] command_ref
  34. reading sources... [100%] developers
  35. looking for now-outdated files... none found
  36. pickling environment... done
  37. checking consistency... done
  38. preparing documents... done
  39. writing output... [ 33%] command_ref
  40. writing output... [ 66%] developers
  41. writing output... [100%] index
  42. writing additional files... search
  43. copying static files... WARNING: static directory '/Users/dhellmann/Devel/virtualenvwrapper/plugins/docs/sphinx/pkg/static' does not exist
  44. done
  45. dumping search index... done
  46. dumping object inventory... done
  47. build succeeded, 1 warning.
  48. Build finished. The HTML pages are in build/html.
  49. cp -r docs/build/html virtualenvwrapper/docs
  50. The output version of the documentation ends up in
  51. ``./virtualenvwrapper/docs`` inside your sandbox.
  52. Running Tests
  53. =============
  54. The test suite for virtualenvwrapper uses shunit2_ and tox_. The
  55. shunit2 source is included in the ``tests`` directory, but tox must be
  56. installed separately (``pip install tox``).
  57. To run the tests under bash, zsh, and ksh for Python 2.7 through 3.6,
  58. run ``tox`` from the top level directory of the hg repository.
  59. To run individual test scripts, use a command like::
  60. $ tox tests/test_cd.sh
  61. To run tests under a single version of Python, specify the appropriate
  62. environment when running tox::
  63. $ tox -e py27
  64. Combine the two modes to run specific tests with a single version of
  65. Python::
  66. $ tox -e py27 tests/test_cd.sh
  67. Add new tests by modifying an existing file or creating new script in
  68. the ``tests`` directory.
  69. .. _shunit2: https://github.com/kward/shunit2
  70. .. _tox: https://tox.testrun.org/
  71. .. _developer-templates:
  72. Creating a New Template
  73. =======================
  74. virtualenvwrapper.project templates work like `virtualenvwrapper
  75. plugins
  76. <https://virtualenvwrapper.readthedocs.io/en/latest/plugins.html>`__.
  77. The *entry point* group name is
  78. ``virtualenvwrapper.project.template``. Configure your entry point to
  79. refer to a function that will **run** (source hooks are not supported
  80. for templates).
  81. The argument to the template function is the name of the project being
  82. created. The current working directory is the directory created to
  83. hold the project files (``$PROJECT_HOME/$envname``).
  84. Help Text
  85. ---------
  86. One difference between project templates and other virtualenvwrapper
  87. extensions is that only the templates specified by the user are run.
  88. The ``mkproject`` command has a help option to give the user a list of
  89. the available templates. The names are taken from the registered
  90. entry point names, and the descriptions are taken from the docstrings
  91. for the template functions.