从pyproject.toml处理项目/应用程序配置
petri的Python项目详细描述
摘要
避免使用样板的python代码。
导入Petri自动为脚本/包配备:
- 使用pydantic设置。
- 使用python dotenv处理dotenv文件。
- 使用logzero&autologging进行日志配置。
- 来自pyproject.toml文件的项目元数据。
- 通过env环境变量处理环境(prod/dev/test)。
屏幕截图
代码示例
- 请参见测试/数据文件夹
要求
使用要求
- python>=3.6
开发要求
- tox
- poetry (recommended)
安装
- pip安装petri
测试
- 运行tox-e venv创建一个合适的virtualenv
- tox运行完整的测试套件
贡献
开发
- Make sure to pass tox tests (including those with –runslow).
- For tests design, you can use use ´@pytest.mark.incremental´ and ´@pytest.mark.slow´. See “catalogo_db/tests/conftest.py”
- If the requirements change, make sure to re-build all images
版本控制
- Use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/pwoolvett/petri/tags).
支架
如果有问题,请在github中提交问题。