developer-guide.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ================================
  2. Developer's Guide for Setuptools
  3. ================================
  4. If you want to know more about contributing on Setuptools, this is the place.
  5. .. contents:: **Table of Contents**
  6. -------------------
  7. Recommended Reading
  8. -------------------
  9. Please read `How to write the perfect pull request
  10. <http://blog.jaraco.com/2014/04/how-to-write-perfect-pull-request.html>`_
  11. for some tips on contributing to open source projects. Although the article
  12. is not authoritative, it was authored by the maintainer of Setuptools, so
  13. reflects his opinions and will improve the likelihood of acceptance and
  14. quality of contribution.
  15. ------------------
  16. Project Management
  17. ------------------
  18. Setuptools is maintained primarily in Github at `this home
  19. <https://github.com/pypa/setuptools>`_. Setuptools is maintained under the
  20. Python Packaging Authority (PyPA) with several core contributors. All bugs
  21. for Setuptools are filed and the canonical source is maintained in Github.
  22. User support and discussions are done through the issue tracker (for specific)
  23. issues, through the distutils-sig mailing list, or on IRC (Freenode) at
  24. #pypa.
  25. Discussions about development happen on the pypa-dev mailing list or on IRC
  26. (Freenode) at #pypa-dev.
  27. -----------------
  28. Authoring Tickets
  29. -----------------
  30. Before authoring any source code, it's often prudent to file a ticket
  31. describing the motivation behind making changes. First search to see if a
  32. ticket already exists for your issue. If not, create one. Try to think from
  33. the perspective of the reader. Explain what behavior you expected, what you
  34. got instead, and what factors might have contributed to the unexpected
  35. behavior. In Github, surround a block of code or traceback with the triple
  36. backtick "\`\`\`" so that it is formatted nicely.
  37. Filing a ticket provides a forum for justification, discussion, and
  38. clarification. The ticket provides a record of the purpose for the change and
  39. any hard decisions that were made. It provides a single place for others to
  40. reference when trying to understand why the software operates the way it does
  41. or why certain changes were made.
  42. Setuptools makes extensive use of hyperlinks to tickets in the changelog so
  43. that system integrators and other users can get a quick summary, but then
  44. jump to the in-depth discussion about any subject referenced.
  45. -----------
  46. Source Code
  47. -----------
  48. Grab the code at Github::
  49. $ git checkout https://github.com/pypa/setuptools
  50. If you want to contribute changes, we recommend you fork the repository on
  51. Github, commit the changes to your repository, and then make a pull request
  52. on Github. If you make some changes, don't forget to:
  53. - add a note in CHANGES.rst
  54. Please commit all changes in the 'master' branch against the latest available
  55. commit or for bug-fixes, against an earlier commit or release in which the
  56. bug occurred.
  57. If you find yourself working on more than one issue at a time, Setuptools
  58. generally prefers Git-style branches, so use Mercurial bookmarks or Git
  59. branches or multiple forks to maintain separate efforts.
  60. The Continuous Integration tests that validate every release are run
  61. from this repository.
  62. For posterity, the old `Bitbucket mirror
  63. <https://bitbucket.org/pypa/setuptools>`_ is available.
  64. -------
  65. Testing
  66. -------
  67. The primary tests are run using py.test. To run the tests::
  68. $ python setup.py test
  69. Or install py.test into your environment and run ``PYTHONPATH=. py.test``
  70. or ``python -m pytest``.
  71. Under continuous integration, additional tests may be run. See the
  72. ``.travis.yml`` file for full details on the tests run under Travis-CI.
  73. -------------------
  74. Semantic Versioning
  75. -------------------
  76. Setuptools follows ``semver``.
  77. .. explain value of reflecting meaning in versions.
  78. ----------------------
  79. Building Documentation
  80. ----------------------
  81. Setuptools relies on the Sphinx system for building documentation and in
  82. particular the ``build_sphinx`` distutils command. To build the
  83. documentation, invoke::
  84. python setup.py build_sphinx
  85. from the root of the repository. Setuptools will download a compatible
  86. build of Sphinx and any requisite plugins and then build the
  87. documentation in the build/sphinx directory.
  88. Setuptools does not support invoking the doc builder from the docs/
  89. directory as some tools expect.