How do I update Python to 3.12?

I managed to get the dependencies working, so that you can use python 3.12.0 without any downsides fairly easily.
First, you can set the nix channel in .replit to be "unstable" to get 3.12.0 instead of 3.12.0b2 (optional but nice).
Now, make sure that you do not have the python312 System dependency yet, it will be installed last.
Open .replit file and change the modules string to "python-3.11:v16-20231229-5b1e996" .
At the end of the file, add:

PYTHONPATH = "$REPL_HOME/.pythonlibs/lib/python3.11/site-packages:$PYTHONPATH"

In your pyproject.toml file, change the python versions to ">=3.11.0,<4.0". Then delete .pythonlibs folder. Then type kill 1 in the Shell, and then poetry update .

It should install your packages without error. Now, add the python312 system dependency, and type kill 1 in the Shell again.