Skip to content

Commit

Permalink
Merge branch '2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzadar authored Nov 26, 2023
2 parents 9f474cd + 9256e6a commit 2095fb2
Show file tree
Hide file tree
Showing 46 changed files with 744 additions and 242 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# v2.8

Added:

+ Add `device` and `fs_type` arguments to `server.mount` operation (@chriskingio)
+ Add `args` argument to `server.script_template` operation (@chriskingio)

Fixed:

+ Support FreeBSD in `server.user` & `server.group` operations (@wowi42)
+ Add missing `py.typed` flag to package
+ Fix lookup of systemd units containing `.` in the name (@cawo-odoo)
+ Strip newlines off public keys read from disk (@sysadmin75)
+ Properly escape database names in `mysql.database` operation (@tissieres)

# v2.7

Been a while since a release, so there's a bunch of great stuff in thise one!
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include README.md LICENSE.md CHANGELOG.md
include README.md LICENSE.md CHANGELOG.md pyinfra/py.typed
27 changes: 12 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

<p align="center">
<em>pyinfra automates infrastructure super fast at massive scale<br />ad-hoc command execution, service deployment, configuration management and more</em>
<em>pyinfra automates infrastructure using Python. It’s fast and scales from one server to thousands. Great for ad-hoc command execution, service deployment, configuration management and more.</em>
</p>

---
Expand All @@ -19,9 +19,8 @@
</p>

<p align="center">
Chat (both bridged) &rArr;
<a href="https://matrix.to/#/#pyinfra:matrix.org"><strong><code>#pyinfra</code> on Matrix</strong></a> &bull;
<a href="https://discord.gg/w3XxuKw"><strong>Discord</strong></a>
Chat &rArr;
<a href="https://matrix.to/#/#pyinfra:matrix.org"><strong><code>#pyinfra</code> on Matrix</strong></a>
</p>

---
Expand All @@ -30,21 +29,19 @@ Why pyinfra? Design features include:

+ 🚀 **Super fast** execution over thousands of hosts with predictable performance.
+ 🚨 **Instant debugging** with realtime stdin/stdout/stderr output (`-vvv`).
+ 🔄 **Idempotent operations** that enable diffs and `--dry` runs before executing any changes.
+ 📦 **Extendable** with _any_ Python package as configured & written in standard Python.
+ 💻 **Agentless execution** against SSH/Docker/subprocess/WinRM hosts.
+ 🔌 **Integrated** with Docker, Terraform, Vagrant/Mech & Ansible out of the box.

When you run pyinfra you'll see something like ([non animated version](https://pyinfra.com/static/example_deploy.png)):
+ 🔄 **Idempotent operations** that enable diffs and dry runs before making changes.
+ 📦 **Extendable** with the entire Python package ecosystem.
+ 💻 **Agentless execution** against anything with shell access.
+ 🔌 **Integrated** with connectors for Docker, Terraform, Vagrant and more.

<img width="100%" src="https://pyinfra.com/static/example_deploy.gif" />

## Quickstart

Install pyinfra with [`pipx`](https://pipxproject.github.io/pipx/) (recommended) or `pip`:
Install pyinfra with `pip`:

```
pipx install pyinfra
pip install pyinfra
```

Now you can execute commands on hosts via SSH:
Expand All @@ -53,7 +50,7 @@ Now you can execute commands on hosts via SSH:
pyinfra my-server.net exec -- echo "hello world"
```

Or execute in Docker, on the local machine, and other [connectors](https://docs.pyinfra.com/page/connectors.html):
Or target Docker containers, the local machine, and other [connectors](https://docs.pyinfra.com/page/connectors.html):

```sh
pyinfra @docker/ubuntu exec -- echo "Hello world"
Expand Down Expand Up @@ -103,8 +100,8 @@ See the more detailed [getting started](https://docs.pyinfra.com/page/getting-st
<p align="center">
<a href="https://pypi.python.org/pypi/pyinfra"><img alt="PyPI version" src="https://img.shields.io/pypi/v/pyinfra?color=blue"></a>
<a href="https://pepy.tech/project/pyinfra"><img alt="PyPi downloads" src="https://pepy.tech/badge/pyinfra"></a>
<a href="https://docs.pyinfra.com"><img alt="Docs status" src="https://img.shields.io/github/workflow/status/Fizzadar/pyinfra/Generate%20&amp;%20Deploy%20Docs/master?label=docs"></a>
<a href="https://github.com/Fizzadar/pyinfra/actions?query=workflow%3A%22Execute+tests%22"><img alt="Execute tests status" src="https://img.shields.io/github/workflow/status/Fizzadar/pyinfra/Execute%20tests/master?label=tests"></a>
<a href="https://docs.pyinfra.com"><img alt="Docs status" src="https://img.shields.io/github/actions/workflow/status/Fizzadar/pyinfra/docs.yml?branch=2.x"></a>
<a href="https://github.com/Fizzadar/pyinfra/actions?query=workflow%3A%22Execute+tests%22"><img alt="Execute tests status" src="https://img.shields.io/github/actions/workflow/status/Fizzadar/pyinfra/test.yml?branch=2.x"></a>
<a href="https://codecov.io/github/Fizzadar/pyinfra"><img alt="Codecov Coverage" src="https://img.shields.io/codecov/c/gh/Fizzadar/pyinfra"></a>
<a href="https://github.com/Fizzadar/pyinfra/blob/2.x/LICENSE.md"><img alt="MIT Licensed" src="https://img.shields.io/pypi/l/pyinfra"></a>
</p>
2 changes: 1 addition & 1 deletion docs/inventory-data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Inventory & Data

A ``pyinfra`` inventory provides hosts, groups and data. Host are the targets ``pyinfra`` will execute commands or state changes on (think a SSH daemon on a server, a Docker container or the local machine). Hosts can be attached to groups, and data can then be assigned to both the groups of hosts and individual hosts.

By default ``pyinfra`` assumes hosts are SSH servers and the name of the host is used as the SSH hostname. Prefixing the name of the host with ``@<connector-name>`` is used to activate alternative connectors. See: :doc:`connectors`.
By default ``pyinfra`` assumes hosts are SSH servers and the name of the host is used as the SSH hostname. Prefixing the name of the host with ``@<connector-name>/`` is used to activate alternative connectors. See: :doc:`connectors`.

Inventory Files
---------------
Expand Down
12 changes: 3 additions & 9 deletions pyinfra/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,12 @@ class ConfigDefaults:
def check_pyinfra_version(version: str):
if not version:
return

running_version = parse_version(__version__)
required_versions = Requirement.parse(
"pyinfra{0}".format(version),
)
required_versions = Requirement.parse("pyinfra{0}".format(version))

if running_version not in required_versions:
if not required_versions.specifier.contains(running_version):
raise PyinfraError(
("pyinfra version requirement not met " "(requires {0}, running {1})").format(
version,
__version__,
),
f"pyinfra version requirement not met (requires {version}, running {__version__})"
)


Expand Down
Loading

0 comments on commit 2095fb2

Please sign in to comment.