Skip to main content

Offline deep validator for pyproject.toml: file existence, URL and email format, PEP 440 version and PEP 508 specifier validity, version-constraint satisfiability, and entry-point format.

Project description

pyproject-doctor

pyproject-doctor logo

Offline deep validator for pyproject.toml that catches the semantic mistakes other tools miss.

Most validators only check TOML syntax. pyproject-doctor goes further: it validates that your versions are PEP 440 compliant, your dependencies are PEP 508 compliant, your version constraints are actually satisfiable, your referenced files exist, your URLs are real URLs, your email addresses look right, and your entry-point references are correctly formatted.

PyPI release pending. Install from GitHub for now (see below).

What it checks

Code Description
version-invalid project.version is not a valid PEP 440 version
dep-invalid A dependency in project.dependencies, project.optional-dependencies, or build-system.requires is not a valid PEP 508 requirement
constraint-unsatisfiable A dependency's version specifiers form an impossible range (e.g. >=2.0,<1.0)
file-missing A file referenced by project.readme, project.license, or an entry-point module does not exist
url-invalid A value in project.urls is not a valid absolute URL
email-invalid An author or maintainer email address is malformed
entry-point-invalid A script or entry-point value is not in valid module:attr format
classifier-unknown A classifier in project.classifiers is not a known trove classifier (requires pip install 'pyproject-doctor[classifiers]')

Install

pip install git+https://github.com/amaar-mc/pyproject-doctor.git

Or with classifier validation:

pip install "git+https://github.com/amaar-mc/pyproject-doctor.git#egg=pyproject-doctor[classifiers]"

Usage

# Validate pyproject.toml in the current directory
pyproject-doctor

# Validate a specific file
pyproject-doctor /path/to/pyproject.toml

# JSON output
pyproject-doctor --format json

Exit code is 1 if any error-level diagnostic is found, 0 otherwise.

Pre-commit

Add to .pre-commit-config.yaml:

repos:
  - repo: https://github.com/amaar-mc/pyproject-doctor
    rev: v0.1.0
    hooks:
      - id: pyproject-doctor

Example output

error project.version: version-invalid: 'not.a.version' is not a valid PEP 440 version
error project.dependencies[0]: constraint-unsatisfiable: Dependency 'requests': constraint '>=3.0,<2.0' is unsatisfiable (lower bound 3.0 exceeds upper bound 2.0)
error project.urls.Homepage: url-invalid: URL 'not-a-url' is not a valid absolute URL (must have scheme and host)

License

MIT. Copyright (c) 2026 Amaar Chughtai.

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_doctor-0.1.0.tar.gz (948.2 kB view details)

Uploaded Source

Built Distribution

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

pyproject_doctor-0.1.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file pyproject_doctor-0.1.0.tar.gz.

File metadata

  • Download URL: pyproject_doctor-0.1.0.tar.gz
  • Upload date:
  • Size: 948.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for pyproject_doctor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 43a5160483ab800f908b5f6534ea60af34066b7fb44b6dc82719e63f2502dd56
MD5 ce8eb357b0a3143ba74377a120c204e8
BLAKE2b-256 b4425c3816b41f0ace94af2e5b57a9463a58b179487af4c1a45ac939561d31c1

See more details on using hashes here.

File details

Details for the file pyproject_doctor-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyproject_doctor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 511776668c8cd2709c5dbab28062697f70f3973db457fbf773dddf952e2c1352
MD5 0acce29dc5182afe12ba7f6ece9a4d1f
BLAKE2b-256 56dee02443d1ee5f42c0f8246684375fd49e29b5269c5cd6061a6acc118a9a83

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