Skip to content

Commit 81c8604

Browse files
fix: upgrade django to 5.2
1 parent 894aa1b commit 81c8604

4 files changed

Lines changed: 344 additions & 392 deletions

File tree

‎local_hooks/tests/test_package_app_dependencies.py‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ def test_package_wrapper_does_not_install_os_packages():
1919
assert "dnf install" not in wrapper
2020

2121

22+
def test_package_wrapper_runs_local_hooks_with_python313():
23+
"""The hook package must not be imported by the container's CPython 3.9."""
24+
wrapper = Path(PRE_COMMIT_DIR, "package_app_dependencies.sh").read_text()
25+
26+
assert 'PACKAGER_PYTHON="${PY313_BIN}/python"' in wrapper
27+
assert 'SCRIPT=("$PACKAGER_PYTHON" -m local_hooks.package_app_dependencies)' in wrapper
28+
assert "\"$PACKAGER_PYTHON\" -c 'import local_hooks'" in wrapper
29+
assert 'PYTHONPATH="$HOOKS_PYTHONPATH" "$PACKAGER_PYTHON" -c "$check_dependency_key"' in wrapper
30+
31+
32+
def test_package_wrapper_mounts_source_as_importable_local_hooks_package():
33+
"""The source mount must retain the ``/srv/local_hooks`` package layout."""
34+
wrapper = Path(PRE_COMMIT_DIR, "package_app_dependencies.sh").read_text()
35+
36+
assert '-v "$(dirname "$0")":/srv/local_hooks' in wrapper
37+
assert '-e "PYTHONPATH=/srv:/site-packages"' in wrapper
38+
assert '/bin/bash -c "/srv/local_hooks/$script_name"' in wrapper
39+
40+
2241
def test_package_wrapper_respects_explicit_python_runtime(tmp_path):
2342
wrapper = Path(PRE_COMMIT_DIR, "package_app_dependencies.sh").read_text()
2443
legacy_app_dir = os.path.join(PRE_COMMIT_DIR, "tests/data/py3-app")

‎pre-commit/dev-requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ jinja2
1212
mdformat
1313
jsonschema
1414
lxml
15-
django<5
15+
django>=5.2.16,<5.3
1616
jsondiff

‎pyproject.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "local-hooks"
7-
requires-python = ">=3.13,<3.15"
7+
requires-python = ">=3.13,<3.14"
88
version = "0.1.0"
99
dependencies = [
1010
"jinja2",
1111
"mdformat",
1212
"jsonschema",
1313
"lxml",
14-
"django<5",
14+
"django>=5.2.16,<5.3",
1515
"packaging>=24.2",
1616
"requests>=2.33.0",
1717
"pip-licenses",

0 commit comments

Comments
 (0)