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

The pyproject.toml specification has become increasingly more complex over time. Although tools apply their own validation rules, there is no standard way to surface useful configuration errors/warnings directly in an editor before those tools run. This language server (and linter) provides real-time feedback on configuration issues as you edit your project file, helping you catch errors early and maintain clearer, more reliable builds.

We currently provide over 30+ rules that cover syntax validation, schema compliance, project metadata (i.e. name, version, description, etc), dependencies (i.e. PEP 508 format, version bounds, deprecations, updates), and lots more. The rule system is designed to be easily extended with custom rules to fit any projects specific needs.

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

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.1.2.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.1.2-py3-none-win_amd64.whl (5.7 MB view details)

Uploaded Python 3Windows x86-64

pyproject-1!0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

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

Uploaded Python 3manylinux: glibc 2.17+ ARM64

pyproject-1!0.1.2-py3-none-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

pyproject-1!0.1.2-py3-none-macosx_10_12_x86_64.whl (5.4 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pyproject-1!0.1.2.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.1.2.tar.gz
Algorithm Hash digest
SHA256 584abf6b337b72de56e8e94d10a34c8aba1f1861ac3c4948ca207061355de5a6
MD5 c70f911a3b5f45cf431b9e8a3262f1e2
BLAKE2b-256 2b8cf749559abe2656434154462cd4a8488d67dd3a59f71bba9d3eff7246ea05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyproject-1!0.1.2-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.1.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 2ffb2e52acc289d51f869df8ecb873f13a4de67528dc91f57b296e37da1c093e
MD5 c213b5469991191b7ecc4b2196a5c160
BLAKE2b-256 a586649f964f1e1457f91db481b518c168e251e388ba06421d247c78ca314999

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyproject-1!0.1.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3cc332cfd5b9b1b86af6780148eaa17af7330fad48556445cd0c1bb07c624fb
MD5 1b77d4df19e13313c591a10c1e7ede04
BLAKE2b-256 3326f353efafe45d1f117c214b37cc16c015685d46e9c00dc998e19c5f2c4b07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyproject-1!0.1.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ed094ce1cdab1f13fafdbcd972997297c488041eb406a7ce402234c89486e135
MD5 9da17a69c2342fa40134d3af59905d4b
BLAKE2b-256 225ba3fefdaf37acd93a09fd1df6169c1969f8bef6ca03166972d810da902240

See more details on using hashes here.

File details

Details for the file pyproject-1!0.1.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyproject-1!0.1.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f22afcd38064b0edc8334163d4397bfeb8ba7835599612a8820dbce32ac8aeb
MD5 8795418b3ee679b20878c7f6fef61d2d
BLAKE2b-256 70c8b78c329e28a6b5fc3df97b7fdb4806a2ae9ac445bdb25c781a869be3f78e

See more details on using hashes here.

File details

Details for the file pyproject-1!0.1.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyproject-1!0.1.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 61541c95f5a76690414a355a9bb9a0fc2fc13631acfcf7f9c1959d611ca1785c
MD5 239eadb7783d89fc66c62bcec4ab2b1a
BLAKE2b-256 1d9517a346298c2e3abb6b415a285a943a7a5b8bdba0714d29a481285a49c105

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