0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

python: uv で trusted-host は、allow-insecure-host

Last updated at Posted at 2024-09-15

背景

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?