PyInfra 3.8.0 Is Out
PyInfra 3.8.0, the latest release of the Python-based infrastructure automation framework, is now available. The update brings significant performance improvements through better parallelization of SSH connections and optimized task queue management, along with a revamped connection pooling system. The release also adds support for Windows and macOS platforms, and the project has switched to full semantic versioning (semver) starting with this 3.8.0 release. ## Core improvements The core API has been decoupled from Click by introducing pluggable output functions, making PyInfra more flexible for integration into different workflows. A notable security fix addresses command injection by expanding quoting of user inputs across connectors, operations, and utility functions. The `FunctionCommand` now supports timeouts, and a new `config.INHERIT_ENV` option allows passing local process environment variables to all operations. ## New facts and operations This release adds a substantial number of new facts and operations: - **Facts**: `Ports` (listening ports), `AuthorizedKeys`, `GpgKeyrings`, `server.Processes`, Docker version/container/image/network details, and `requires_command` guard sentinel with `check_preconditions()` hook. - **Operations**: `files.unarchive`, `files.download` with bandwidth capping via `limit_rate`, `server.kill`, `gpg.*` operations, Docker login/logout, Docker compose, Docker build, and `apt.packages` with a purge option. - **Git**: `git.repo` now supports the `depth` parameter for shallow clones. - **Mount**: Fixed detection of already-mounted devices in `server.mount`. - **SELinux**: Fixed `selinux.port` operation to find existing labels when the `sepolicy` command is missing. - **Systemd**: User-mode systemd facts no longer fail if the user manager is unavailable. - **Crontab**: Full `crontab(5)` environment variable syntax is now matched. - **ZFS**: Returns an empty dict if `zfs`/`zpool` commands are not available. - **Apt**: Modernized `apt.key` to replace the deprecated `apt-key` command, and added deb822 format support for `AptSources`. ## Connector and platform updates SSH connectors now properly parse SSH config file comments and honor `ConnectTimeout` through `ProxyJump`. The `IdentityAgent` config directive is now supported. For macOS and Python 3.13 compatibility, connectors use `gevent.subprocess` in utilities. Askpass generation errors are now shown to the user. ## Documentation
