Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type hints for parameters and return #189

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

linup2011
Copy link
Contributor

I've run following tests with the patch:
./do.sh run test-scenarios/ovn-20.yml ovn-20
./do.sh run test-scenarios/ovn-low-scale.yml ovn-low-scale
./do.sh run test-scenarios/ovn-low-scale-ic.yml ovn-low-scale-ic

@linup2011 linup2011 force-pushed the jishi_typing branch 5 times, most recently from 805648d to aa5bbd5 Compare November 13, 2023 09:09
@dceara
Copy link
Collaborator

dceara commented Dec 5, 2023

@putnopvut @LorenzoBianconi @numansiddique what do you think of this change?

@numansiddique
Copy link
Collaborator

This PR made me learn what type hints are.

I've no objections to it. If this PR is accepted, I'd suggest make it a norm (or must) for new PRs to follow type hinting.
If it is too much of an ask for other contributors then perhaps its better to drop this PR.

Thanks

@dceara
Copy link
Collaborator

dceara commented Dec 6, 2023

This PR made me learn what type hints are.

I've no objections to it. If this PR is accepted, I'd suggest make it a norm (or must) for new PRs to follow type hinting. If it is too much of an ask for other contributors then perhaps its better to drop this PR.

Thanks

Good point, there actually are ways to enforce this. One way is to run mypy .. as a GitHub action check on new PRs.

def read_physical_deployment(deployment, global_cfg):
def read_physical_deployment(
deployment: str, global_cfg: GlobalCfg
) -> Tuple[PhysicalNode, List[PhysicalNode]]:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually returns Tuple[List[PhysicalNode], List[PhysicalNode]].

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@almusil
Copy link
Contributor

almusil commented Dec 11, 2023

This PR made me learn what type hints are.
I've no objections to it. If this PR is accepted, I'd suggest make it a norm (or must) for new PRs to follow type hinting. If it is too much of an ask for other contributors then perhaps its better to drop this PR.
Thanks

Good point, there actually are ways to enforce this. One way is to run mypy .. as a GitHub action check on new PRs.

It makes sense, however if we want to check those rules it should be part of the PR so there is no chance to "break" in the meantime.

@dceara
Copy link
Collaborator

dceara commented Jan 5, 2024

This PR made me learn what type hints are.
I've no objections to it. If this PR is accepted, I'd suggest make it a norm (or must) for new PRs to follow type hinting. If it is too much of an ask for other contributors then perhaps its better to drop this PR.
Thanks

Good point, there actually are ways to enforce this. One way is to run mypy .. as a GitHub action check on new PRs.

It makes sense, however if we want to check those rules it should be part of the PR so there is no chance to "break" in the meantime.

Sure, that's the ideal way. However, I think it's a pity to delay this PR for that. I opened an issue to track running and enforcing rules with mypy on new PRs: #192

@dceara dceara merged commit 482a928 into ovn-org:main Jan 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants