Skip to content

How to authenticate for index publishingインデックス公開のための認証方法


The username is derived from the following sources, in order of precedence:ユーザー名は、優先順位の順に以下のソースから派生します:

  1. The --user / -u cli option.コマンドラインオプション --user / -u
  2. The HATCH_INDEX_USER environment variable.環境変数 HATCH_INDEX_USER
  3. The repos tables.repos テーブル
  4. The ~/.pypirc file.~/.pypirc ファイル
  5. The input to an interactive prompt.インタラクティブプロンプトへの入力。

As a fallback the value __token__ is applied.フォールバックとして、値 __token__ が適用されます。

The password is looked up in these:パスワードは以下の場所で検索されます:

  1. The ~/.pypirc file if the username was provided by it.~/.pypirc ファイル(ユーザー名が提供されている場合)。
  2. The --auth / -a cli option.--auth / -a CLIオプション。
  3. The HATCH_INDEX_AUTH environment variable.HATCH_INDEX_AUTH 環境変数。
  4. The repos tables.repos テーブル
  5. A variety of OS-level credentials services backed by keyring.keyring に基づくさまざまなOSレベルの認証情報サービス。
  6. The input to an interactive prompt.インタラクティブプロンプトへの入力。

If interactively provided credentials were used, the username will be stored in Hatch's cache and the password stored in the available keyring backed credentials stores.インタラクティブに提供された認証情報が使用された場合、ユーザー名はHatchのキャッシュに保存され、パスワードは利用可能なkeyringに基づく認証情報ストアに保存されます。

For automated releasing to PyPI, it is recommended to use "Trusted Publishing" with OIDC (e.g. PyPA's pypi-publish GitHub Action) or per-project API tokens.PyPIへの自動リリースには、OIDCを使用した「信頼できる公開」(例:PyPAのpypi-publish GitHub Action)またはプロジェクトごとのAPIトークンの使用を推奨します。