← 返回命令列表

Linux command

poetry-publish 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Publish to PyPI

poetry publish

Build and publish

poetry publish --build

Publish to custom repository

poetry publish -r [repository]

Dry run

poetry publish --dry-run

说明

poetry publish uploads built distribution packages (wheel and sdist) to PyPI or a custom repository. The --build flag builds the package before publishing in a single step. Use -r to specify an alternative repository configured via poetry config. Authentication can be provided via -u/-p flags, a configured token, or the keyring. The --dry-run flag simulates the upload without actually publishing.

参数

--build
Build the package before publishing.
-r, --repository _NAME_
Target repository (default: pypi). Must match a name configured via poetry config.
-u, --username _USER_
Repository username.
-p, --password _PASS_
Repository password.
--cert _CERT_
Certificate authority to access the repository.
--client-cert _CERT_
Client certificate to access the repository.
--dry-run
Simulate publishing without uploading.
--skip-existing
Ignore errors from files already existing in the repository.

FAQ

What is the poetry-publish command used for?

poetry publish uploads built distribution packages (wheel and sdist) to PyPI or a custom repository. The --build flag builds the package before publishing in a single step. Use -r to specify an alternative repository configured via poetry config. Authentication can be provided via -u/-p flags, a configured token, or the keyring. The --dry-run flag simulates the upload without actually publishing.

How do I run a basic poetry-publish example?

Run `poetry publish` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --build do in poetry-publish?

Build the package before publishing.