Update CI pipeline + spruce up package extras + general linting/typing fixes
This makes a few changes to the CI pipeline:
- Change from "latest" components and pin to version 1.x to avoid issues with major API changes.
- Add type checking and dependency scanning components
- Pick up extra linting packages from the new 'lint' extra.
- Pick up extra docs packages from the new 'docs' extra rather than the requirements file.
In order to support this, I've split up what was only in the 'dev' extra into 'test', 'doc' and 'lint' that the 'dev' extra inherits from. This is so the CI components only install the packages they need. I've also added a couple of flake8 plugins I've used in other packages that catch some common issues without getting in your way. I've also moved graphviz to a separate 'visualize' package that the test package inherits from since it's used beyond testing.
Beyond that, addressed various typing issues and linted the codebase to get the CI pipeline to pass:
- Switch line length back to 88 (black's default)
- Run black over sgn (and now the tests and examples)
- Address a few linter issues beyond basic code formatting
Some of the typing issues are due to the dataclasses issues with default arguments which is a bit obnoxious. Debating whether it's worth the trouble to keep using dataclasses at this point with our complex inheritance tree if we're not switching to python 3.10+ in the near future.