pyenv local時の非推奨警告の消し方
pyenv実行時に突如警告が出てきたのでその消し方
事象・実行したコマンド
$ pyenv local 3.12.11
発生したエラー/警告
mise WARN deprecated [idiomatic_version_file_enable_tools]:
Idiomatic version files like ~/python/.python-version are currently enabled by default. However, this will change in mise 2025.10.0 to instead default to disabled.
You can remove this warning by explicitly enabling idiomatic version files for python with:
mise settings add idiomatic_version_file_enable_tools python
You can disable idiomatic version files with:
mise settings add idiomatic_version_file_enable_tools "[]"
See https://github.com/jdx/mise/discussions/4345 for more information.
日本語訳
mise WARN 非推奨 [idiomatic_version_file_enable_tools]
現在、~/python/.python-version のような「慣用的なバージョンファイル」は、デフォルトで有効になっています。しかし、mise 2025.10.0 からは、これがデフォルトで無効に変更されます。
この警告を非表示にするには、Python 用の慣用的なバージョンファイルを明示的に有効にする必要があります。以下のコマンドを実行してください:
mise settings add idiomatic_version_file_enable_tools python
あるいは、慣用的なバージョンファイルを無効にしたい場合は、以下のコマンドを実行してください:
mise settings add idiomatic_version_file_enable_tools "[]"
詳細については、https://github.com/jdx/mise/discussions/4345 を参照してください。
警告の消し方
.python-version
ファイルを自動認識で使いたい場合は、警告文の指示通りに前者のコマンドを実行する
$ mise settings add idiomatic_version_file_enable_tools python
原因
miseは、Pythonを含む多くの言語のver管理を行うツールらしい。
筆者はpyenvでver管理していたつもりが、実際はmise & pyenvの二重ver管理してたっぽい。
いつから入ってたのか🤔
bashrcを確認したところ、以下のようになっていた。
正しい記事タイトルとしては、「bashrc読み込み時のmise非推奨警告の消し方」かも
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
. "$HOME/.local/bin/env"
eval "$(~/.local/bin/mise activate bash)"
感想
Linuxのパッケージ・ツールって気がついたら増えてるので管理方法を教えてください
Discussion