venvの--upgrade-depsオプション
https://docs.python.org/ja/3/library/venv.html#creating-virtual-environments
バージョン 3.9 で変更: pip と setuptools を PyPI での最新版に更新するには、--upgrade-deps オプションを追加してください。
『Python実践レシピ』で知った
#Python_venv
どんな経緯で入ったのだろう?
bpo-34556: Add --upgrade-deps to venv module #13100
https://bugs.python.org/issue34556
I'd like to propose add a --upgrade to venv module to automatically update pip and potentially setuptools if supplied. This will allow ensuring you have the latest and greatest of these core components. (2018/08)
This will allow me to skip my next command that I usually always do
Rather than importing or forking, I would expect this could just be done by invoking the venv's pip as a subprocess.
なお公式ドキュメントによると
バージョン 3.12 で変更: setuptools is no longer a core venv dependency.
https://github.com/python/cpython/pull/101039/files#diff-bcc6e36b2a636da9443a637b6c16d09c90225eedbf058cdaba308b8f963c859f
This PR removes the bundled setuptools wheel from ensurepip, and stops installing setuptools in environments created by venv.
Remove bundled setuptools #95299
詳しくは https://github.com/pypa/pip/issues/8102#issuecomment-1195566597