confluentinc / ducktape

System integration and performance tests
16 stars 98 forks source link

Add typing to ducktape #413

Open imcdo opened 5 months ago

imcdo commented 5 months ago
  1. Start to type objects in ducktape and give it annotations and make it a bit easier to work with.
  2. Update Paramiko
  3. Use ruff for formatting and style checking.
cla-assistant[bot] commented 5 months ago

CLA assistant check
All committers have signed the CLA.

cla-assistant[bot] commented 5 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

dotnwat commented 2 months ago

@imcdo

Very supportive of adding type annotations and official formatting. Are you planning to merge this PR?

Use ruff for formatting and style checking.

My understanding is that ruff and black are compatible, right? Is the tree large enough to require the faster version of ruff? I was able to format the entire ducktape tree in 0.5s.

imcdo commented 2 months ago

@dotnwat id be happy to merge it, though i need a review and will need a sanity check. Black rules are compatible with ruff

dotnwat commented 2 months ago

@imcdo perhaps we could merge the ruff formatting in a PR (or a dedicated commit) separate from the type annotations? not having the reformatting noise would make reviewing the type annotations much easier. even having github ignore whitespace produces an enormous diff.

imcdo commented 2 months ago

@dotnwat that would basicly require redoing the work and i dont have any bandwith right now, though I invite anyone who is interested in doing this.

dotnwat commented 2 months ago

@imcdo even something simple would be helpful:

pip install ruff==0.4.10
git checkout ian/types~
git checkout ian/types -- ruff.toml
ruff format --config ruff.toml docs .
git commit -a -m "format"
git diff ..ian/types | patch -p1
git add -A
git commit -a -m “other”
git diff ian/types

will produce two commits. the first is 1500+ LOC that can be ignored as reformatting. the second is half the size of this PR, and is much easier to inspect.

confluent-cla-assistant[bot] commented 2 months ago

:tada: All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.