← 返回命令列表

Linux command

poetry-source 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Add package source

poetry source add [name] [url]

Remove package source

poetry source remove [name]

Show configured sources

poetry source show

Add private repository

poetry source add --priority=supplemental [name] [url]

说明

poetry source manages package repository sources in pyproject.toml. It allows adding private or alternative package indexes alongside or instead of the default PyPI. The --priority option controls how sources are used: primary sources are checked first, supplemental sources are checked only for packages not found in primary sources, and explicit sources are only used when a package specifically references them. Use show to list configured sources.

参数

add _NAME_ _URL_
Add package source.
remove _NAME_
Remove source.
show
List sources.
--priority _LEVEL_
Source priority (primary, supplemental, explicit).

FAQ

What is the poetry-source command used for?

poetry source manages package repository sources in pyproject.toml. It allows adding private or alternative package indexes alongside or instead of the default PyPI. The --priority option controls how sources are used: primary sources are checked first, supplemental sources are checked only for packages not found in primary sources, and explicit sources are only used when a package specifically references them. Use show to list configured sources.

How do I run a basic poetry-source example?

Run `poetry source add [name] [url]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does add _NAME_ _URL_ do in poetry-source?

Add package source.