Poetry Multiproject Plugin 使用教程
1. 项目的目录结构及介绍
poetry-multiproject-plugin/
├── README.md
├── poetry_multiproject_plugin/
│ ├── __init__.py
│ ├── build_project.py
│ ├── check_project.py
│ └── utils.py
├── tests/
│ ├── __init__.py
│ ├── test_build_project.py
│ └── test_check_project.py
├── pyproject.toml
└── .gitignore
README.md
: 项目说明文档。poetry_multiproject_plugin/
: 项目的主要代码目录。__init__.py
: 模块初始化文件。build_project.py
: 实现build-project
命令的代码。check_project.py
: 实现check-project
命令的代码。utils.py
: 工具函数。
tests/
: 测试代码目录。__init__.py
: 测试模块初始化文件。test_build_project.py
: 测试build-project
命令的代码。test_check_project.py
: 测试check-project
命令的代码。
pyproject.toml
: 项目的配置文件。.gitignore
: Git 忽略文件配置。
2. 项目的启动文件介绍
项目的启动文件主要是 pyproject.toml
文件中的配置,通过 Poetry 命令来启动项目。
[tool.poetry]
name = "poetry-multiproject-plugin"
version = "1.6.0"
description = "A Poetry plugin that makes it possible to use relative package includes"
authors = ["David Vujic <david.vujic@gmail.com>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.dev-dependencies]
pytest = "^6.2"
[tool.poetry.plugins."poetry.application.plugin"]
"poetry-multiproject-plugin" = "poetry_multiproject_plugin:MultiProjectPlugin"
[tool.poetry]
: 项目的基本信息。[tool.poetry.dependencies]
: 项目依赖。[tool.poetry.dev-dependencies]
: 开发依赖。[tool.poetry.plugins."poetry.application.plugin"]
: 插件注册。
3. 项目的配置文件介绍
项目的配置文件主要是 pyproject.toml
文件,其中包含了项目的依赖、插件注册等信息。
[tool.poetry]
name = "poetry-multiproject-plugin"
version = "1.6.0"
description = "A Poetry plugin that makes it possible to use relative package includes"
authors = ["David Vujic <david.vujic@gmail.com>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
[tool.poetry.dev-dependencies]
pytest = "^6.2"
[tool.poetry.plugins."poetry.application.plugin"]
"poetry-multiproject-plugin" = "poetry_multiproject_plugin:MultiProjectPlugin"
[tool.poetry]
: 项目的基本信息。[tool.poetry.dependencies]
: 项目依赖。[tool.poetry.dev-dependencies]
: 开发依赖。[tool.poetry.plugins."poetry.application.plugin"]
: 插件注册。
通过以上配置,可以使用 Poetry 命令来安装和使用该插件。