Skip to content

sco1/pre-commit-pep639

Repository files navigation

pre-commit-pep639

Python Version from PEP 621 TOML GitHub Release GitHub License pre-commit.ci status

A pre-commit hook for PEP639 compliance in your pyproject.toml.

Using pre-commit-pep639 With pre-commit

Add this to your .pre-commit-config.yaml

-   repo: https://github.com/sco1/pre-commit-pep639
    rev: v0.2.0
    hooks:
    - id: check-classifiers
    - id: check-glob-resolve
    - id: check-glob-syntax

Hooks

NOTE: Unless otherwise noted, any metadata specification arrangements that are not explicitly supported should pass through without failing the hook. For example, if you have a build tool foo that specifies its metadata in a [tools.foo] table, its contents will not be checked.

check-classifiers

Check classifiers for license specification. Note that currently only pyproject.toml is inspected, if present.

Two metadata specification types are currently supported:

  • PEP621 compliant: The provided TOML file is assumed to contain a project table, which contains a list of PyPI classifiers in the classifiers field.
  • Poetry: The provided TOML file is assumed to contain a tools.poetry table, which contains a list of PyPI classifiers in the classifiers field.

check-glob-resolve

Check that license-files glob(s) match file(s) in the repo.

NOTE: Globs are checked relative to pyproject.toml's parent directory, though in most cases this should be the same as the repository's root.

check-glob-syntax

Check that license-files glob(s) do not contain syntax errors.

The following syntax issues are currently checked:

  • Presence of leading slash character (\) in glob
  • Presence of parent directory indicator (..) in glob

Python Version Support

Starting with Python 3.11, a best attempt is made to support Python versions until they reach EOL, after which support will be formally dropped by the next minor or major release of this package, whichever arrives first. The status of Python versions can be found here.

About

A pre-commit hook for PEP639 compliance

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •  

Languages