使用 Archery 进行日常开发#

为了简化一些日常开发任务,我们开发了一个名为 Archery 的 Python 实用程序。

安装#

Archery 需要 Python 3.9 或更高版本。建议使用 -e 标志以*可编辑*模式安装 Archery,以便在拉取 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 构建