Skip to content

Releases: pyinfra-dev/pyinfra

v3.8.0

04 May 12:28
Immutable release. Only release title and notes can be modified.
a35033c

Choose a tag to compare

Big release with a lot of fixes and improvements across the board! We're also switching to full semver (so .0 on the 3.8.0) for this release and others going forward. Thank you to all contributors!

Core:

  • api.command: fix make_formatted_string_command adding unwanted spaces between format args (#1610) (@wowi42)
  • api: decouple core API from click by introducing pluggable output functions (#1616) (@wowi42)

Operations/facts:

  • operations: expand quoting of user inputs to prevent command injection (#1576) (@wowi42)
  • facts.selinux.FileContext: handle missing SELinux context (#1581) (@wowi42)
  • facts.systemd: ensure that user-mode systemd facts do not fail if user manager is not available (#1604) (@martenlienen)
  • facts.apt.AptSources: add deb822 format support (#1465) (@maisim)
  • operations.files: expand diff output (#1552) (@gwelch-contegix)
  • facts.server: add Ports fact returning all listening ports (#1637) (@wowi42)
  • facts.choco: remove invalid shell_executable on ChocoPackages (#1598) (@wowi42)
  • operations.git.repo: add depth support (#1656) (@bsaussay)
  • operations.docker: add extra parameters (#1593) (@wowi42)
  • operations.selinux.port: fix a bug where the op would not find existing labels if sepolicy command was missing from the host (#1654) (@yacoob)
  • operations.server.reboot: survive dead SSH session during askpass cleanup (#1665) (@wowi42)
  • facts.docker: add version, container, image, network detail facts (#1668) (@wowi42)
  • facts.server: add AuthorizedKeys, make user_authorized_keys idempotent (#1670) (@wowi42)
  • facts.crontab: match full crontab(5) env var syntax (#1678) (@wowi42)
  • operations.files: add limit_rate to cap download bandwidth (#1681) (@wowi42)
  • operations.files: add files.unarchive (#1631) (@wowi42)
  • operations.docker: add support for custom command (#1625) (@EricDriussi)
  • facts.{yum,dnf,zypper}: add filename field to each repository entry (#1684) (@wowi42)
  • operations.server: dispatch BSD rc.d before sysvinit in server.service (#1685) (@wowi42)
  • operations.files.download: reconcile mode/user/group on existing files (#1687) (@wowi42)

Connectors:

  • connectors.ssh: fix parsing of SSH config file comments (#1574) (@wowi42)
  • connectors: use gevent.subprocess in util for macOS + Python 3.13 compatibility (#1653) (@Yaminyam)
  • connectors: show askpass generation errors (#1628) (@matthijskooijman)
  • connectors.ssh: honor ConnectTimeout through ProxyJump (#1679) (@wowi42)

Docs/meta:

  • docs: facts.opkg, operations.opkg - add note about Openwrt switch to apk (#1595) (@morrison12)
  • docs: fix extra trailing comma in operation argument lists (#1596) (@morrison12)
  • docs: fix missing keyword-only args in operations documentation (#1600) (@morrison12)
  • docs: fix generate_operations_docs.py and add docs build to CI (#1614) (@wowi42)
  • docs: operations.files - clarify template vars use (#1615) (@EricDriussi)
  • docs: update Python version requirements (#1627) (@pascal-cm)
  • docs: generate fact/operation docs for modules (vs files) (#1606) (@morrison12)
  • docs: clarify group_data/ is file-inventory only (#1696) (@wowi42)

Other:

  • facts+operations: add GpgKeyrings fact and gpg.* operations (#1460) (@maisim)
  • dependencies/paramiko: support paramiko v4, remove DSS key support (#1525) (@5long)
  • operations.server.mount fix not detecting already-mounted devices (#1611) (@wowi42)
  • facts+operations: add uv support (#1500) (@morrison12)
  • meta,api: lazy load fact and operation modules (#1609) (@Dexmachi)
  • facts,operations: migrate shlex.quote to StringCommand + QuoteString everywhere (#1617) (@wowi42)
  • operations+facts: server.Processes fact and server.kill operation (#1583) (@wowi42)
  • arguments: add dzdo support for privilege escalation, including CLI options and configuration. (#1633) (@guinuxbr)
  • zfs: return an empty dict if zfs/zpool commands are not available (#1650) (@yacoob)
  • meta,ci: make ruff checks in ci+dev-lint.sh consistent
  • progress: finish spinner as soon as possible (#1657) (@matthijskooijman)
  • feat: support SSH IdentityAgent config directive (#1630) (@wowi42)
  • security: quote untrusted values in command construction across connectors, operations, and util (#1664) (@wowi42)
  • ci: upgrade default Python to 3.14 (#1667) (@wowi42)
  • fix: Add timeout support in FunctionCommand (#1663) (@Tbruno25)
  • feat: add config.INHERIT_ENV to pass local process env vars to all op… (#1677) (@maisim)
  • Add support for using AI coding agents (#1672) (@DonDebonair)
  • fix(cli): exclude imports from group data (#1676) (@wowi42)
  • fix: scripts/generate_facts_docs: add canonical-name label for re-exported facts (#1686) (@wowi42)
  • fix(operations.git): don't pull when already up to date (#1690) (@wowi42)
  • feat(facts): add requires_command guard sentinel and check_preconditions() hook (@maisim)
  • feat(facts.zfs): add check_preconditions for ZfsDatasets and update command method (@maisim)
  • feat(operations.docker): add login/logout operations (#1694) (@wowi42)
  • feat(operations.docker): add compose operation (#1693) (@wowi42)
  • feat(operations.docker): add build operation (#1695) (@wowi42)
  • operations/facts: modernize apt.key to replace deprecated apt-key command (@maisim)
  • chore: make Claude use modern type hints (#1692) (@DonDebonair)
  • feat(apt): add purge option to apt.packages (closes #1698) (#1702) (@mvanhorn)
  • fix(facts): add semicolons to TmpDir shell script for sh -c compatibility (#1703) (@wucm667)
  • fix(operations.server): normalize sysctl value for comparison (#1706) (@wowi42)
  • feat: add PR review skill (#1683)

v3.7

12 Mar 10:55
Immutable release. Only release title and notes can be modified.
812a149

Choose a tag to compare

Thank you to all contributors - particular shout out to @wowi42 for an incredible run of PRs!

Core:

  • api.facts: fix requires_command shell operator precedence with compound commands (#1579) (@wowi42)

Operations/facts:

  • operations.docker: add support for env files (#1572) (@EricDriussi)
  • operations.docker: add support for dns (#1590) (@EricDriussi)
  • operations.files.sync: support symlinks
  • facts.server.Port: add UDP support and multi-platform backends (#1550) (@wowi42)
  • facts.hardware.Memory: use LANG=C while calling vmstat (#1553) (@soltysek)
  • facts.hardware: add CpuInfo fact (#1577) (@soltysek)
  • facts.server.Sysctl: fix non-zero exit code causing empty result (#1578) (@wowi42)
  • facts.runit.RunitManaged: handle missing service directory gracefully (#1580) (@wowi42)
  • facts.hardware.Memory: fix FreeBSD support by summing page categories (#1584) (@wowi42)
  • facts.server.SecurityLimits: handle missing limits.conf (#1582) (@wowi42)
  • facts.server.Port: fix ss command for Alpine/BusyBox compatibility (#1586) (@wowi42)
  • facts.iptables: add requires_command to all iptables facts (#1587) (@wowi42)
  • facts.opkg: add requires_command and stop hardcoding /bin/opkg (#1588) (@wowi42)
  • facts.choco: add requires_command to ChocoPackages and ChocoVersion (#1589) (@wowi42)

Connectors:

  • connectors: @podmanssh connector for remote Podman container operations (#1547) (@elazar)
  • connectors.ssh: exclude _chdir from global arguments used when removing temporary file (fix #1426) (#1429) (@morrison12)
  • connectors.ssh: don't include password in SSH exception authentication data (#1538) (@oliverhr)

CLI:

  • cli: use gevent for the progress spinner
  • cli: add --ssh-password-prompt flag for interactive SSH password input (#1585) (@wowi42)

Other:

  • global arguments: _su_password argument for su password authentication (#1573) (@wowi42)
  • operations+facts: server.timezone and server.Timezone fact (#1575) (@wowi42)
  • scripts: add generate_changelog.py

v3.6.1

02 Feb 13:47
Immutable release. Only release title and notes can be modified.
da3fd2b

Choose a tag to compare

Thank you to all contributors. A solid bugfix release including some rather old bugs at this point.

Core fixes:

  • api: handle/propagate nested operation errors
  • api: don't apply stage check in API mode
  • api: change iter_active_hosts -> get_active_hosts

Operation/fact fixes:

  • operations.docker.container: add support for --restart and --rm arguments (@levinion)
  • operations.postgres: add idempotency notice on passwords to postgres.role
  • facts.flatpak.FlatpakPackages: handle headless output correctly
  • facts.crontab: don't return non-command cron entries in get_command
  • facts.files.FileContents: fix return None when no file exists
  • facts.files.FindFiles: fix args parameter being ignored (@wowi42)

Connector fixes:

  • connectors.ssh: handle multiple known hosts files in SSH config

CLI fixes:

  • cli: fix missing config lock
  • cli: fix config flags lost on multiple deploy files (@wowi42)
  • cli/inventory: support loading host groups directly from module attributes (@wowi42)

Docs/meta:

  • docs: fix many minor errors (@romain-dartigues)
  • docs: fix typo in inventory-data.rst (@EshemMimi)
  • meta: add arguments linter
  • meta: fix dev linting scripts

v3.6

05 Jan 09:58
Immutable release. Only release title and notes can be modified.
5291e90

Choose a tag to compare

First 2026 release - Happy New Year all! Thank you to all contributors. One big highlight is new metadata spec for plugins, this is the start of better discovery and documentation generation for third party facts and operations:

  • add metadata spec for pyinfra plugins (@rod7760)

New and updated operations/facts:

  • operations: add _temp_dir global argument for configuring temp directory (@wowi42)
  • operations: add files.copy operation (@EricDriussi)
  • operations.crontab: fix modification not properly relying on the cron_name parameter (@information-redacted)
  • operations.docker.container: add support for setting labels (@spookyvision)
  • operations: add import statements on at least one example of every operation (@mkinney)
  • operations.docker.image: make operation idempotent (@DonDebonair)
  • operations.files.template: allow custom jinja2 template loaders (@DaRasch)
  • operations.files.block/connectors.util: use correct temporary directory (@morrison12)
  • operations.util.packaging: allow empty package list in ensure_packages (@schenker)
  • operations: fix tmpdir to properly use all the POSIX environment variables (@wowi42)
  • facts.files.FileContents: improve docstring (@adonm)
  • facts.apt.update: fix computation of cache_time when host is not UTC (@philippemilink)
  • facts: add FactProcessError to log, not explode, issues processing facts (@NichtJens)
  • facts.npm: check directory exists before cd-ing (wowi42)

Connectors:

  • connectors.docker: add platform and architecture option via connector data (@JP-Ellis)
  • connectors: close stdin after writing any input
  • connectors.ssh: add workaround for paramiko no session error (@dfaerch)

CLI:

  • cli: change color of "No changes" to cyan
  • cli: add option --same-sudo-password (@philippemilink)

Docs/meta:

  • docs: replace python -m with uv run -m (@JP-Ellis)
  • docs: fix URLs in API documentation (@kelno)
  • docs/connectors: document command wrapping and parameter filtering best practices (@elazar)
  • tests: freeze date for fact tests

v3.5.1

01 Oct 16:11
Immutable release. Only release title and notes can be modified.
a620527

Choose a tag to compare

Patch release with a bunch of great fixes. But notably want to call out two major changes for anyone working on the pyinfra code itself (huge thank you Daan for implementing these):

  • feat: use ruff for linting and formatting (@DonDebonair)
  • feat: use uv for project and dependency management (@DonDebonair)

Core fixes:

  • api: correctly set context state+host when calling get_facts
  • cli: catch exceptions when testing inventory/operation imports
  • cli: fix/remove datetime timezone warnings (@wowi42)
  • operations/files.block: correct behaviour when markers/block not found and no line provided (@morrison12)
  • operations.util.packaging: extend PkgInfo for winget (@rod7760)
  • facts/server: support negative value in sysctl (@imlonghao)

Docs:

  • docs: fix dynamic execution example (@wowi42)
  • docs: Specify how the recursive argument to directory() works (@cliffmccarthy)
  • docs: change recommended installation methods (@DonDebonair)
  • docs: update writing connectors

Tests:

  • op.server.user tests: add exists_noop.json for user existence checks (fix warning) (@maisim)
  • op.server.user tests: add noop_description (fix warning) (@maisim)
  • fix: add missing command field in test (@maisim)
  • tests: clear the host sftp memoization cache before setting up the mock (@wowi42)
  • tests: export testgen class to a new package/repo
  • tests: fix missing stage sets on state

v3.5

03 Sep 10:26
eb0e683

Choose a tag to compare

New release with some really awesome new features, brought to you by the fantastic contributions of the community. New stuff:

  • add --diff argument to show file diffs for potential file changes (@jgelens)
  • add _retries, _retry_delay and _retry_until global arguments (@shohamd4)
  • parallelize disconnecting from hosts (@gwelch-contegix)
  • enable using SCP instead of SFTP for SSH file transfers (@DonDebonair)

New and updated operations/facts:

  • facts/server: add RebootRequired fact (@wowi42)
  • operations/pip: support PEP-508 package versions (@morrison12)
  • operations+facts/docker: add Docker plugin support (@DonDebonair)
  • operations/files.put: add atime and mtime arguments (@vram0gh2)
  • operations/openrc: support runlevel when enabling services (@sengo4hd)
  • facts/yum+dnf+zypper: return repoid in repository facts

Operation/fact fixes:

  • facts/files.File: add ls fallback support (@mrkbac)
  • operations/openrc: add missing noop messages (@sengo4hd)
  • operations/server.crontab: fix newline when replacing existing values (@Nananas)
  • operations/files.block: fix examples doc (@morrison12)
  • operations/files.block: fix case where file exists but line is missing (@morrison12)
  • operations/files.block: improve handling of special characters in marker lines (@morrison12)

Internal/meta:

v3.4.1

14 Jul 20:32
e064e8b

Choose a tag to compare

  • fix config context when getting operation arguments

v3.4

09 Jul 14:17
bb5218c

Choose a tag to compare

Much delayed 3.4, great collection of additions and improvements. Huge THANK YOU to all contributors as always. New features:

New and updated operations/facts:

  • operations/docker.network: add support for aux addresses (@DonDebonair)
  • operations/files: try multiple hash functions in files.get + files.put (@mrkbac)
  • operations/files.download: add temp_dir argument (@scy)
  • operations/files.download: add extra_curl_args and extra_wget_args arguments (@jgelens)
  • operations/flatpak: add remote support (@Griffoen)
  • operations/git + facts/git: add GitTag fact and support tag checkout (@wowi42)
  • operations/server.mount: add support for FreeBSD mounts (@DtxdF)
  • facts/server: add server.Port fact to find process listening on port (@missytake)

Operation/fact fixes:

  • operations/docker: handle case where no docker containers/etc exist (@wowi42)
  • operations/files + operations/crontab: fix deletion of lines when present=False (@bad)
  • operations/files.block: avoid use of non-POSIX chown -n
  • operations/files.put: fix copying of local file mode (@vram0gh2)
  • operations/server.user: fix appending of user groups (@aaron-riact)
  • facts/server.Mounts: fix whitespace and escaped character parsing (@lemmi)
  • facts/systemd: treat mounted units as active

Internal/meta:

  • remove unncessary setuptools runtime dependency (@karlicoss)

v3.3.1

29 Apr 10:58
88a8703

Choose a tag to compare

  • connectors/ssh: fix extra keep_alive key passing through to paramiko connect call (@chipot)
  • docs: refine installation guide with updated Python requirements and best practices (@wowi42)

v3.3

28 Apr 10:55
e4b76ea

Choose a tag to compare

Second release of 2025: loads of adds, fixes and documentation improvements. A huge THANK YOU to all contributors. Slightly changed format for the change list based on commit messages which should speed up releases:

New operations & arguments:

  • operations/freebsd: add FreeBSD operations & facts (@DtxdF)
  • operations/files.move: new operation (@Pirols)
  • operations/server.user: enable adding user to secondary groups (Pirols)
  • operations/postgres: enhance role management by adding ALTER ROLE support (@wowi42)
  • operations/postgres: enable modifying existing postgres databases (@wowi42)
  • operations/docker.container: refactor to support container recreation (@minor-fixes)

Operation/fact fixes:

  • operations/postgres: fix quoting of locale parameters (@xvello)
  • operations/server: remove leftover deprecated parameter (@wowi42)
  • operations/pacmen: update PACMAN_REGEX to support additional characters (@wowi42)
  • operations/server.sysctl: handle 0 integer values correctly (@lemmi)
  • operations/apt: dist-upgrade also supports --autoremove (@bauen1)
  • operations/apt: fix parameter name in docs (@bauen1)
  • operations/server: fix: lastlog is always null (@ingstem)
  • operations/docker: Fixed a typo with the volumes parameter to docker.prune operation (@mpilone)
  • facts/xbps.XbpsPackages: allow . in package names (@lemmi)

Connectors, CLI:

  • connectors: improve detection of sudo password needed
  • connectors/ssh: add support for ServerAliveInterval (@chipot)
  • cli: enable -h as shorthand for --help (@NichtJens)

Docs:

  • docs: Add a section explaining connector flow (@goetzk)
  • docs: Add inventory processing note and reference it (@goetzk)
  • docs: Add example of logging to using operations docs (@goetzk)
  • docs: fix wrong example operation using forbidden argument 'name' (@robertmx)
  • docs: Add a note to the docs about using _inner when calling operations from other operations (@CSDUMMI)
  • docs: Document host, state, inventory in files.template (@mpilone)
  • docs: Minor adjustments to wording help docs and help (@goetzk)
  • docs: expand connectors documentation (@goetzk)
  • docs: correct import path for any_changed, all_changed (@lemmi)
  • docs: Add note re: global arguments to operations (@simonhammes)

Internal/meta:

  • refactor: update opkg documentation and add requires_command to ZFS and Git tests (@wowi42)
  • Update testing and development dependencies in setup.py (@wowi42)
  • tests: Load test specs with PyYAML instead of json (@taliaferro)
  • typing: Require explicit override decorator (@bauen1)
  • api: don't execute callbacks within a greenlet if we're already in one
  • ci: Github Actions support for python 3.12 (@wowi42)
  • ci: Prevent docs job from running on forks (@simonhammes)