Add linting for python code to CI/CD
Linting the python code (at least on syntaxerrors) prevents wasting credits on the compile and test steps in the pipeline for code that is broken. There is already a flake8 hook in the pre-commit hooks. This issue probably depends on !184 (merged) being merged first.
Could possibly be interesting to try out ruff, since it is the much faster new kid on the block (already used in scipy and pandas).