Skip to content

Commit 54ec2c2

Browse files
committed
refactor(build): run venv-dependent scripts via 'uv run python'
The architecture validators (validate_cqrs.py, check_architecture.py) import PyYAML but were invoked as bare ./script.py, i.e. under the system Python with no venv — so they failed with ModuleNotFoundError once dependency setup stopped leaving the venv active. Invoke every venv-dependent project script via 'uv run python ./...' (matching ci-arch-imports). Bootstrap scripts that must run before the venv exists stay bare; installed console tools keep using run-tool.
1 parent ab28e25 commit 54ec2c2

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

makefiles/ci.mk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,24 @@ ci-quality: ci-quality-ruff ci-quality-pyright ## Run all enforced code quality
2626
ci-quality-full: ci-quality-ruff ci-quality-ruff-optional ci-quality-pyright ## Run all code quality checks including optional
2727

2828
# Individual architecture quality targets (with tool names)
29+
# Run the validators via `uv run` so they use the project venv (which has
30+
# PyYAML etc.), not the ambient system Python. A bare `./script.py` relied on
31+
# the venv being pre-activated by an earlier step, which no longer holds.
2932
ci-arch-cqrs: ## Run CQRS pattern validation
3033
@echo "Running CQRS pattern validation..."
31-
./dev-tools/quality/validate_cqrs.py
34+
uv run python ./dev-tools/quality/validate_cqrs.py
3235

3336
ci-arch-clean: ## Run Clean Architecture dependency validation
3437
@echo "Running Clean Architecture validation..."
35-
./dev-tools/quality/check_architecture.py
38+
uv run python ./dev-tools/quality/check_architecture.py
3639

3740
ci-arch-imports: dev-install ## Run import validation
3841
@echo "Running import validation..."
3942
uv run python ./dev-tools/quality/validate_imports.py
4043

4144
ci-arch-file-sizes: ## Check file size compliance
4245
@echo "Running file size checks..."
43-
./dev-tools/quality/dev_tools_runner.py check-file-sizes --warn-only
46+
uv run python ./dev-tools/quality/dev_tools_runner.py check-file-sizes --warn-only
4447

4548
ci-arch-lint-imports: dev-install ## Run import-linter layer-boundary contracts
4649
@echo "Running import-linter layer-boundary checks..."

makefiles/quality.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ security-scan: ; @$(MAKE) security
119119
# Architecture Quality Gates
120120
architecture-check: dev-install ## Run architecture compliance checks
121121
@echo "Running architecture quality checks..."
122-
./dev-tools/quality/validate_cqrs.py --warn-only
123-
./dev-tools/quality/check_architecture.py --warn-only
122+
uv run python ./dev-tools/quality/validate_cqrs.py --warn-only
123+
uv run python ./dev-tools/quality/check_architecture.py --warn-only
124124

125125
architecture-report: dev-install ## Generate detailed architecture report
126126
@echo "Generating architecture dependency report..."
127-
./dev-tools/quality/check_architecture.py --report
127+
uv run python ./dev-tools/quality/check_architecture.py --report
128128

129129
# Architecture Documentation Generation
130130
quality-gates: lint test architecture-check ## Run all quality gates

0 commit comments

Comments
 (0)