Check if a Python version is End-Of-Life (EOL)
Project description
py-eol
Check if a Python version is End-Of-Life (EOL).
Table of Contents
Why py-eol?
- Programmatically check if a Python version is supported or EOL
- Works both as a Python module and a CLI tool
- Useful for local checks, automation scripts, and CI/CD pipelines
- Helps teams avoid using unsupported Python versions
Installation
pip install py-eol
Usage
As a Python module
from py_eol import is_eol, get_eol_date, supported_versions, eol_versions, latest_supported_version
print(is_eol("3.7")) # True
print(get_eol_date("3.8")) # 2024-10-07
print(supported_versions()) # ['3.14', '3.13', '3.12', '3.11', '3.10', '3.9']
print(eol_versions()) # ['3.8', '3.7', '3.6', '3.5', '3.4', '3.3', '3.2', '2.7', '3.1', '3.0', '2.6']
print(latest_supported_version()) # 3.14
As a CLI tool
py-eol --help
usage: py-eol [-h] [--version] {versions,files,list,check-self,refresh} ...
Check if a Python version is EOL (End Of Life).
positional arguments:
{versions,files,list,check-self,refresh}
sub-command help
versions Check specific Python versions
files Check files for Python versions
list List all supported Python versions
check-self Check the current Python interpreter version
refresh Refresh the EOL data from endoflife.date
options:
-h, --help show this help message and exit
--version Show the version of the tool
Examples
# Check a specific version
py-eol versions 3.9
# Check multiple versions
py-eol versions 3.7 3.8 3.11
# Check files for EOL Python versions (shows file:line information)
py-eol files pyproject.toml setup.py .github/workflows/ci.yml
# Check current Python interpreter
py-eol check-self
# List all currently supported versions
py-eol list
# Output result in JSON format
py-eol versions 3.8 3.9 --json
# Refresh the latest EOL data
py-eol refresh
As a pre-commit hook
[!NOTE] This hook checks Python versions specified in pyproject.toml, setup.py, and GitHub Actions workflow files. When an EOL version is found, it reports the exact file and line number for easy identification.
To use py-eol as a pre-commit hook, you can add the following configuration to your .pre-commit-config.yaml file:
repos:
- repo: https://github.com/shenxianpeng/py-eol
rev: # Use the ref you want to point at
hooks:
- id: py-eol
Example output:
Check Python version EOL.................................................Failed
- hook id: py-eol
- exit code: 1
pyproject.toml:9: ⚠️ Python 3.7 is already EOL since 2023-06-27
.github/workflows/ci.yml:16: ⚠️ Python 3.9 is already EOL since 2025-10-31
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_eol-0.4.0.tar.gz.
File metadata
- Download URL: py_eol-0.4.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3084ccf7a778c0b7f5842dedbb9bc2c2a02d6bb093acb2346a9e5735b13b505d
|
|
| MD5 |
6ef02d421eaf797e83eaf38ecb898084
|
|
| BLAKE2b-256 |
b269432aab2100e5234afa93636d1e253bada5c84bca6370999aebca6f0734f7
|
File details
Details for the file py_eol-0.4.0-py3-none-any.whl.
File metadata
- Download URL: py_eol-0.4.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43acaa2e828fff0f67cf6d5e86c4020b221fa6ee1c2d621c39b556ecafbd4802
|
|
| MD5 |
38e0b7bcfb2b1254c826a4619d567af8
|
|
| BLAKE2b-256 |
105c36317b5b812fead8a080efc8ca37241f6c07f3a39f298b207a128536b2b5
|