scylla-ccm
scylla-ccm copied to clipboard
node,scylla_node,cluster,scylla_cluster: Add type hints for nodes and clusters
- Add type hints for nodes and clusters to help debugging in dtest
- Fix linting / formatting issues
I will do a jenkins run to check for issues
I would recommend add some linter that can identify those, and configure it specific to check those files in CI.
I think ruff might be use to force adding type notation
or mypy --disallow-untyped-functions
I would recommend add some linter that can identify those, and configure it specific to check those files in CI.
I think ruff might be use to force adding type notation
or
mypy--disallow-untyped-functions
Those tools check all function parameters. For example, with ruff I get that there are about 3000 untyped parameters or function returns. I just added hints where nodes and clusters were involved, so it's easier for the editor to navigate trough their methods.
I will do a jenkins run to check for issues
https://jenkins.scylladb.com/view/master/job/scylla-master/job/byo/job/dtest-byo/564/ Ran without issues
https://github.com/scylladb/scylla-ccm/commit/df0a17a748a30e5fbd478290a734159b42f42535 rebased to solve conflicts
My only issue is that
typing.*are deprecated since 3.9, because now you can use inbuilt types for typing instead, e.g.test: list[str] = []See https://docs.python.org/3/library/typing.html#aliases-to-types-in-collections
Not sure whaat is our minimal working version, but 3.9 seems old & stable enough to do it the new way. @fruch WDYT?
The minimum is 3.8, we need to support the same versions as the python-driver does, cause ccm is used in it's testing
The typing.* isn't yet deprecated AFAIK, linters are suggesting not to use it.