Leaving that thought aside for the moment, let's jump in.
For autoformatting Python source code, my autoformatter of choice is Black, with the only modification of setting the maximum width to 80 instead of whatever number they set.
My text editor of choice is vim, which is Vi Improved.
My POSIX-y environment of choice on Windows is Cygwin.
The problem is that Cygwin has been odiously slow in updating packages. Perhaps it is due to a lack of maintainers, or a maybe a lack of interest ever since Windows Subsystem for Linux (WSL) became a more reliable thing.
For instance, the system-Python version is more or less stuck at 3.9, which resulted in my Python on Cygwin patches list to bring in later versions of Python 3 to allow more modern tooling to run. This remains true even when the Cygwin installer is now attempting to auto-install Python 3.12.
Moving backwards, due to the end-of-life of Python 3.9, Black has moved on too, which made my favourite text editor in Cygwin (i.e. vim) flip out when it tries to run Black.
There are several steps to the fix.
- Use only the vim scripts available for 25.11.0;
- Ensure that pip is around 25.3;
- Update .vimrc to have the line let g:black_use_virtualenv=0;
- Do a pip install black using that version and then run Black in vim for the first time.
The reasons are multi-fold. vim for Cygwin is compiled with the Python 3.9 ABI in place, which means that changing the default Python 3 environment leads to nothing but crashes. pip beyond version 26 drops support for Python 3.9 too, and that crash is even more ridiculous---dataclass suddenly appears with the slots named argument, which doesn't exist in Python 3.9.
So that's about it.
What a bloody mess...
No comments:
Post a Comment