diff --git a/CHANGELOG.md b/CHANGELOG.md index 653bbc5de..4a8806266 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v3.0.beta3 +# v3.0.beta4 Welcome to pyinfra v3! This version is the biggest overhaul of pyinfra since it was created back in 2015. Most v2 deployment code should be automatically compatible, but as always be aware. Major changes: diff --git a/docs/conf.py b/docs/conf.py index 01a38b5e6..b47dcabad 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,8 +42,8 @@ "docsearch_index_name": "pyinfra", "plausible_domain": "docs.pyinfra.com", "plausible_stats_domain": "stats.oxygem.com", - "doc_versions": ["2.x", "1.x", "0.x", "latest"], - "primary_doc_version": "2.x", + "doc_versions": ["3.x", "2.x", "1.x", "0.x", "latest"], + "primary_doc_version": "3.x", } templates_path = ["templates"] diff --git a/pyinfra/connectors/ssh.py b/pyinfra/connectors/ssh.py index 50a3992bc..bda858ea1 100644 --- a/pyinfra/connectors/ssh.py +++ b/pyinfra/connectors/ssh.py @@ -122,14 +122,18 @@ class SSHConnector(BaseConnector): .. code:: python hosts = ( - [ - "my-host-1.net", - "my-host-2.net", - ], - { - "ssh_username": "ssh-user", - }, + ["my-host-1.net", "my-host-2.net"], + {"ssh_username": "ssh-user"}, ) + + Multiple hosts with different SSH usernames: + + .. code:: python + + hosts = [ + ("my-host-1.net", {"ssh_username": "ssh-user"}), + ("my-host-2.net", {"ssh_username": "other-user"}), + ] """ handles_execution = True diff --git a/scripts/generate_connectors_docs.py b/scripts/generate_connectors_docs.py index 243178c79..48018a1dd 100644 --- a/scripts/generate_connectors_docs.py +++ b/scripts/generate_connectors_docs.py @@ -30,24 +30,31 @@ def build_connectors_docs(): lines.append(doc) lines.append("") - data_title = "Usage" - lines.append(data_title) - lines.append(title_line("~", data_title)) - lines.append("") - - names_argument_key = getfullargspec(connector.make_names_data).args[0] - if names_argument_key == "_": - names_argument_key = "" + examples_doc = getattr(connector, "__examples_doc__", None) + if examples_doc: + lines.append("Examples") + lines.append(title_line("~", "Examples")) + lines.append("") + lines.append(cleandoc(examples_doc)) else: - names_argument_key = f"/{names_argument_key}" - lines.append( - f""" -.. code:: shell - - pyinfra @{connector_name}{names_argument_key} ... -""".strip(), - ) - lines.append("") + data_title = "Usage" + lines.append(data_title) + lines.append(title_line("~", data_title)) + lines.append("") + + names_argument_key = getfullargspec(connector.make_names_data).args[0] + if names_argument_key == "_": + names_argument_key = "" + else: + names_argument_key = f"/{names_argument_key}" + lines.append( + f""" + .. code:: shell + + pyinfra @{connector_name}{names_argument_key} ... + """.strip(), + ) + lines.append("") data_key_lines = [] @@ -90,13 +97,6 @@ def build_connectors_docs(): ) lines.append("") - examples_doc = getattr(connector, "__examples_doc__", None) - if examples_doc: - lines.append("Examples") - lines.append(title_line("~", "Examples")) - lines.append("") - lines.append(cleandoc(examples_doc)) - module_filename = path.join(docs_dir, "connectors", f"{connector_name}.rst") print("--> Writing {0}".format(module_filename))