Skip to content

Commit 155f344

Browse files
committed
replaced pre-commit with faster and compatible prek
1 parent 5af2ca9 commit 155f344

6 files changed

Lines changed: 66 additions & 110 deletions

File tree

gateway/justfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ git_root := gwy_root + "/.."
2020
uv_cmd := docker_compose + " run '" + app_container + "' uv"
2121
uv_runner := uv_cmd + " run"
2222

23+
alias hooks := pre-commit
2324
alias run := up
2425
alias upgrade := update
2526

@@ -131,7 +132,7 @@ dev-setup:
131132

132133
# install pre-commit hooks
133134
echo "Installing pre-commit hooks..."
134-
uv run pre-commit install
135+
uv run prek install -f
135136

136137
echo -e "\n\e[32m✓ Development environment setup complete\e[0m"
137138
echo -e "\nFor recommended VS Code extensions, see ../sds-code.code-workspace"
@@ -184,8 +185,8 @@ down *args:
184185
# runs the pre-commit hooks with dev dependencies
185186
[group('development')]
186187
pre-commit:
187-
uv run pre-commit install
188-
uv run --dev pre-commit run --all-files
188+
uv run prek install -f
189+
uv run --dev prek run --all-files
189190

190191
# rebuilds then restarts services and shows logs
191192
[group('service')]
@@ -275,7 +276,7 @@ up *args:
275276
update:
276277
# these run on the host machine, so uv_runner is not used
277278
@echo "Upgrading pre-commit hooks"
278-
uv run pre-commit autoupdate
279+
uv run prek autoupdate
279280
@echo "Upgrading gateway dependencies"
280281
uv sync --upgrade --all-extras
281282
@echo "Upgrading node dependencies"

gateway/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"django-types>=0.19.1",
6666
"djangorestframework-stubs[compatible-mypy]>=3.15.1",
6767
"djlint>=1.35.2",
68-
"pre-commit>=4.0",
68+
"prek>=0.3.4",
6969
"psycopg[c]>=3.2",
7070
"rich>=13.9.3",
7171
"ruff>=0.7",
@@ -160,6 +160,7 @@
160160
"flower", # executable used by celery
161161
"gunicorn", # production wsgi server
162162
"pre-commit", # hook runner used in dev
163+
"prek", # runs pre-commit hooks
163164
"psycopg", # postgres driver configured in settings
164165
"pytest-cov", # coverage plugin in tests
165166
"pytest-sugar", # better progress output for pytest

gateway/uv.lock

Lines changed: 21 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/justfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test_marker_integration := "integration"
77
sdk_root := justfile_directory()
88
git_root := sdk_root + "/.."
99

10+
alias hooks := pre-commit
1011
alias install := dev-setup
1112
alias serve := serve-coverage
1213

@@ -81,15 +82,15 @@ gact *args:
8182
[group('development')]
8283
dev-setup:
8384
uv sync --dev --frozen
84-
uv run pre-commit install --install-hooks
85+
uv run prek install --install-hooks
8586

8687
# runs pre-commit checks locally, incl. deptry for dependency issues
8788
[group('development')]
8889
[group('qa')]
8990
pre-commit:
9091
uv run deptry .
91-
uv run pre-commit install --install-hooks
92-
uv run --dev pre-commit run --all-files
92+
uv run prek install --install-hooks
93+
uv run --dev prek run --all-files
9394

9495
# runs Pyright checks locally
9596
[group('development')]
@@ -226,4 +227,4 @@ publish:
226227
[group('development')]
227228
update:
228229
uv sync --upgrade --dev
229-
uv run pre-commit autoupdate
230+
uv run prek autoupdate

sdk/pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,20 @@
4646
[dependency-groups]
4747

4848
dev = [
49+
"anyio[trio]>=4.11.0",
50+
"beautifulsoup4>=4.13.3",
4951
"deptry>=0.20.0",
52+
"mkdocs-material>=9.6.22",
53+
"mkdocs>=1.6.1",
54+
"mkdocstrings[python]>=0.30.1",
55+
"prek>=0.3.4",
56+
"pyrefly>=0.42.1",
5057
"pytest-cov>=5.0.0",
5158
"pytest-responses>=0.5.1",
5259
"pytest>=8.3.3",
5360
"pytz>=2024.2",
5461
"rich>=13.9.4",
5562
"ruff>=0.7.2",
56-
"beautifulsoup4>=4.13.3",
57-
"mkdocstrings[python]>=0.30.1",
58-
"mkdocs>=1.6.1",
59-
"mkdocs-material>=9.6.22",
60-
"anyio[trio]>=4.11.0",
61-
"pyrefly>=0.42.1",
6263
]
6364

6465
# deptry detects unused and missing dependencies.

0 commit comments

Comments
 (0)