chore(sdk): migrate from poetry to uv (#11162)

This commit is contained in:
Adrián Peña
2026-05-14 12:51:57 +02:00
committed by GitHub
parent 5f92989492
commit 7d3ed62e90
43 changed files with 4878 additions and 7288 deletions
+4 -4
View File
@@ -168,16 +168,16 @@ After validation passes, test the framework with Prowler:
```bash
# Verify framework is detected
poetry run python prowler-cli.py {provider} --list-compliance | grep {framework}
uv run python prowler-cli.py {provider} --list-compliance | grep {framework}
# Run a quick test with a single check from the framework
poetry run python prowler-cli.py {provider} --compliance {framework} --check {check_name}
uv run python prowler-cli.py {provider} --compliance {framework} --check {check_name}
# Run full compliance scan (dry-run with limited checks)
poetry run python prowler-cli.py {provider} --compliance {framework} --checks-limit 5
uv run python prowler-cli.py {provider} --compliance {framework} --checks-limit 5
# Generate compliance report in multiple formats
poetry run python prowler-cli.py {provider} --compliance {framework} -M csv json html
uv run python prowler-cli.py {provider} --compliance {framework} -M csv json html
```
---
+5 -5
View File
@@ -155,19 +155,19 @@ Current providers:
```bash
# Run provider
poetry run python prowler-cli.py {provider}
uv run python prowler-cli.py {provider}
# List services for provider
poetry run python prowler-cli.py {provider} --list-services
uv run python prowler-cli.py {provider} --list-services
# List checks for provider
poetry run python prowler-cli.py {provider} --list-checks
uv run python prowler-cli.py {provider} --list-checks
# Run specific service
poetry run python prowler-cli.py {provider} --services {service}
uv run python prowler-cli.py {provider} --services {service}
# Debug mode
poetry run python prowler-cli.py {provider} --log-level DEBUG
uv run python prowler-cli.py {provider} --log-level DEBUG
```
## Resources
+6 -6
View File
@@ -73,13 +73,13 @@ For detailed field documentation, see `references/metadata-docs.md`.
### 5. Verify Check Detection
```bash
poetry run python prowler-cli.py {provider} --list-checks | grep {check_name}
uv run python prowler-cli.py {provider} --list-checks | grep {check_name}
```
### 6. Run Check Locally
```bash
poetry run python prowler-cli.py {provider} --log-level ERROR --verbose --check {check_name}
uv run python prowler-cli.py {provider} --log-level ERROR --verbose --check {check_name}
```
### 7. Create Tests
@@ -243,16 +243,16 @@ class ec2_instance_hardened(Check):
```bash
# Verify detection
poetry run python prowler-cli.py {provider} --list-checks | grep {check_name}
uv run python prowler-cli.py {provider} --list-checks | grep {check_name}
# Run check
poetry run python prowler-cli.py {provider} --log-level ERROR --verbose --check {check_name}
uv run python prowler-cli.py {provider} --log-level ERROR --verbose --check {check_name}
# Run with specific profile/credentials
poetry run python prowler-cli.py aws --profile myprofile --check {check_name}
uv run python prowler-cli.py aws --profile myprofile --check {check_name}
# Run multiple checks
poetry run python prowler-cli.py {provider} --check {check1} {check2} {check3}
uv run python prowler-cli.py {provider} --check {check1} {check2} {check3}
```
## Resources
+4 -4
View File
@@ -309,16 +309,16 @@ assert result[0].project_id == GCP_PROJECT_ID # GCP
```bash
# All SDK tests
poetry run pytest -n auto -vvv tests/
uv run pytest -n auto -vvv tests/
# Specific provider
poetry run pytest tests/providers/{provider}/ -v
uv run pytest tests/providers/{provider}/ -v
# Specific check
poetry run pytest tests/providers/{provider}/services/{service}/{check_name}/ -v
uv run pytest tests/providers/{provider}/services/{service}/{check_name}/ -v
# Stop on first failure
poetry run pytest -x tests/
uv run pytest -x tests/
```
## Resources
+4 -4
View File
@@ -16,7 +16,7 @@ allowed-tools: Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task
| Component | Stack | Location |
|-----------|-------|----------|
| SDK | Python 3.10+, Poetry | `prowler/` |
| SDK | Python 3.10+, uv | `prowler/` |
| API | Django 5.1, DRF, Celery | `api/` |
| UI | Next.js 16, React 19, Tailwind 4 | `ui/` |
| MCP | FastMCP 2.13.1 | `mcp_server/` |
@@ -25,9 +25,9 @@ allowed-tools: Read, Edit, Write, Glob, Grep, Bash, WebFetch, WebSearch, Task
```bash
# SDK
poetry install --with dev
poetry run python prowler-cli.py aws --check check_name
poetry run pytest tests/
uv sync
uv run python prowler-cli.py aws --check check_name
uv run pytest tests/
# API
cd api && uv run python src/backend/manage.py runserver
+7 -7
View File
@@ -75,7 +75,7 @@ pnpm test:coverage -- components/feature/
fd "*_test.py" tests/providers/aws/services/ec2/
# 2. Run specific test
poetry run pytest tests/providers/aws/services/ec2/ec2_ami_public/ -v
uv run pytest tests/providers/aws/services/ec2/ec2_ami_public/ -v
# 3. Read existing tests
```
@@ -356,16 +356,16 @@ pnpm test ComponentName # Filter by name
### SDK (`prowler/`)
```bash
poetry run pytest tests/path/ -v # Run specific tests
poetry run pytest tests/path/ -v -k "test_name" # Filter by name
poetry run pytest -n auto tests/ # Parallel run
poetry run pytest --cov=./prowler tests/ # Coverage
uv run pytest tests/path/ -v # Run specific tests
uv run pytest tests/path/ -v -k "test_name" # Filter by name
uv run pytest -n auto tests/ # Parallel run
uv run pytest --cov=./prowler tests/ # Coverage
```
### API (`api/`)
```bash
poetry run pytest -x --tb=short # Run all (stop on first fail)
uv run pytest -x --tb=short # Run all (stop on first fail)
uv run pytest api/src/backend/api/tests/test_file.py # Specific file
poetry run pytest -k "test_name" -v # Filter by name
uv run pytest -k "test_name" -v # Filter by name
```