Skip to content

Commit 839b79e

Browse files
feat: Improve local dev experience with file-aware hooks and auto parallelization (feast-dev#5956)
1 parent b8c6f3d commit 839b79e

3 files changed

Lines changed: 23 additions & 10 deletions

File tree

.pre-commit-config.yaml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,31 @@ default_stages: [commit]
33
repos:
44
- repo: local
55
hooks:
6-
- id: format
7-
name: Format
6+
# File-aware format hook - only runs on changed Python files
7+
# Runs both ruff check --fix and ruff format
8+
- id: format-files
9+
name: Format Changed Files
810
stages: [commit]
911
language: system
10-
entry: make format-python
11-
pass_filenames: false
12-
- id: lint
13-
name: Lint
12+
types: [python]
13+
entry: bash -c 'uv run ruff check --fix "$@" && uv run ruff format "$@"' --
14+
pass_filenames: true
15+
16+
# File-aware lint hook - only runs on changed Python files
17+
# Runs both ruff check and ruff format --check
18+
- id: lint-files
19+
name: Lint Changed Files
1420
stages: [commit]
1521
language: system
16-
entry: make lint-python
17-
pass_filenames: false
22+
types: [python]
23+
entry: bash -c 'uv run ruff check "$@" && uv run ruff format --check "$@"' --
24+
pass_filenames: true
25+
26+
# Conditional template hook - only runs when template files or roadmap change
1827
- id: template
1928
name: Build Templates
2029
stages: [commit]
2130
language: system
31+
files: ^infra/templates/|\.jinja2$|^docs/roadmap\.md$
2232
entry: make build-templates
2333
pass_filenames: false

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ test-python-integration: ## Run Python integration tests (CI)
199199
# Integration tests with better parallelization
200200
test-python-integration-parallel: ## Run integration tests with enhanced parallelization
201201
uv run python -m pytest sdk/python/tests/integration \
202-
-n auto --dist loadscope \
202+
-n auto --dist loadgroup \
203203
--timeout=300 --tb=short -v \
204204
--integration --color=yes --durations=20
205205

@@ -209,7 +209,7 @@ test-python-integration-local: ## Run Python integration tests (local dev mode)
209209
HADOOP_HOME=$$HOME/hadoop \
210210
CLASSPATH="$$( $$HADOOP_HOME/bin/hadoop classpath --glob ):$$CLASSPATH" \
211211
HADOOP_USER_NAME=root \
212-
uv run python -m pytest --tb=short -v -n 8 --color=yes --integration --durations=10 --timeout=1200 --timeout_method=thread --dist loadgroup \
212+
uv run python -m pytest --tb=short -v -n auto --color=yes --integration --durations=10 --timeout=1200 --timeout_method=thread --dist loadgroup \
213213
-k "not test_lambda_materialization and not test_snowflake_materialization" \
214214
-m "not rbac_remote_integration_test" \
215215
--log-cli-level=INFO -s \

sdk/python/pytest.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ markers =
1717
rbac_remote_integration_test: RBAC and remote functionality tests
1818
integration: Integration tests (slower, requires services)
1919
benchmark: Benchmark tests
20+
slow: Tests taking >30 seconds
21+
cloud: Tests requiring cloud credentials
22+
local_only: Tests that run entirely locally
2023

2124
timeout = 300
2225
timeout_method = thread

0 commit comments

Comments
 (0)