You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

Contribute.md 8.1 kB

2 years ago
4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Contributing
  2. This project welcomes and encourages all forms of contributions, including but not limited to:
  3. - Pushing patches.
  4. - Code review of pull requests.
  5. - Documentation, examples and test cases.
  6. - Readability improvement, e.g., improvement on docstr and comments.
  7. - Community participation in [issues](https://github.com/microsoft/autogen/issues), [discussions](https://github.com/microsoft/autogen/discussions), [discord](https://discord.gg/pAbnFJrkgZ), and [twitter](https://twitter.com/pyautogen).
  8. - Tutorials, blog posts, talks that promote the project.
  9. - Sharing application scenarios and/or related research.
  10. Most contributions require you to agree to a
  11. Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
  12. the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
  13. If you are new to GitHub [here](https://help.github.com/categories/collaborating-with-issues-and-pull-requests/) is a detailed help source on getting involved with development on GitHub.
  14. When you submit a pull request, a CLA bot will automatically determine whether you need to provide
  15. a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
  16. provided by the bot. You will only need to do this once across all repos using our CLA.
  17. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  18. For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
  19. contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
  20. ## How to make a good bug report
  21. When you submit an issue to [GitHub](https://github.com/microsoft/autogen/issues), please do your best to
  22. follow these guidelines! This will make it a lot easier to provide you with good
  23. feedback:
  24. - The ideal bug report contains a short reproducible code snippet. This way
  25. anyone can try to reproduce the bug easily (see [this](https://stackoverflow.com/help/mcve) for more details). If your snippet is
  26. longer than around 50 lines, please link to a [gist](https://gist.github.com) or a GitHub repo.
  27. - If an exception is raised, please **provide the full traceback**.
  28. - Please include your **operating system type and version number**, as well as
  29. your **Python, autogen, scikit-learn versions**. The version of autogen
  30. can be found by running the following code snippet:
  31. ```python
  32. import autogen
  33. print(autogen.__version__)
  34. ```
  35. - Please ensure all **code snippets and error messages are formatted in
  36. appropriate code blocks**. See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks)
  37. for more details.
  38. ## Becoming a Reviewer
  39. There is currently no formal reviewer solicitation process. Current reviewers identify reviewers from active contributors. If you are willing to become a reviewer, you are welcome to let us know on discord.
  40. ## Guidance for Maintainers
  41. ### General
  42. * Be a member of the community and treat everyone as a member. Be inclusive.
  43. * Help each other and encourage mutual help.
  44. * Actively post and respond.
  45. * Keep open communication.
  46. ### Pull Requests
  47. * For new PR, decide whether to close without review. If not, find the right reviewers. The default reviewer is microsoft/autogen. Ask users who can benefit from the PR to review it.
  48. * For old PR, check the blocker: reviewer or PR creator. Try to unblock. Get additional help when needed.
  49. * When requesting changes, make sure you can check back in time because it blocks merging.
  50. * Make sure all the checks are passed.
  51. * For changes that require running OpenAI tests, make sure the OpenAI tests pass too. Running these tests requires approval.
  52. * In general, suggest small PRs instead of a giant PR.
  53. * For documentation change, request snapshot of the compiled website, or compile by yourself to verify the format.
  54. * For new contributors who have not signed the contributing agreement, remind them to sign before reviewing.
  55. * For multiple PRs which may have conflict, coordinate them to figure out the right order.
  56. * Pay special attention to:
  57. - Breaking changes. Don’t make breaking changes unless necessary. Don’t merge to main until enough headsup is provided and a new release is ready.
  58. - Test coverage decrease.
  59. - Changes that may cause performance degradation. Do regression test when test suites are available.
  60. - Discourage **change to the core library** when there is an alternative.
  61. ### Issues and Discussions
  62. * For new issues, write a reply, apply a label if relevant. Ask on discord when necessary. For roadmap issues, add to the roadmap project and encourage community discussion. Mention relevant experts when necessary.
  63. * For old issues, provide an update or close. Ask on discord when necessary. Encourage PR creation when relevant.
  64. * Use “good first issue” for easy fix suitable for first-time contributors.
  65. * Use “task list” for issues that require multiple PRs.
  66. * For discussions, create an issue when relevant. Discuss on discord when appropriate.
  67. ## Developing
  68. ### Setup
  69. ```bash
  70. git clone https://github.com/microsoft/autogen.git
  71. pip install -e autogen
  72. ```
  73. ### Docker
  74. We provide a simple [Dockerfile](https://github.com/microsoft/autogen/blob/main/Dockerfile).
  75. ```bash
  76. docker build https://github.com/microsoft/autogen.git#main -t autogen-dev
  77. docker run -it autogen-dev
  78. ```
  79. ### Develop in Remote Container
  80. If you use vscode, you can open the autogen folder in a [Container](https://code.visualstudio.com/docs/remote/containers).
  81. We have provided the configuration in [devcontainer](https://github.com/microsoft/autogen/blob/main/.devcontainer). They can be used in GitHub codespace too. Developing AutoGen in dev containers is recommended.
  82. ### Pre-commit
  83. Run `pre-commit install` to install pre-commit into your git hooks. Before you commit, run
  84. `pre-commit run` to check if you meet the pre-commit requirements. If you use Windows (without WSL) and can't commit after installing pre-commit, you can run `pre-commit uninstall` to uninstall the hook. In WSL or Linux this is supposed to work.
  85. ### Write tests
  86. Tests are automatically run via GitHub actions. There are two workflows:
  87. 1. [build.yml](https://github.com/microsoft/autogen/blob/main/.github/workflows/build.yml)
  88. 1. [openai.yml](https://github.com/microsoft/autogen/blob/main/.github/workflows/openai.yml)
  89. The first workflow is required to pass for all PRs. The second workflow is required for changes that affect the openai tests. The second workflow requires approval to run. When writing tests that require openai, please use [`pytest.mark.skipif`](https://github.com/microsoft/autogen/blob/a456b512d5a933ce9707ce51c465ea35a9dd180c/test/test_with_openai.py#L13) to make them run in one python version only when openai is installed. If additional dependency for this test is required, install the dependency in the corresponding python version in [openai.yml](https://github.com/microsoft/autogen/blob/main/.github/workflows/openai.yml).
  90. ### Coverage
  91. Any code you commit should not decrease coverage. To run all unit tests, install the [test] option:
  92. ```bash
  93. pip install -e."[test]"
  94. coverage run -m pytest test
  95. ```
  96. Then you can see the coverage report by
  97. `coverage report -m` or `coverage html`.
  98. ### Documentation
  99. To build and test documentation locally, install [Node.js](https://nodejs.org/en/download/). For example,
  100. ```bash
  101. nvm install --lts
  102. ```
  103. Then:
  104. ```console
  105. npm install --global yarn # skip if you use the dev container we provided
  106. pip install pydoc-markdown # skip if you use the dev container we provided
  107. cd website
  108. yarn install --frozen-lockfile --ignore-engines
  109. pydoc-markdown
  110. yarn start
  111. ```
  112. The last command starts a local development server and opens up a browser window.
  113. Most changes are reflected live without having to restart the server.
  114. Note:
  115. some tips in this guide are based off the contributor guide from [flaml](https://microsoft.github.io/FLAML/docs/Contribute).