Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.10
python: python3

repos:
- repo: local
hooks:
- id: check-python-version
name: Ensure Python ≥ 3.10
Comment thread
tatiana marked this conversation as resolved.
language: python
pass_filenames: false
always_run: true
entry: python
args:
- -c
- |
import sys

required_major = 3
required_minor = 10
current_major, current_minor = sys.version_info[:2]

if (current_major, current_minor) < (required_major, required_minor):
print(
f"ERROR: Python {current_major}.{current_minor} is too old "
f"(requires ≥ {required_major}.{required_minor})."
)
raise SystemExit(1)
- repo: local
hooks:
- id: check-env-file
Expand Down