mmcv
mmcv copied to clipboard
Improve setup.py
Motivation
When I wrote a c++ extension, I can't get intellisense and there were a lot of annoying warnings.

Modification
I added an extra function in setup.py to create a compile_commands.json. In this way I can get intellisense about c++ with the help of clangd.

BC-breaking (Optional)
No.
Use cases (Optional)
Calling create_compile_commands() at the end of setup.py will create a compile_commands.json file in the build directory by default, so that we can get intellisense about c++ with the help of clangd.
Checklist
Before PR:
- [x] I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
- [x] Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
- [ ] Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
- [ ] New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
- [ ] The documentation has been modified accordingly, including docstring or example tutorials.
After PR:
- [ ] If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
- [ ] CLA has been signed and all committers have signed the CLA in this PR.
Thanks for the contribution. Please fix the lint check.
I have fixed this problem, please check. I am sorry for this low-level mistake.
LGTM. As this PR can provide help with developing c++ extensions, I think it is a good idea to add some examples about how to use these logs in https://github.com/open-mmlab/mmcv/tree/master/mmcv/ops/csrc .
I agree and thanks. I plan to add related documentation first in the future, like https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md#code-completion-and-ide-support
Hi @rolfma !We are grateful for your efforts in helping improve mmcv open-source project during your personal time. Welcome to join OpenMMLab Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/UjgXkPWNqA If you have a WeChat account,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) Thank you again for your contribution❤