Metadata-Version: 2.4
Name: eol-pin-check
Version: 0.1.0
Summary: Find the runtime versions your repo pins — Python, Node.js, Ubuntu, Debian, Alpine, Go, PostgreSQL — and say whether the publisher has stopped supporting each one, with the publisher's own sentence as evidence
Author: referencesource.org
License: CC0-1.0
Project-URL: Homepage, https://referencesource.org/software-end-of-support/
Project-URL: Source, https://referencesource.org/software-end-of-support/
Keywords: eol,end-of-life,end-of-support,python-version,dockerfile,docker,ubuntu,node,postgres,security,ci,pre-commit,lint,supply-chain
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# eol-pin-check (Python)

Finds the Python, Node.js, Ubuntu, Debian, Alpine Linux, Go and PostgreSQL
versions your repository pins, says whether each one is still supported, and
shows the record each date was read from — endoflife.date's own row for that
release, quoted as it was served, with the date we last re-checked it. Exits
non-zero when something has lost free security support, so it works as a CI
gate or a `pre-commit` hook.

```console
$ pip install eol-pin-check
$ eol-pin-check
Python 3.8 — security support has ended
  Dockerfile:1  FROM  (written "3.8-slim", read as 3.8)
    security support ends 2024-10-07; active support ended 2021-05-03
    ""name":"3.8","label":"3.8","releaseDate":"2019-10-14","isEol":true,"eolFrom":"2024-10-07","isMaintained":false"
    https://endoflife.date/api/v1/products/python
    our record: https://referencesource.org/software-end-of-support/python-3-8/  last checked 2026-10-05
    the publisher still supports Python 3.15 (supported to 2031-10-31)
    (that this project runs on it is not something our records know, and is not claimed)

Python 3.12 — past active support, still getting security fixes
  .github/workflows/ci.yml:8  python-version
    security support ends 2028-10-31; active support ended 2025-04-02
    ...

5 runtime pin(s) in 4 files: 4 out of support, 1 past active support, 0 with no end date stated, 0 not in our records, 0 unpinned.
Only the files this scan opened were looked at; a pin in a file it did not open has not been cleared.
$ echo $?
1
```

This is the Python twin of the [npm package of the same
name](https://www.npmjs.com/package/eol-pin-check). It exists because most of
the files it reads belong to a Python project — `pyproject.toml`, `setup.cfg`,
`tox.ini`, `Pipfile`, `.python-version`, `runtime.txt`, `environment.yml`,
`.readthedocs.yaml` and the Dockerfile beside them — and a project laid out
that way installs a check like this with `pip` or `pre-commit`, neither of
which can reach npm. Both packages are built from the same records by the same
script, so they agree about what is supported by construction rather than by
hand; a gate fails if the two data files ever differ or if the two give
different verdicts on the same pin.

## What it reads

Dockerfiles and `Containerfile`; `docker-compose*.yml`; dev container configs;
`.github/workflows/*.yml` (`python-version`, `node-version`, `runs-on`,
`container`); `.gitlab-ci.yml`, `azure-pipelines.yml`,
`bitbucket-pipelines.yml`, `.travis.yml`, `cloudbuild.yaml`, `.drone.yml`,
`.woodpecker.yml`, `.circleci/config.yml`; `pyproject.toml` and `setup.cfg`
(`requires-python` floor); `tox.ini` and `noxfile.py` (`py38`, `py312`);
`Pipfile`; `.python-version`; `runtime.txt`; `environment.yml` (conda);
`.readthedocs.yaml`; `.nvmrc`, `.node-version`, `.tool-versions`, `mise.toml`,
`netlify.toml`; and `package.json` (`engines.node` floor, `volta.node`).

Caches, build output, virtualenvs and vendored code are not read —
`node_modules`, `.venv`, `dist`, `.tox`, `.yarn` and the rest — because a pin
inside an installed toolchain is a fact about something you downloaded, and
reporting it as yours names a file you cannot edit.

## Commands

```
eol-pin-check                      scan the current directory
eol-pin-check src deploy           scan these paths
eol-pin-check --pin Python 3.8     look one version up, scan nothing
eol-pin-check --supported Python   what the publisher still supports today

--json             machine-readable output (for CI and agents)
--strict           exit 1 for a release past active support as well
--quiet            print only the pins that are not plainly supported
--full-quote       print the whole quoted sentence
--today YYYY-MM-DD judge against this date instead of today
```

## pre-commit

There is no GitHub mirror of this package to point `repo:` at yet, so the
stanza below is the one that works today: pip installs it from PyPI and
`pre-commit` runs the installed command.

```yaml
repos:
  - repo: local
    hooks:
      - id: eol-pin-check
        name: eol-pin-check (is a pinned runtime out of support?)
        entry: eol-pin-check
        language: python
        additional_dependencies: [eol-pin-check]
        pass_filenames: true
        types: [text]
```

A `.pre-commit-hooks.yaml` ships inside the package as well, so the moment a
mirror repository exists the three-line `repo:`/`rev:`/`hooks:` form will work
without any change here. Pointing you at that repository before it exists
would be telling you to install something that is not there.

## What it will not do

**It does not rewrite your files.** The npm twin can edit a dead pin to a
supported release (`--fix` / `--write`); that half is deliberately not ported
yet, because a rewrite that is wrong edits your code, and the rules that make
it safe — put the `-slim` back on a tag, refuse a range with two clauses —
deserve their own tests rather than a hurried port. `--fix` and `--write` exit
2 here and say so. This build still *names* what the publisher supports
instead, which is the part that needs no write.

**It does not call a blank "supported".** Where a source states no end date,
what you get is which of three things the source actually said: ended with no
date given, maintained with no date announced (Go's habit), or nothing at all
— which is reported as its own status, because answering "supported" there
would be inventing the answer that suits a passing build.

**It does not fail a build over active support ending.** A release still
inside its security-fix window is a normal thing to be running. Only the end of
free security support, or of the paid extended cover that followed it, exits 1.
`--strict` changes that if you want it to.

**It does not clear what it did not read.** Every answer says how many files
were opened, and that a release we hold no record for is unknown to us rather
than supported.

## Where the data comes from

189 releases of 7 products, from
[endoflife.date](https://endoflife.date)'s own API (MIT), re-checked on a
schedule and published with the quote at
<https://referencesource.org/software-end-of-support/>. This compilation is
CC0-1.0. The records, not this package, are the product: every date printed
came off the publisher's page with the sentence it was read from.

Built by an automated system. No value here was typed by hand.
