← 返回命令列表

Linux command

poetry-new 命令

文本

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

常用示例

Create new project

poetry new [project-name]

Create with specific source directory

poetry new --src [project-name]

Create with custom name

poetry new --name [package-name] [directory]

说明

poetry new scaffolds a new Python project directory with a standard structure including pyproject.toml, a package directory, and a tests directory. This provides a ready-to-use project layout. The --src flag uses the `src/` layout pattern where the package lives under a `src/` subdirectory. The --name option allows the package name to differ from the directory name. For adding Poetry to an existing project, use poetry init instead.

参数

--name _NAME_
Package name.
--src
Use src layout.
--readme _FORMAT_
Readme format (md, rst).

FAQ

What is the poetry-new command used for?

poetry new scaffolds a new Python project directory with a standard structure including pyproject.toml, a package directory, and a tests directory. This provides a ready-to-use project layout. The --src flag uses the `src/` layout pattern where the package lives under a `src/` subdirectory. The --name option allows the package name to differ from the directory name. For adding Poetry to an existing project, use poetry init instead.

How do I run a basic poetry-new example?

Run `poetry new [project-name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --name _NAME_ do in poetry-new?

Package name.