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

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.3

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.3
File Interpreter ABI Platform
pyproject_fmt_pants_plugin-0.4.3-py3-none-any.whl Python 3 none any Details

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

Download URL pyproject_fmt_pants_plugin-0.4.3-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
74cc5f15cea0ce4a5d0254d6feb319366f797c99b8acc189f8e65d6049bcf804
BLAKE2b-256 checksum
How to use checksums
750018cf6ea1cb11ed1f6d68faeae06d10a39d0caebeb8185fc14753af220405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.3 This release

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

0.0.2

1 release file

0.0.1

1 release file

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