https://github.com/ofek/pyproject-validate
Validate and format pyproject.toml files
https://github.com/ofek/pyproject-validate
Last synced: 8 months ago
JSON representation
Validate and format pyproject.toml files
- Host: GitHub
- URL: https://github.com/ofek/pyproject-validate
- Owner: ofek
- License: mit
- Created: 2022-02-21T01:04:18.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-21T17:49:58.000Z (over 4 years ago)
- Last Synced: 2025-10-19T15:29:36.032Z (9 months ago)
- Language: Python
- Size: 15.6 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
# pyproject-validate
| | |
| --- | --- |
| CI/CD | [](https://github.com/ofek/pyproject-validate/actions/workflows/test.yml) [](https://github.com/ofek/pyproject-validate/actions/workflows/build.yml) |
| Package | [](https://pypi.org/project/pyproject-validate/) [](https://pypi.org/project/pyproject-validate/) [](https://pypi.org/project/pyproject-validate/) |
| Meta | [](https://github.com/psf/black) [](https://github.com/ambv/black) [](https://github.com/pycqa/isort) [](https://spdx.org/licenses/) [](https://github.com/sponsors/ofek) |
-----
Validate and format `pyproject.toml` files.
**Table of Contents**
- [Installation](#installation)
- [Usage](#usage)
- [Validators](#validators)
- [Specs](#specs)
- [Naming](#naming)
- [Dependencies](#dependencies)
- [License](#license)
## Installation
```console
pip install pyproject-validate
```
## Usage
```console
usage: pyproject-validate [-h] [--fix] [--config CONFIG] [--version]
optional arguments:
-h, --help show this help message and exit
--fix whether to apply fixes for any encountered errors
--config CONFIG explicit path to the project config file
--version show program's version number and exit
```
## Validators
### Specs
Adhere to the data model defined by [PEP 517](https://www.python.org/dev/peps/pep-0517/#source-trees) and [PEP 621](https://www.python.org/dev/peps/pep-0621/#details).
### Naming
Ensure normalized project names.
Before:
```toml
[project]
name = "Foo.bAr"
```
After:
```toml
name = "foo-bar"
```
### Dependencies
Ensure normalized and sorted [PEP 508](https://www.python.org/dev/peps/pep-0508/) dependency definitions.
Before:
```toml
[project]
dependencies = [
"python-dateutil",
"bAr.Baz[TLS] >=1.2RC5",
'Foo;python_version<"3.8"',
]
```
After:
```toml
dependencies = [
"bar-baz[tls]>=1.2rc5",
"foo; python_version < '3.8'",
"python-dateutil",
]
```
## License
`pyproject-validate` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.