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.

develop.md 1.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Develop
  2. ## 1. Code Style
  3. We adopt [PEP8](https://www.python.org/dev/peps/pep-0008/) as the preferred code style.
  4. We use the following toolsseed isortseed isortseed isort for linting and formatting:
  5. - [flake8](http://flake8.pycqa.org/en/latest/): linter
  6. - [yapf](https://github.com/google/yapf): formatter
  7. - [isort](https://github.com/timothycrosley/isort): sort imports
  8. Style configurations of yapf and isort can be found in [setup.cfg](../../setup.cfg).
  9. We use [pre-commit hook](https://pre-commit.com/) that checks and formats for `flake8`, `yapf`, `seed-isort-config`, `isort`, `trailing whitespaces`,
  10. fixes `end-of-files`, sorts `requirments.txt` automatically on every commit.
  11. The config for a pre-commit hook is stored in [.pre-commit-config](../../.pre-commit-config.yaml).
  12. After you clone the repository, you will need to install initialize pre-commit hook.
  13. ```bash
  14. pip install -r requirements/tests.txt
  15. ```
  16. From the repository folder
  17. ```bash
  18. pre-commit install
  19. ```
  20. After this on every commit check code linters and formatter will be enforced.
  21. If you want to use pre-commit to check all the files, you can run
  22. ```bash
  23. pre-commit run --all-files
  24. ```
  25. If you only want to format and lint your code, you can run
  26. ```bash
  27. make linter
  28. ```
  29. ## 2. Test
  30. ### 2.1 Unit test
  31. ```bash
  32. make test
  33. ```
  34. ### 2.2 Test data
  35. TODO
  36. ## 3. Build pip package
  37. ```bash
  38. make whl
  39. ```

致力于通过开放的社区合作,开源AI模型以及相关创新技术,推动基于模型即服务的生态繁荣发展