Skip to content

Contributing

欢迎所有对 ormar 的贡献!

问题

为了让我们尽可能简单地为您提供帮助,请包括以下内容:

  • 操作系统
  • Python版本
  • Ormar版本
  • 数据库后端(mysql、sqlite 或 postgresql)

请尝试始终包含上述内容,除非您无法安装 ormar 或知道它与您的问题或功能请求无关。

请求请求

开始并创建拉取请求应该非常简单。

!!!注意 除非您的更改是微不足道的(拼写错误、文档调整等),否则请在创建拉取请求之前创建一个问题来讨论更改。

为了使贡献尽可能简单和快速,您需要在本地运行测试和 linting。

您需要安装 python 3.6.2、3.7 或 3.8、poetry 和 git。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 1. clone your fork and cd into the repo directory
git clone git@github.com:<your username>/ormar.git
cd ormar

# 2. Install ormar, dependencies and test dependencies
poetry install -E dev

# 3. Checkout a new branch and make your changes
git checkout -b my-new-feature-branch
# make your changes...

# 4. Formatting and linting
# ormar uses black for formatting, flake8 for linting and mypy for type hints check
# run all of the following as all those calls will be run on travis after every push
black ormar tests
flake8 ormar
mypy ormar tests

# 5. Run tests
# on localhost all tests are run against sglite backend
# rest of the backends will be checked after push
pytest -svv --cov=ormar --cov=tests --cov-fail-under=100 --cov-report=term-missing

# 6. Build documentation
mkdocs build
# if you have changed the documentation make sure it builds successfully
# you can also use `mkdocs serve` to serve the documentation at localhost:8000

# ... commit, push, and create your pull request

!!!tip 有关 ormar 如何以及为何如此工作的更多信息,请参阅 API 文档