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

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

Uploaded Python 3Windows x86-64

pyproject-1!0.1.3-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.1.3-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.3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (9.4 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.1.3.tar.gz.

File metadata

  • Download URL: pyproject-1!0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 4f0e666a1d45eec4a664c0be31a22c60d43048ce9261b1250e8de5019f0772db
MD5 d41c16a597497e803d175126b5527825
BLAKE2b-256 3d289e7c376989dfb30d58c973b69f7cfd667a8a13e4c8404e96605ef8580df9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyproject-1!0.1.3-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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0503175a90a70d7b6c623ed752d0af32ce85ee34123b26ce82277222618438a0
MD5 ab6ee522107a894eae2710e796b201a1
BLAKE2b-256 37870a00ccedbdfeeb667ad458f79925ccd726a6f221eeda6a159a3ac45ee6a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyproject-1!0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 147ef62828861a728e75cc4f834cd723b6ed3cfceebe69add0203d037461ac80
MD5 7c3561662d91dbb4a0b192d7e8a91207
BLAKE2b-256 3cb7039b26a73cca99f2f90270706047e27f2624a914639ba66d4134a6bac9db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyproject-1!0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 44aeaed756c55bf0647d49bfb8c6a588e2b0ea4a71e7df572fa5997f27886b36
MD5 dce677c06fbfa94edf85971ae3f69372
BLAKE2b-256 609bd3b28e21ea349e8a97234d1f05484cdd492cd0a7e3528bf9d056789f993d

See more details on using hashes here.

File details

Details for the file pyproject-1!0.1.3-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.1.3-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 cb90094942ac52cd2e437bb1de44f41a4ac838ff2fd8d86f91bf3469ac6983df
MD5 87a740fa17f316d7501fa45b01423498
BLAKE2b-256 047bf9c47dfe853ff1690698c3f5e32e566281ca1b01101bf422a24822389c1c

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