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

deployment.py: more mypy type checking #1236

Merged

Conversation

AmineChikhaoui
Copy link
Member

No description provided.

@@ -1272,31 +1323,34 @@ def worker(r):
)

if is_machine(r):
# NOTE: unfortunate mypy doesn't check that
# is_machine calls an isinstance() function
m = cast(nixops.backends.MachineState, r)
Copy link
Member

Choose a reason for hiding this comment

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

In other places, I replaced is_machine() calls with an instanceof of my own. Maybe ugly ... I wonder if there is a way we could fix this without cast?

nixops/deployment.py Outdated Show resolved Hide resolved
@AmineChikhaoui AmineChikhaoui force-pushed the deployment_py_typing branch 2 times, most recently from d88b0cc to 6806eb1 Compare March 1, 2020 21:00
@grahamc grahamc merged commit c44f056 into NixOS:start-with-types Mar 1, 2020
@grahamc grahamc added this to the 2.0 milestone Apr 20, 2020
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.

None yet

2 participants