Skip to main content

Validate pyproject.toml files

Project description

pyprojectcheck ✅

Validate pyproject.toml files for correctness and best practices.

Installation

pip install pyprojectcheck

Usage

CLI

# Check current directory
pyprojectcheck

# Check specific file
pyprojectcheck path/to/pyproject.toml

Python API

from pyprojectcheck import check_file, check

# Check a file
result = check_file("pyproject.toml")
print(result)

# Check content directly
content = """
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "mypackage"
version = "1.0.0"
"""

result = check(content)
if result.valid:
    print("✅ Valid!")
else:
    for error in result.errors:
        print(error)

What It Checks

Errors

  • Missing [build-system] section
  • Missing requires or build-backend
  • Missing [project] section
  • Missing name or version
  • Invalid field types

Warnings

  • Missing recommended fields (description, readme, license)
  • Missing requires-python
  • Missing authors
  • Missing urls

Output Example

⚠️ [project] Missing 'description' field (recommended)
⚠️ [project] Missing 'readme' field (recommended)
❌ [project.authors[0]] Author must have 'name' or 'email'

❌ Invalid: 1 error(s), 2 warning(s)

License

MIT

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

pyprojectcheck_rj-1.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

pyprojectcheck_rj-1.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file pyprojectcheck_rj-1.0.0.tar.gz.

File metadata

  • Download URL: pyprojectcheck_rj-1.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pyprojectcheck_rj-1.0.0.tar.gz
Algorithm Hash digest
SHA256 aedc702d77e5fc79159c0dc922aa895859eebc86753331670b2703ccf45ecf21
MD5 082dd8d82b209efc0d3e2cdf2e70eb3c
BLAKE2b-256 a5b3756a010e1e1f42ea3b688b250c7b2546a21b5f4cb8a7a8d80ae97c6d17ed

See more details on using hashes here.

File details

Details for the file pyprojectcheck_rj-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyprojectcheck_rj-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b6e2a3a74a556d0b882259e41df64753d8a2a559599e9b961989d7cc94d985a
MD5 a914bc9eccf31fa0616c5bbf01654b5d
BLAKE2b-256 cb3b6fa6cef8808f51c1afc4318b8ac28018542785156d6b5bd6a7844ea5bc9c

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