HTTP credentialsHTTP認証情報
uv supports credentials over HTTP when querying package registries.uvは、パッケージレジストリをクエリする際にHTTP経由の認証情報をサポートします。
Authentication can come from the following sources, in order of precedence:認証は、優先順位の順に以下のソースから行うことができます:
- The URL, e.g.,
https://<user>:<password>@<hostname>/...URL、例:https://<user>:<password>@<hostname>/... - A netrc configuration filenetrc 設定ファイル
- The uv credentials storeuv credentials store
- A keyring provider (off by default)keyring provider(デフォルトではオフ)
Authentication may be used for hosts specified in the following contexts:認証は、以下のコンテキストで指定されたホストに対して使用される場合があります:
[index][index]index-urlindex-urlextra-index-urlextra-index-urlfind-linksfind-linkspackage @ https://...package @ https://...
netrc filesnetrcファイル
.netrc files are a long-standing plain text format
for storing credentials on a system..netrcファイルは、システム上の資格情報を保存するための長年のプレーンテキスト形式です。
Reading credentials from .netrc files is always enabled. The target file path will be loaded from
the NETRC environment variable if defined, falling back to ~/.netrc if not..netrcファイルから資格情報を読み取ることは常に有効です。ターゲットファイルパスは、定義されている場合はNETRC環境変数から読み込まれ、そうでない場合は~/.netrcにフォールバックします。
The uv credentials storeuv資格情報ストア
uv can read and write credentials from a store using the uv auth commands.uvは、uv authコマンドを使用してストアから資格情報を読み書きできます。
Credentials are stored in a plaintext file in uv's state directory, e.g.,
~/.local/share/uv/credentials/credentials.toml on Unix. This file is currently not intended to be
edited manually.資格情報は、uvの状態ディレクトリ内のプレーンテキストファイルに保存されます。例えば、Unixでは~/.local/share/uv/credentials/credentials.tomlです。このファイルは現在手動で編集することを意図していません。
Note注意
A secure, system native storage mechanism is in preview — it is still experimental and being actively developed. In the future, this will become the default storage mechanism.安全なシステムネイティブストレージメカニズムはプレビューにあります — これはまだ実験的で、積極的に開発中です。将来的には、これがデフォルトのストレージメカニズムになります。
When enabled, uv will use the secret storage mechanism native to your operating system. On macOS, it uses the Keychain Services. On Windows, it uses the Windows Credential Manager. On Linux, it uses the DBus-based Secret Service API.有効にすると、uvはオペレーティングシステムにネイティブな秘密ストレージメカニズムを使用します。macOSでは、Keychain Servicesを使用します。Windowsでは、Windows Credential Managerを使用します。Linuxでは、DBusベースのSecret Service APIを使用します。
Currently, uv only searches the native store for credentials it has added to the secret store — it will not retrieve credentials persisted by other applications.現在、uvは秘密ストアに追加した資格情報のためにネイティブストアのみを検索します — 他のアプリケーションによって永続化された資格情報を取得することはありません。
Set UV_PREVIEW_FEATURES=native-auth to use this storage mechanism.UV_PREVIEW_FEATURES=native-authを設定して、このストレージメカニズムを使用します。
Keyring providersキーレリングプロバイダー
A keyring provider is a concept from pip allowing retrieval of credentials from an interface
matching the popular keyring Python package.キーレリングプロバイダーは、pipの概念で、人気のあるkeyring Pythonパッケージに一致するインターフェースから資格情報を取得することを可能にします。
The "subprocess" keyring provider invokes the keyring command to fetch credentials. uv does not
support additional keyring provider types at this time."subprocess"キーレリングプロバイダーは、keyringコマンドを呼び出して資格情報を取得します。uvは現時点で追加のキーレリングプロバイダータイプをサポートしていません。
Set --keyring-provider subprocess, UV_KEYRING_PROVIDER=subprocess, or
tool.uv.keyring-provider = "subprocess" to use the provider.--keyring-provider subprocess、UV_KEYRING_PROVIDER=subprocess、またはtool.uv.keyring-provider = "subprocess"を設定してプロバイダーを使用します。
Persistence of credentials認証情報の永続性
If authentication is found for a single index URL or net location (scheme, host, and port), it will be cached for the duration of the command and used for other queries to that index or net location. Authentication is not cached across invocations of uv.単一のインデックスURLまたはネットロケーション(スキーム、ホスト、ポート)に対して認証が見つかった場合、それはコマンドの実行中にキャッシュされ、他のクエリでそのインデックスまたはネットロケーションに使用されます。認証はuvの呼び出し間でキャッシュされません。
When using uv add, uv will not persist index credentials to the pyproject.toml or uv.lock.
These files are often included in source control and distributions, so it is generally unsafe to
include credentials in them. However, uv will persist credentials for direct URLs, i.e.,
package @ https://username:password:example.com/foo.whl, as there is not currently a way to
otherwise provide those credentials.uv addを使用する場合、uvはpyproject.tomlやuv.lockにインデックス資格情報を永続化しません。これらのファイルはしばしばソース管理や配布に含まれるため、一般的に資格情報を含めることは安全ではありません。ただし、uvは直接URLの資格情報を永続化します。つまり、package @ https://username:password:example.com/foo.whlのように、現在のところ他の方法でこれらの資格情報を提供する方法がないためです。
If credentials were attached to an index URL during uv add, uv may fail to fetch dependencies from
indexes which require authentication on subsequent operations. See the
index authentication documentation for details on persistent
authentication for indexes.uv add中にインデックスURLに資格情報が添付されていた場合、uvはその後の操作で認証を必要とするインデックスから依存関係を取得できない可能性があります。インデックスの永続的な認証の詳細については、インデックス認証ドキュメントを参照してください。
Learn more詳細を学ぶ
See the index authentication documentation for details on authenticating index URLs.インデックスURLの認証に関する詳細については、インデックス認証ドキュメントを参照してください。
See the pip compatibility guide for details
on differences from pip.pip 互換性ガイドを参照してください。
pip との違いの詳細について。