-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
V3: type hints for operations #1082
V3: type hints for operations #1082
Conversation
Looks like some check are broken :( |
@stone-w4tch3r thank you so much for working on this! At a quick glance it looks fantastic, time is in extremely short supply right now I won’t be able to properly review till next weekend unfortunately, just a heads up! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK that week turned into a month, my apologies @stone-w4tch3r. PR looks great, HUGE thank you for working on this!
I think the failures are mostly missing Optional
s since mypy switched to disallowing implicit optional kwargs. Looks like there's a tool to automatically fix this.
I can clean those up and get that working with the tests, all the types look good 👍
@@ -25,16 +39,19 @@ def boolean(bool_name, value, persistent=False): | |||
selinux.boolean( | |||
name='Allow Apache to connect to LDAP server', | |||
'httpd_can_network_connect', | |||
'on', | |||
Boolean.ON, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boolean.ON, | |
selinux.Boolean.ON, |
@@ -127,12 +144,15 @@ def port(protocol, port_num, se_type=None, present=True): | |||
|
|||
selinux.port( | |||
name='Allow Apache to provide service on port 2222', | |||
'tcp', | |||
Protocol.TCP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Protocol.TCP, | |
selinux.Protocol.TCP, |
5e1f67d
to
22ade75
Compare
Rebased ontop of v3, hoping to get remaining mypy errors cleaned up this week. |
22ade75
to
d39b068
Compare
# Conflicts: # pyinfra/facts/util/packaging.py # pyinfra/operations/apt.py
# Conflicts: # pyinfra/operations/dnf.py # pyinfra/operations/util/packaging.py # pyinfra/operations/yum.py
# Conflicts: # pyinfra/operations/files.py # pyinfra/operations/util/files.py
# Conflicts: # pyinfra/operations/gem.py # pyinfra/operations/git.py
Mostly just adding `| None` to all the optional operation arguments.
0f14469
to
5b84a5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got there in the end! Massive thank you @stone-w4tch3r for doing the majority of the work here, truly a fantastic achievement to land this in v3!
Type hints for all operations, V3 version