typeshed
typeshed copied to clipboard
Rewriting proto scripts in Python
I've hinted at it previously, I am now officially suggesting we rewrite the shell scripts found in scripts in Python instead.
- They only worked* on Linux (now MacOS)
- Attempting to make them work on MacOS, @sobolevn accidentally broke the sed command in https://github.com/python/typeshed/pull/12330
- since the difference is in quote, I don't see a clean way to reconcile the commands by, for example, storing the command in a variable.
- We require additional tools to be installed that are not in our dev requirements (wget on mac, unzip on ubuntu, wsl on Windows)
- We could speed up the runs by using UV as we could assume deps in
requirements-tests.txthave been installed (if we even decide to still create a different venv, rather than consolidating mypy-protobuf versions) - It's extremely slow on Windows WSL2 because it just has very slow disk operations across the VM boundary (https://github.com/microsoft/WSL/issues/4197#issuecomment-604592340 & https://learn.microsoft.com/en-us/windows/wsl/compare-versions#comparing-features)
- Our existing tooling could do some basic checks on the scripts.
I am opening this issue to share my intention, but I doubt there'd be much opposition ^^" If anyone would like to take this, let me know, otherwise I'll probably do it sometimes within the next week.