Detect Python End‑of‑Life Versions Instantly with py‑eol
This article introduces py‑eol, a lightweight open‑source tool that checks whether a Python interpreter version is already or soon to be End‑of‑Life, offering module, CLI, and pre‑commit hook integrations for local development, CI/CD pipelines, and team collaboration.
Python releases new versions frequently, and older versions eventually reach End‑of‑Life (EOL), losing security updates. Developers often overlook the EOL status of the Python version used in a project, creating hidden risks.
What is py‑eol?
py‑eol is a simple utility that determines whether a specific Python version is already EOL or will become EOL soon. It supports three usage modes:
Python module calls
Command‑line execution
pre‑commit hook integration
The tool works for local checks and fits naturally into CI/CD pipelines and team workflows.
Quick installation and usage
pip install py-eolAs a module
from py_eol import is_eol, get_eol_date, supported_versions, eol_versions, latest_supported_version
# examples
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.14As a command‑line tool
# Check a specific version
py-eol versions 3.9
# Check the current interpreter
py-eol check-self
# Scan pyproject.toml or setup.py for EOL versions
py-eol files pyproject.toml setup.py
# List all supported (non‑EOL) versions
py-eol listAs a pre‑commit hook
repos:
- repo: https://github.com/shenxianpeng/py-eol
rev: v0.4.0
hooks:
- id: py-eolWhen an EOL version is detected, py‑eol reports the exact file and line number, making it easy to locate and fix.
Why care about EOL versions?
1. Avoid hidden risks – After a version reaches EOL it no longer receives security patches, increasing vulnerability exposure.
2. Smoother team collaboration – Integrated hooks or CI warnings alert developers during commits, preventing forgotten version updates.
3. Lightweight and easy to use – Installation is a single command, it has no external dependencies, and it can be run anywhere.
Motivation behind the tool
The author frequently encountered the small but annoying problem of tracking Python version EOL in daily work and created py‑eol to surface the issue early.
py‑eol is fully open‑source under the MIT license and welcomes contributions and improvements.
Project URL: https://github.com/shenxianpeng/py-eol
DevOps Engineer
DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
