← 返回命令列表

Linux command

hatch 命令

文本

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

常用示例

Create new project

hatch new [project-name]

Build package

hatch build

Run tests

hatch run test

Enter environment

hatch shell

Publish to PyPI

hatch publish

Show or bump project version

hatch version

说明

Hatch is a modern, extensible Python project manager. It handles project creation, building, publishing, environment management, and testing in a unified tool. It is the official build backend recommended by the Python Packaging Authority (PyPA). Hatch uses pyproject.toml for configuration and supports current PEP standards. It provides reproducible environments and multi-environment testing via configurable matrices.

参数

new _name_
Create new project.
build
Build distributions.
publish
Publish to package index.
run _cmd_
Run command in environment.
shell
Enter project environment.
env _subcommand_
Manage environments.
test
Run tests across environments.
fmt
Format code.
version
Show/bump version.
clean
Remove build artifacts.

FAQ

What is the hatch command used for?

Hatch is a modern, extensible Python project manager. It handles project creation, building, publishing, environment management, and testing in a unified tool. It is the official build backend recommended by the Python Packaging Authority (PyPA). Hatch uses pyproject.toml for configuration and supports current PEP standards. It provides reproducible environments and multi-environment testing via configurable matrices.

How do I run a basic hatch example?

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

What does new _name_ do in hatch?

Create new project.