Skip to main content

A linter and language server for `pyproject.toml` files

Project description

pyproject

release build codecov downloads

pyproject is a linter and language server for pyproject.toml files.

demo

pyproject brings real-time feedback to your pyproject.toml files, including:

  • Syntax validation and schema compliance for project and tool configuration.

  • Over 30 built-in rules for project metadata and dependencies, including PEP 508 validation, version bounds, deprecations, and available updates.

  • Diagnostics directly in your editor, so configuration errors are caught before the tools that consume your project file run.

If you need help with pyproject please feel free to open an issue. Feature requests and bug reports are always welcome!

Installation

pyproject should run on any system, including Linux, MacOS, and the BSDs.

The easiest way to install it is by using cargo, the Rust package manager:

cargo install pyproject

Otherwise, see below for the complete package list:

Cross-platform

Package Manager Package Command
Cargo pyproject cargo install pyproject
Homebrew terror/tap/pyproject brew install terror/tap/pyproject
Pip pyproject pip install pyproject

n.b. Since we publish a release to PyPI, tools like uv work right out of the box, i.e. uvx pyproject check should just work with sensible default rules.

Pre-built binaries

Pre-built binaries for Linux, MacOS, and Windows can be found on the releases page.

Usage

pyproject can be used from the command-line or as a language server.

CLI

Below is the output of pyproject --help:

pyproject 0.2.0

Usage: pyproject <COMMAND>

Commands:
  check   Check a pyproject.toml file for errors and warnings [aliases: lint]
  format  Format a pyproject.toml file [aliases: fmt]
  server  Start the language server [aliases: lsp]

Options:
  -h, --help     Print help
  -V, --version  Print version

n.b. Running pyproject check or pyproject format on their own will attempt to perform actions on the nearest pyproject.toml file, walking backwards from the current location.

Language Server

Start the language server with pyproject server or pyproject lsp. The server communicates over standard input and output and provides diagnostics, completions, hover descriptions, and formatting for pyproject.toml files.

Configuration

You can configure rules in your pyproject.toml under the [tool.pyproject] section.

Each rule can be set to a severity level (error, warning, hint, information (or info), or off) using either a simple string or a table with a level field:

[tool.pyproject.rules]
project-unknown-keys = "warning"
project-dependency-updates = { level = "hint" }
project-requires-python-upper-bound = "off"

Rule identifiers are shown in diagnostic output (e.g., error[project-unknown-keys]). Rules that aren't explicitly configured use their default severity level.

Prior Art

This project was inspired by a language server I saw for Cargo.toml files, namely crates-lsp. I couldn't find similar a tool for pyproject.toml files, so I thought I'd write one.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyproject-1!0.2.0.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyproject-1!0.2.0-py3-none-win_amd64.whl (5.7 MB view details)

Uploaded Python 3Windows x86-64

pyproject-1!0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

pyproject-1!0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

pyproject-1!0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (9.5 MB view details)

Uploaded Python 3macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file pyproject-1!0.2.0.tar.gz.

File metadata

  • Download URL: pyproject-1!0.2.0.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyproject-1!0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec6fdfed9b32e4d55228b47728954465a2088a7575b5515826e6adcd7e68f37a
MD5 95e329fae420ba1e2e44a77be7fcb163
BLAKE2b-256 4209819937bc13d187504b7248a86f778b046fcf33909957e9edf6c389d09192

See more details on using hashes here.

File details

Details for the file pyproject-1!0.2.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: pyproject-1!0.2.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 5.7 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyproject-1!0.2.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ffda2dad250539966a943cbdb1a79493a9ec1a28da0db02e53575d262929b1ae
MD5 384d01854c15ede0ef7f9727835da0f4
BLAKE2b-256 bf944aebf003b5ea47b2b9040a524b5fd25b004512d9a0f26554b6dc335e1272

See more details on using hashes here.

File details

Details for the file pyproject-1!0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyproject-1!0.2.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c050bedb10d6257e6275960b42caacacb9fdc8ff47ea88e313fda2a1c53591a
MD5 7518bb19ddf82eec7628781513d3bd84
BLAKE2b-256 c5e03d726c957bcb38be1fda8a8f9f20b5c1bf77a9b331923f6685de74e044e7

See more details on using hashes here.

File details

Details for the file pyproject-1!0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyproject-1!0.2.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4f893768bad590f35f0c7e7037492cf96316b14444d1e478d5c696f3e880794f
MD5 3c11c661ecdcfba985b8391c9f9ca8a3
BLAKE2b-256 7224eeaad7939bd81f440c8d5cb231488fb517f08f30e178d8f9394d5e51361c

See more details on using hashes here.

File details

Details for the file pyproject-1!0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for pyproject-1!0.2.0-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 1da7a619c5777c04b432e2c5ad711d278eb9284f37d540e6b79b3af9e1edae5b
MD5 051ffbe492f4f27c6adf630b91ee078d
BLAKE2b-256 93dd6b80cc3f8be6c37006be5f8a05a80653df17cdb851ce289277f5940f27e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page