Skip to main content

pyproject-fmt-pants-plugin

PyPI Version

A Pantsbuild plugin for formatting pyproject.toml files with pyproject-fmt.

Installation

Add the plugin to pants.toml:

[GLOBAL]
plugins = ["pyproject-fmt-pants-plugin==<version>"]

Then run pyproject-fmt through the fmt and lint goals:

pants fmt ::    # rewrite every pyproject.toml in place
pants lint ::   # fail when a pyproject.toml is not formatted

How it works

pyproject-fmt is installed into its own Pants resolve from the bundled lockfile, independent of your project's resolves. The plugin registers one fmt integration, which Pants also runs in check-only mode for lint.

For each run Pants:

  1. Selects the pyproject.toml files among the goal's inputs.
  2. Includes the shared config file, if any (see below).
  3. Runs pyproject-fmt once per file. pyproject-fmt stops after the first file it changes, so one process per file keeps every file in the batch formatted.

Configuration

pyproject-fmt layers its settings in this order, later entries winning:

  1. [pyproject-fmt].args, passed on the command line.
  2. A shared pyproject-fmt.toml file. Pants includes the one in the build root automatically; point [pyproject-fmt].config at a file elsewhere instead.
  3. The [tool.pyproject-fmt] table of each pyproject.toml file, which pyproject-fmt reads itself.

So a pyproject-fmt.toml file is optional: repo-wide settings can live in pants.toml alone.

[pyproject-fmt]
# https://pyproject-fmt.readthedocs.io/en/latest/configuration.html#command-line-interface
args = ["--column-width=120", "--indent=2", "--keep-full-version"]
Option Default Purpose
[pyproject-fmt].skip false Skip pyproject-fmt during pants fmt and pants lint.
[pyproject-fmt].args [] Arguments always passed to pyproject-fmt, e.g. --column-width=120.
[pyproject-fmt].config unset Path to a pyproject-fmt.toml file. Disables discovery.
[pyproject-fmt].config_discovery true Pick up a pyproject-fmt.toml file from the build root.
[pyproject-fmt].install_from_resolve unset Install pyproject-fmt from one of your own resolves instead of the lockfile.
[pyproject-fmt].interpreter_constraints ["CPython>=3.14,<3.15"] Interpreter that runs pyproject-fmt; independent of your project's constraints.

--config accepts only a standalone pyproject-fmt.toml: a pyproject.toml fails on its [project] table.

Supported versions

Plugin Pants Python
0.x 2.33 3.14

Compatible with and tested against Pants 2.33.2.

Pants loads plugins into its own interpreter, so the plugin requires the Python version Pants runs on.

Releases

Wheels are published to PyPI. Release notes live in the changelog and on the GitHub releases page.

Contributing, Bug Reports and Feature Requests

This plugin lives in the pants-plugin-depot repo. See its CONTRIBUTING.md, or open an issue.

Metadata

Release files for pyproject-fmt-pants-plugin 0.4.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for pyproject-fmt-pants-plugin 0.4.5
File Interpreter ABI Platform Actions
pyproject_fmt_pants_plugin-0.4.5-py3-none-any.whl Python 3 none any Details for pyproject_fmt_pants_plugin-0.4.5-py3-none-any.whl

Release files / pyproject_fmt_pants_plugin-0.4.5-py3-none-any.whl

Download URL pyproject_fmt_pants_plugin-0.4.5-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16062af36f33f74bb7648ab9751716d75c0dc20e9f71f22d12b6d0e0ce9d8abc
BLAKE2b-256 checksum
How to use checksums
8fa408626c59b40f3431af3f54f464507af4b475c4d25ec0dd21e2b546040ac1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

Security for pyproject-fmt-pants-plugin 0.4.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for pyproject_fmt_pants_plugin-0.4.5-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page