使用 Archery 进行日常开发#

为了简化日常开发任务,我们开发了一个名为 Archery 的 Python 编写的实用工具。

安装#

Archery 需要 Python 3.10 或更高版本。建议以可编辑模式安装 Archery,并带上 -e 标志,以便在拉取 Arrow 仓库时自动更新安装。克隆 Arrow 仓库后,从顶级目录使用以下命令安装 Archery:

$ pip install -e "dev/archery[all]"

Archery 中的许多操作都利用了 DockerDocker Compose,您可能也希望安装它们。

用法#

您可以通过传递 --help 标志来查看 Archery 的用法

$ archery --help
Usage: archery [OPTIONS] COMMAND [ARGS]...

  Apache Arrow developer utilities.

  See sub-commands help with `archery <cmd> --help`.

Options:
  --debug      Increase logging with debugging output.
  --pdb        Invoke pdb on uncaught exception.
  -q, --quiet  Silence executed commands.
  --help       Show this message and exit.

Commands:
  benchmark    Arrow benchmarking.
  build        Initialize an Arrow C++ build
  crossbow     Schedule packaging tasks or nightly builds on CI services.
  docker       Interact with Docker Compose based builds.
  integration  Execute protocol and Flight integration tests
  linking      Quick and dirty utilities for checking library linkage.
  lint         Check Arrow source tree for errors
  numpydoc     Lint python docstring with NumpyDoc
  release      Release related commands.
  trigger-bot

Archery 暴露了独立的子命令,每个子命令都提供专门的帮助输出,例如

$ archery docker --help
Usage: archery docker [OPTIONS] COMMAND [ARGS]...

  Interact with Docker Compose based builds.

Options:
  --src <arrow_src>  Specify Arrow source directory.
  --help             Show this message and exit.

Commands:
  images  List the available Docker Compose images.
  push    Push the generated Docker Compose image.
  run     Execute Docker Compose builds.

有关将 Docker 与 Archery 结合使用的更详细介绍,请参阅 运行 Docker 构建