Skip to content

A pre-commit hook for enforcing supported Python EOL

License

Notifications You must be signed in to change notification settings

sco1/pre-commit-python-eol

Repository files navigation

pre-commit-python-eol

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

A pre-commit hook for enforcing supported Python EOL.

Using pre-commit-python-eol With pre-commit

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

-   repo: https://github.com/sco1/pre-commit-python-eol
    rev: v2025.12.1
    hooks:
    - id: check-eol
    - id: check-eol-cached

While both hooks are technically compatible with each other, it's advised to choose a single hook behavior that best fits your needs.

EOL Status Cache

To avoid requiring network connectivity at runtime, EOL status is cached to a local JSON file distributed alongside this hook. The cache is updated quarterly & a changed cache will result in a version bump for this hook.

Hooks

Only pyproject.toml is currently inspected. It is assumed that project metadata is specified per PyPA Guidance

check-eol

Check requires-python against the current Python lifecycle & fail if an EOL version is included; this includes a date-based check using the system's time for versions that have not yet explicitly been declared EOL.

check-eol-cached

Check requires-python against the current Python lifecycle & fail if an EOL version is included; this hook utilizes only the cached release cycle information.

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 enforcing supported Python EOL

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Contributors 4

  •  
  •  
  •  
  •  

Languages