poetry README

The project's README from github.com/python-poetry/poetry. As one markdown file: README.md.

Poetry: Python packaging and dependency management made easy

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

Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack everywhere.

Poetry Install

Poetry replaces setup.py, requirements.txt, setup.cfg, MANIFEST.in and Pipfile with a simple pyproject.toml based project format.

[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"

[project]
name = "my-package"
version = "0.1.0"
description = "The description of the package"
readme = "README.md"

license = "MIT"
license-files = ["LICENSE"]

# No Python upper bound for package metadata
requires-python = ">=3.9"

authors = [
    { name = "Sébastien Eustace", email = "[email protected]" },
]

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

dependencies = [
    # equivalent to ^3.8.1 with semver constraints
    "aiohttp (>=3.8.1,<4.0.0)",
    # dependency with extras
    "requests[security] (>=2.28,<3.0)",
    # version-specific dependency with prereleases allowed (see below)
    "tomli (>=2.0.1,<3.0.0) ; python_version < '3.11'",
    # git dependency with branch specified
    "cleo @ git+https://github.com/python-poetry/cleo.git@main",
]

[project.urls]
repository = "https://github.com/python-poetry/poetry"
homepage = "https://python-poetry.org"

# Scripts are easily expressed
[project.scripts]
my_package_cli = "my_package.console:run"

[project.optional-dependencies]
# optional dependency to be installed via 'poetry install -E my-extra'
my-extra = ["pendulum (>=3.1.0,<4.0.0)"]

[tool.poetry.dependencies]
# Python upper bound for locking
python = ">=3.9,<4.0"
# Version-specific dependencies with prereleases allowed
tomli = { allow-prereleases = true }

# Dependency groups are supported for organizing your dependencies
[dependency-groups]
dev = ["pytest (>=7.1.2,<8.0.0)", "pytest-cov (>=3.0,<4.0)"]
docs = ["Sphinx (>=5.1.1,<6.0.0)"]

# ...and can be installed only when explicitly requested
# via 'poetry install --with docs'
[tool.poetry.group.docs]
optional = true

# Alternatively, you can use Poetry specific syntax
# to specify dependency groups
[tool.poetry.group.lint]
optional = true

[tool.poetry.group.lint.dependencies]
ruff = ">=0.10.0"

Installation

Poetry supports multiple installation methods, including a simple script found at install.python-poetry.org. For full installation instructions, including advanced usage of the script, alternate install methods, and CI best practices, see the full installation documentation.

Documentation

Documentation for the current version of Poetry (as well as the development branch and recently out of support versions) is available from the official website.

Contribute

Poetry is a large, complex project always in need of contributors. For those new to the project, a list of suggested issues to work on in Poetry and poetry-core is available. The full contributing documentation also provides helpful guidance.

Resources

Supporters

Thanks to JetBrains for supporting us with licenses for their tools.

JetBrains logo.

poetry (python-poetry/poetry)

Searching Database…

34.3K ·GitHub
这是干什么的?Poetry 是一个 Python 打包和依赖管理的命令行工具:它能声明、管理并安装 Python 项目的依赖,让你在任何地方都有正确的依赖环境。
Poetry 项目长什么样——我还保留 setup.py 和 requirements.txt 吗?不用——一个 pyproject.toml 文件就能取代 setup.py、requirements.txt、setup.cfg、MANIFEST.in 和 Pipfile,成为项目的标准格式。
我在 Windows 上开发,部署到 Linux 服务器——两边都能用吗?可以——Poetry 是跨平台的命令行工具,官方支持 Windows、macOS 和 Linux。
poetry-core 是什么?它是 Poetry 的无依赖核心,作为 Poetry 项目的 PEP 517 构建后端,承载 Poetry 前端的核心功能。
它还能为需要 requirements.txt 的工具生成 requirements.txt 吗?可以——官方的 poetry-plugin-export 能把 Poetry 项目和锁文件导出为 requirements.txt 之类的其他格式。
部署应用时生产服务器上也必须装 Poetry 吗?不一定——poetry-plugin-bundle 可以把 Poetry 项目或锁文件打包安装成虚拟环境等外部格式。
我们在 CI 里安装工具——Poetry 支持在 CI 中使用吗?支持——安装文档里除了介绍安装脚本的高级用法和其他安装方式,还包含 CI 的最佳实践。
Size
24.6 MB
Stars
34.3K
Age
8y
Commits · 90 Days