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 5.4 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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/FLAML/issues), [discussions](https://github.com/microsoft/FLAML/discussions), and [discord](https://discord.gg/7ZVfhbTQZ5).
  8. - Tutorials, blog posts, talks that promote the project.
  9. - Sharing application scenarios and/or related research.
  10. You can take a look at the [Roadmap for Upcoming Features](https://github.com/microsoft/FLAML/wiki/Roadmap-for-Upcoming-Features) to identify potential things to work on.
  11. Most contributions require you to agree to a
  12. Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
  13. the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
  14. 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.
  15. When you submit a pull request, a CLA bot will automatically determine whether you need to provide
  16. a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
  17. provided by the bot. You will only need to do this once across all repos using our CLA.
  18. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
  19. For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
  20. contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
  21. ## How to make a good bug report
  22. When you submit an issue to [GitHub](https://github.com/microsoft/FLAML/issues), please do your best to
  23. follow these guidelines! This will make it a lot easier to provide you with good
  24. feedback:
  25. - The ideal bug report contains a short reproducible code snippet. This way
  26. anyone can try to reproduce the bug easily (see [this](https://stackoverflow.com/help/mcve) for more details). If your snippet is
  27. longer than around 50 lines, please link to a [gist](https://gist.github.com) or a GitHub repo.
  28. - If an exception is raised, please **provide the full traceback**.
  29. - Please include your **operating system type and version number**, as well as
  30. your **Python, flaml, scikit-learn versions**. The version of flaml
  31. can be found by running the following code snippet:
  32. ```python
  33. import flaml
  34. print(flaml.__version__)
  35. ```
  36. - Please ensure all **code snippets and error messages are formatted in
  37. appropriate code blocks**. See [Creating and highlighting code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks)
  38. for more details.
  39. ## Becoming a Reviewer
  40. 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.
  41. ## Developing
  42. ### Setup
  43. ```bash
  44. git clone https://github.com/microsoft/FLAML.git
  45. pip install -e FLAML[notebook,autogen]
  46. ```
  47. In case the `pip install` command fails, try escaping the brackets such as `pip install -e FLAML\[notebook,autogen\]`.
  48. ### Docker
  49. We provide a simple [Dockerfile](https://github.com/microsoft/FLAML/blob/main/Dockerfile).
  50. ```bash
  51. docker build https://github.com/microsoft/FLAML.git#main -t flaml-dev
  52. docker run -it flaml-dev
  53. ```
  54. ### Develop in Remote Container
  55. If you use vscode, you can open the FLAML folder in a [Container](https://code.visualstudio.com/docs/remote/containers).
  56. We have provided the configuration in [devcontainer](https://github.com/microsoft/FLAML/blob/main/.devcontainer).
  57. ### Pre-commit
  58. Run `pre-commit install` to install pre-commit into your git hooks. Before you commit, run
  59. `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.
  60. ### Coverage
  61. Any code you commit should not decrease coverage. To run all unit tests, install the [test] option under FLAML/:
  62. ```bash
  63. pip install -e."[test]"
  64. coverage run -m pytest test
  65. ```
  66. Then you can see the coverage report by
  67. `coverage report -m` or `coverage html`.
  68. ### Documentation
  69. To build and test documentation locally, install [Node.js](https://nodejs.org/en/download/). For example,
  70. ```bash
  71. nvm install --lts
  72. ```
  73. Then:
  74. ```console
  75. npm install --global yarn # skip if you use the dev container we provided
  76. pip install pydoc-markdown==4.5.0 # skip if you use the dev container we provided
  77. cd website
  78. yarn install --frozen-lockfile --ignore-engines
  79. pydoc-markdown
  80. yarn start
  81. ```
  82. The last command starts a local development server and opens up a browser window.
  83. Most changes are reflected live without having to restart the server.
  84. Note:
  85. some tips in this guide are based off the contributor guide from [ray](https://docs.ray.io/en/latest/ray-contribute/getting-involved.html), [scikit-learn](https://scikit-learn.org/stable/developers/contributing.html), or [hummingbird](https://github.com/microsoft/hummingbird/blob/main/CONTRIBUTING.md).