跳转到主要内容

Python依赖管理和打包变得简单。

项目描述

Poetry: Python打包和依赖管理变得简单

Poetry Stable Version Pre-release Version Python Versions Download Stats Discord

Poetry帮助您声明、管理和安装Python项目的依赖项,确保您在任何地方都有正确的堆栈。

Poetry Install

Poetry使用基于 pyproject.toml 的简单项目格式替换了 setup.pyrequirements.txtsetup.cfgMANIFEST.inPipfile

[tool.poetry]
name = "my-package"
version = "0.1.0"
description = "The description of the package"

license = "MIT"

authors = [
    "Sébastien Eustace <sebastien@eustace.io>"
]

repository = "https://github.com/python-poetry/poetry"
homepage = "https://poetry.pythonlang.cn"

# README file(s) are used as the package description
readme = ["README.md", "LICENSE"]

# Keywords (translated to tags on the package index)
keywords = ["packaging", "poetry"]

[tool.poetry.dependencies]
# Compatible Python versions
python = ">=3.8"
# Standard dependency with semver constraints
aiohttp = "^3.8.1"
# Dependency with extras
requests = { version = "^2.28", extras = ["security"] }
# Version-specific dependencies with prereleases allowed
tomli = { version = "^2.0.1", python = "<3.11", allow-prereleases = true }
# Git dependencies
cleo = { git = "https://github.com/python-poetry/cleo.git", branch = "main" }
# Optional dependencies (installed by extras)
pendulum = { version = "^2.1.2", optional = true }

# Dependency groups are supported for organizing your dependencies
[tool.poetry.group.dev.dependencies]
pytest = "^7.1.2"
pytest-cov = "^3.0"

# ...and can be installed only when explicitly requested
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
Sphinx = "^5.1.1"

# Python-style entrypoints and scripts are easily expressed
[tool.poetry.scripts]
my-script = "my_package:main"

安装

Poetry支持多种安装方法,包括位于 install.python-poetry.org 的简单脚本。有关完整的安装说明,包括脚本的高级用法、备用安装方法和CI最佳实践,请参阅完整的 安装文档

文档

文档 提供了当前版本的 Poetry(包括开发分支和最近已停用的版本)的官方网站。

贡献

Poetry 是一个庞大而复杂的工程项目,始终需要贡献者。对于新加入项目的成员,有一份建议问题列表,您可以在 Poetry 和 poetry-core 上进行工作。完整的贡献文档也提供了有用的指导。

资源

相关项目

项目详情


发布历史 发布通知 | RSS 源

下载文件

下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分发

poetry-1.8.3.tar.gz (1.5 MB 查看哈希值)

上传时间

构建分发

poetry-1.8.3-py3-none-any.whl (249.9 kB 查看哈希值)

上传时间 Python 3

支持者