Metadata-Version: 2.4
Name: pyproject-doctor
Version: 0.1.0
Summary: 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-URL: Homepage, https://github.com/amaar-mc/pyproject-doctor
Project-URL: Repository, https://github.com/amaar-mc/pyproject-doctor
Project-URL: Bug Tracker, https://github.com/amaar-mc/pyproject-doctor/issues
Author-email: Amaar Chughtai <amaardevx@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Amaar Chughtai
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: linter,packaging,pep508,pep621,pre-commit,pyproject,validator
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: packaging>=23.0
Requires-Dist: tomli>=2.0; python_version < '3.11'
Provides-Extra: classifiers
Requires-Dist: trove-classifiers>=2023.1.1; extra == 'classifiers'
Provides-Extra: dev
Requires-Dist: mypy>=1.0; extra == 'dev'
Requires-Dist: pytest>=7.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: trove-classifiers>=2023.1.1; extra == 'dev'
Description-Content-Type: text/markdown

# pyproject-doctor

<p align="center">
  <img src="assets/logo.png" alt="pyproject-doctor logo" width="160">
</p>

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

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

Or with classifier validation:

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

## Usage

```bash
# 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`:

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