Skip to content

How to authenticate for index publishing


ユーザ名は、優先順位に従って、次のソースから取得されます。:

  1. The --user / -u cli option.
  2. The HATCH_INDEX_USER environment variable.
  3. The repos tables.
  4. The ~/.pypirc file.
  5. The input to an interactive prompt.

フォールバックとして、値__token__が適用されます。

パスワードは次の場所で検索されます。:

  1. The ~/.pypirc file if the username was provided by it.
  2. The --auth / -a cli option.
  3. The HATCH_INDEX_AUTH environment variable.
  4. The repos tables.
  5. A variety of OS-level credentials services backed by keyring.
  6. The input to an interactive prompt.

対話的に提供されたクレデンシャルが使用された場合、ユーザ名はHatch's cacheに保存され、パスワードは利用可能なkeyringにバックアップされたクレデンシャルストアに保存されまる。

PyPIへの自動リリースには、"Trusted Publishing" with OIDC(例:PyPAのPyPI-publishGitHub Action)またはプロジェクトごとのAPI tokensを使用することをお勧めする。