A linter and language server for `pyproject.toml` files
Project description
pyproject
pyproject is a linter and language server for
pyproject.toml
files.
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.1
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyproject-1!0.2.1.tar.gz.
File metadata
- Download URL: pyproject-1!0.2.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4efc7e1cf90a38d262a96bc32e5faf40d968c27ffe5c5e5623d9ad44c600e2d
|
|
| MD5 |
875192088ea7eef31495934ceeb64238
|
|
| BLAKE2b-256 |
809203e7167743cb98f90847f6a11cf9d66f2c01b28e2e6f0a8f51d196ddfd53
|
File details
Details for the file pyproject-1!0.2.1-py3-none-win_amd64.whl.
File metadata
- Download URL: pyproject-1!0.2.1-py3-none-win_amd64.whl
- Upload date:
- Size: 5.8 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc453973f9bb4e84c5943f961482cacb5d97eadc34ba13cb70128f789951f0bc
|
|
| MD5 |
afb398812c8648426f9f9e4e97812b5e
|
|
| BLAKE2b-256 |
a88fea7c4613bca71cea21ab2ebd772981a15c1372b647ea7c1737a453bd01be
|
File details
Details for the file pyproject-1!0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyproject-1!0.2.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.7 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e6a417d77f00edbb150075819b34cac51979a5a1263b4615ed44e9a123670df
|
|
| MD5 |
1ae57cbdea17b83390e4d82cc73aefc1
|
|
| BLAKE2b-256 |
ef1c25903f1d56a615959246aff3a2bf05554b8cd58c2b4ae9a1a828dba4b631
|
File details
Details for the file pyproject-1!0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: pyproject-1!0.2.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cec3f87fd2b1e8594586eb6961e00c30ed39050c2861d92358c9853fff805789
|
|
| MD5 |
15a31981e727bae506f4e8fe408dacec
|
|
| BLAKE2b-256 |
c88b4908dce035e73c5abd467befac9a92fa71e583c1601687e89b8cd9433469
|
File details
Details for the file pyproject-1!0.2.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.
File metadata
- Download URL: pyproject-1!0.2.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
- Upload date:
- Size: 9.7 MB
- Tags: Python 3, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18e8bbb68b5abfdb47cc6b7628762764e18235b3c6ffa4acdc50b06e34a0ae40
|
|
| MD5 |
a304b093f4adef91500bf6a1d611e39c
|
|
| BLAKE2b-256 |
f6290f622e6069169956d59e4ab02ce7242d5777b4dc28c3f4f6e083b548cafd
|