[[Python 3.12]]がリリースされたのでついでに。
```console
# python3は3.12
poetry env use python
poetry install
```
## [[aiohttp]]のインストールでエラーになる
```error
ChefBuildError
Backend subprocess exited when trying to invoke build_wheel
*********************
* Accelerated build *
*********************
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-312
creating build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\abc.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\base_protocol.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\client.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\client_exceptions.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\client_proto.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\client_reqrep.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\client_ws.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\connector.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\cookiejar.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\formdata.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\hdrs.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\helpers.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\http.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\http_exceptions.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\http_parser.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\http_websocket.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\http_writer.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\locks.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\log.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\multipart.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\payload.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\payload_streamer.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\pytest_plugin.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\resolver.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\streams.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\tcp_helpers.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\test_utils.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\tracing.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\typedefs.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_app.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_exceptions.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_fileresponse.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_log.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_middlewares.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_protocol.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_request.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_response.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_routedef.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_runner.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_server.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_urldispatcher.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\web_ws.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\worker.py -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\__init__.py -> build\lib.win-amd64-cpython-312\aiohttp
running egg_info
writing aiohttp.egg-info\PKG-INFO
writing dependency_links to aiohttp.egg-info\dependency_links.txt
writing requirements to aiohttp.egg-info\requires.txt
writing top-level names to aiohttp.egg-info\top_level.txt
reading manifest file 'aiohttp.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'aiohttp' anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.lib' found anywhere in distribution
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.a' found anywhere in distribution
warning: no previously-included files matching '*.obj' found anywhere in distribution
warning: no previously-included files found matching 'aiohttp\*.html'
no previously-included directories found matching 'docs\_build'
adding license file 'LICENSE.txt'
writing manifest file 'aiohttp.egg-info\SOURCES.txt'
copying aiohttp\_cparser.pxd -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_find_header.pxd -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_headers.pxi -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_helpers.pyi -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_helpers.pyx -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_http_parser.pyx -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_http_writer.pyx -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\_websocket.pyx -> build\lib.win-amd64-cpython-312\aiohttp
copying aiohttp\py.typed -> build\lib.win-amd64-cpython-312\aiohttp
creating build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_cparser.pxd.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_find_header.pxd.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_helpers.pyi.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_helpers.pyx.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_http_parser.pyx.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_http_writer.pyx.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\_websocket.pyx.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
copying aiohttp\.hash\hdrs.py.hash -> build\lib.win-amd64-cpython-312\aiohttp\.hash
running build_ext
building 'aiohttp._websocket' extension
creating build\temp.win-amd64-cpython-312
creating build\temp.win-amd64-cpython-312\Release
creating build\temp.win-amd64-cpython-312\Release\aiohttp
"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\syoum\AppData\Local\Temp\tmp5z4mbqnd\.venv\include -IC:\Users\syoum\scoop\apps\python\3.12.0\include -IC:\Users\syoum\scoop\apps\python\3.12.0\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.32.31326\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\cppwinrt" /Tcaiohttp/_websocket.c /Fobuild\temp.win-amd64-cpython-312\Release\aiohttp/_websocket.obj
_websocket.c
aiohttp/_websocket.c(1475): warning C4996: 'Py_OptimizeFlag': deprecated in 3.12
aiohttp/_websocket.c(3042): error C2039: 'ob_digit': '_longobject' のメンバーではありません
C:\Users\syoum\scoop\apps\python\3.12.0\include\cpython/longintrepr.h(87): note: '_longobject' の宣言を確認してください
aiohttp/_websocket.c(3097): error C2039: 'ob_digit': '_longobject' のメンバーではありません
C:\Users\syoum\scoop\apps\python\3.12.0\include\cpython/longintrepr.h(87): note: '_longobject' の宣言を確認してください
aiohttp/_websocket.c(3238): error C2039: 'ob_digit': '_longobject' のメンバーではありません
C:\Users\syoum\scoop\apps\python\3.12.0\include\cpython/longintrepr.h(87): note: '_longobject' の宣言を確認してください
aiohttp/_websocket.c(3293): error C2039: 'ob_digit': '_longobject' のメンバーではありません
C:\Users\syoum\scoop\apps\python\3.12.0\include\cpython/longintrepr.h(87): note: '_longobject' の宣言を確認してください
aiohttp/_websocket.c(3744): error C2039: 'ob_digit': '_longobject' のメンバーではありません
C:\Users\syoum\scoop\apps\python\3.12.0\include\cpython/longintrepr.h(87): note: '_longobject' の宣言を確認してください
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.32.31326\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
at ~\AppData\Roaming\pypoetry\venv\Lib\site-packages\poetry\installation\chef.py:147 in _prepare
143│
144│ error = ChefBuildError("\n\n".join(message_parts))
145│
146│ if error is not None:
→ 147│ raise error from None
148│
149│ return path
150│
151│ def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:
Note: This error originates from the build backend, and is likely not a problem with poetry but with aiohttp (3.8.6) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "aiohttp (==3.8.6)"'.
```
まだ対応中っぽい。
<div class="link-card">
<div class="link-card-header">
<img src="https://github.githubassets.com/favicons/favicon.svg" class="link-card-site-icon"/>
<span class="link-card-site-name">GitHub</span>
</div>
<div class="link-card-body">
<div class="link-card-content">
<div>
<p class="link-card-title">Python 3.12 can't build wheels for aiohttp · Issue #7739 · aio-libs/aiohttp</p>
</div>
<div class="link-card-description">
Describe the bug So, I have just upgraded to Python 3.12 and I tried to install aiohttp as usual (py...
</div>
</div>
<img src="https://opengraph.githubassets.com/46c3afc3e0198c3b6f2ebd36297a18e4cdbb772e8157b85de8d8873a2d557863/aio-libs/aiohttp/issues/7739" class="link-card-image" />
</div>
<a href="https://github.com/aio-libs/aiohttp/issues/7739"></a>
</div>
`3.9.0b`をインストールすればいけそう。[[aiohttp]]は[[Black]]しか依存してなさそうなので、それで手を打ってみる。[[pyproject.toml]]で[[Black]]の下に追加。
```toml
[tool.poetry.dev-dependencies]
black = {extras = ["d"], version = "^23.3.0"}
# https://github.com/aio-libs/aiohttp/issues/7739
aiohttp = "3.9.0b0"
```