Skip to content

FileNotFoundError: [Errno 2] No such file or directory: 'cached_release_cycle.json' #6

@GideonBear

Description

@GideonBear

The hook seems to be non-functional right now. Am I doing something very wrong?

$ ls -la
total 12K
drwxrwxr-x 7 gideon gideon 4,0K Dec  5 10:53 .git/
-rw-rw-r-- 1 gideon gideon  114 Dec  5 10:52 .pre-commit-config.yaml
-rw-rw-r-- 1 gideon gideon   36 Dec  5 10:53 pyproject.toml
$ cat pyproject.toml
[project]
requires-python = ">=3.9"
$ cat .pre-commit-config.yaml 
repos:
  - repo: https://github.com/sco1/pre-commit-python-eol
    rev: v2025.11.0
    hooks:
    - id: check-eol
$ pre-commit run -a
Check supported Python EOL...............................................Failed
- hook id: check-eol
- exit code: 1

Traceback (most recent call last):
  File "/home/gideon/.cache/pre-commit/repotu6_k3l7/py_env-python3/bin/checkeol", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/gideon/.cache/pre-commit/repotu6_k3l7/py_env-python3/lib/python3.14/site-packages/pre_commit_python_eol/check_eol.py", line 146, in main
    check_python_support(file)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/gideon/.cache/pre-commit/repotu6_k3l7/py_env-python3/lib/python3.14/site-packages/pre_commit_python_eol/check_eol.py", line 118, in check_python_support
    release_cycle = _get_cached_release_cycle(cache_json)
  File "/home/gideon/.cache/pre-commit/repotu6_k3l7/py_env-python3/lib/python3.14/site-packages/pre_commit_python_eol/check_eol.py", line 91, in _get_cached_release_cycle
    with cache_json.open("r", encoding="utf-8") as f:
         ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/gideon/.local/share/uv/python/cpython-3.14.1-linux-x86_64-gnu/lib/python3.14/pathlib/__init__.py", line 771, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'cached_release_cycle.json'
  1. Maybe you need to explicitly add it as data file in pyproject.toml?

CACHED_RELEASE_CYCLE = Path("./cached_release_cycle.json")

Maybe this needs to be Path(__file__) / "cached_release_cycle.json")?
Or maybe both?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions