使用 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 建置