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
base: 3.x
Are you sure you want to change the base?
V3: type hints for operations #1082
Conversation
# Conflicts: # scripts/build_public_docs.sh
Especially with lots of host going through a jump-host, there is a chance that the jump-host is overloaded. Instead of simply failing, we can retry and back-off with some random interval to avoid the stampede
This prevents gevent dumping out the exception traceback so pyinfra can handle it later (and show it too!).
This correctly fails hosts when they fail executing a nested operation, just like unnested operations.
# Conflicts: # CHANGELOG.md # pyinfra/api/arguments.py # pyinfra/api/operations.py # pyinfra/api/state.py # pyinfra/connectors/ssh.py # pyinfra/connectors/terraform.py # pyinfra/facts/util/packaging.py # pyinfra/operations/apt.py # pyinfra/operations/brew.py # pyinfra/operations/cargo.py # pyinfra/operations/choco.py # pyinfra/operations/dnf.py # pyinfra/operations/files.py # pyinfra/operations/gem.py # pyinfra/operations/git.py # pyinfra/operations/npm.py # pyinfra/operations/pkg.py # pyinfra/operations/postgresql.py # pyinfra/operations/python.py # pyinfra/operations/selinux.py # pyinfra/operations/server.py # pyinfra/operations/ssh.py # pyinfra/operations/upstart.py # pyinfra/operations/util/files.py # pyinfra/operations/util/packaging.py # pyinfra/operations/util/service.py # pyinfra/operations/vzctl.py # pyinfra/operations/windows.py # pyinfra/operations/windows_files.py # pyinfra/operations/yum.py
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, |
Type hints for all operations, V3 version