Metadata-Version: 2.3
Name: pep440check
Version: 0.0.3
Summary: Check and normalize PEP 440 version strings in pyproject.toml
Keywords: pep440,python,version,pyproject,packaging,tool
Author: heiwa4126
Author-email: heiwa4126 <heiwa4126@gmail.com>
License: MIT License
         
         Copyright (c) 2025 heiwa4126@gmail.com
         
         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.
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Dist: packaging
Requires-Python: >=3.9
Project-URL: Documentation, https://github.com/heiwa4126/pep440check#readme
Project-URL: Issues, https://github.com/heiwa4126/pep440check/issues
Project-URL: Source, https://github.com/heiwa4126/pep440check
Description-Content-Type: text/markdown

# pep440check

[![PyPI - Version](https://img.shields.io/pypi/v/pep440check.svg)](https://pypi.org/project/pep440check)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pep440check.svg)
![Last Commit](https://img.shields.io/github/last-commit/heiwa4126/pep440check)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A utility to check if version strings in pyproject.toml's project.version are [PEP 440](https://peps.python.org/pep-0440/) compliant and suggest normalized forms if they are not.
Optionally, it can rewrite the file with the normalized version.

## Basic usage

```sh
pep440check [-h] [-w] [-V] [path]
```

- `path`: path to pyproject.toml (defaults to current directory's pyproject.toml if omitted)
- `-w, --write`: write normalized version back to file
- `-h, --help`: show help message and exit
- `-V, --version`: show program's version number and exit

### Exit codes

- `0`: Version is already PEP 440 compliant (displays "OK")
- `1`: Version needs normalization or error occurred

### Output examples

**When version is already normalized:**

```
$ pep440check
Target: /path/to/pyproject.toml
OK: 0.0.1a1
```

**When version needs normalization:**

```
$ pep440check
Target: /path/to/pyproject.toml
Original version: 1.0.0-rc1
Suggested normalized version: 1.0.0rc1
```

**Writing normalized version:**

```
$ pep440check -w
Target: /path/to/pyproject.toml
Normalized version: 1.0.0-rc1 -> 1.0.0rc1
```

## Installation and Usage

```sh
uv add pep440check --dev
uv run pep440check [args]
```

or

```sh
uvx pep440check [args]
```

or

```sh
uv tool install pep440check
pep440check [args]
```

## Development

```sh
git clone https://github.com/heiwa4126/pep440check.git
cd pep440check
uv sync
```

Run tests:

```sh
uv run poe test
```

Run linter and formatter:

```sh
uv run poe check
```

Type checking:

```sh
uv run poe mypy
```

Build package:

```sh
uv run poe build
```
