背景
trusted-host が必要になった状況で、uv の場合どうなるん?ってのを調べた結論
結論:allow-insecure-host を使う
trusted-host も一応動く
uv pip install pypi --trusted-host pypi.org
のようにしても alias なのか動くけど、project.toml における設定は反応しないので、以下とする
allow-insecure-host
[tool.uv]
allow-insecure-host = ["example.com"]
公式は以下
truste-host は非対応オプションだよって話は以下
ちなみに、toml の [tool.uv] で使える設定は以下
[tool.uv]
python = "",
system = "",
break-system-packages = "",
target = "",
prefix = "",
index-url = "",
extra-index-url = "",
no-index = "",
find-links = "",
index-strategy = "",
keyring-provider = "",
allow-insecure-host = "",
no-build = "",
no-binary = "",
only-binary = "",
no-build-isolation = "",
no-build-isolation-package = "",
strict = "",
extra = "",
all-extras = "",
no-deps = "",
allow-empty-requirements = "",
resolution = "",
prerelease = "",
output-file = "",
no-strip-extras = "",
no-strip-markers = "",
no-annotate = "",
no-header = "",
custom-compile-command = "",
generate-hashes = "",
config-settings = "",
python-version = "",
python-platform = "",
universal = "",
exclude-newer = "",
no-emit-package = "",
emit-index-url = "",
emit-find-links = "",
emit-build-options = "",
emit-marker-expression = "",
emit-index-annotation = "",
annotation-style = "",
link-mode = "",
compile-bytecode = "",
require-hashes = "",
verify-hashes = "",
no-sources = "",
upgrade = "",
upgrade-package = "",
reinstall = "",
reinstall-package = "",
あとがき
ちゃんとしたい場合は以下
uv 便利ですね。
一年ぐらい前は、python なんてって言ってたのに、やっぱり使うとなったら・・ね :p